DCSIMG
September 2008 - Posts - IHateSpaghetti {code}

IHateSpaghetti {code}

VSX, DSL and Beyond by Eyal Lantzman

Syndication

Coding / Architecture

Extensibility /DSL

Projects

Articles

September 2008 - Posts

In this carnival there're a lot of software design/patterns and frameworks a bit of SOA, UML, DSL and NDepend and  . . .  V I S U A L   S T U D I O  2 0 1 0 !!!

 

 

UML

Visual Studio 2010

DSL

F# and functional programming

Software design ,Design Patterns and Frameworks

SOA

NDepend

After a couple of weeks of crappy Internet connections I finally managed to connect via my cell phone (still crappy though).

Visual Studio Extensibility

DSL

ASP.NET

 

Algorithms

 

Functional programming

Tools and Frameworks

TDD

SOA

DSL Tools

 

Web

 

Architecture/ System Design

 

Functional programming

Testing

 

ALT.NET

 

Blogging and general thoughts and discussions

Check the EULA

11. Content license from you

11.1 You retain copyright and any other rights you already hold in Content which you submit, post or display on or through, the Services. By submitting, posting or displaying the content you give Google a perpetual, irrevocable, worldwide, royalty-free, and non-exclusive license to reproduce, adapt, modify, translate, publish, publicly perform, publicly display and distribute any Content which you submit, post or display on or through, the Services. This license is for the sole purpose of enabling Google to display, distribute and promote the Services and may be revoked for certain Services as defined in the Additional Terms of those Services.

11.2 You agree that this license includes a right for Google to make such Content available to other companies, organizations or individuals with whom Google has relationships for the provision of syndicated services, and to use such Content in connection with the provision of those services.

11.3 You understand that Google, in performing the required technical steps to provide the Services to our users, may (a) transmit or distribute your Content over various public networks and in various media; and (b) make such changes to your Content as are necessary to conform and adapt that Content to the technical requirements of connecting networks, devices, services or media. You agree that this license shall permit Google to take these actions.

11.4 You confirm and warrant to Google that you have all the rights, power and authority necessary to grant the above license.

Posted by Eyal | 1 comment(s)
תגים:

The new bits for my AOP framework.

The changes for the helper class were relatively minimal.

Method creation:

   1: public IGenerationContext CreateMethod(TypeBuilder typeBuilder, MethodInfo method)
   2: {
   3:     Type[] parameterTypes = GetParameterTypes(method);
   4:     MethodAttributes attributes = MethodAttributes.Public;
   5:     if (!method.IsFinal)
   6:         attributes |= MethodAttributes.Virtual;
   7:  
   8:     MethodBuilder methodInfoBody = typeBuilder.DefineMethod(
   9:         method.Name,
  10:         attributes,
  11:         method.CallingConvention,
  12:         method.ReturnType,
  13:         parameterTypes);
  14:    
  15:     methodInfoBody.InitLocals = true;
  16:  
  17:     if (method.IsGenericMethodDefinition)
  18:     {
  19:         Type[] genericParameterTypes = method.GetGenericArguments();
  20:         string[] names = new string[genericParameterTypes.Length];
  21:         for (int i = 0; i < genericParameterTypes.Length; i++)
  22:             names[i] = "T" + i.ToString();
  23:         GenericTypeParameterBuilder[] genericParams = methodInfoBody.DefineGenericParameters(names);
  24:     }
  25:     ILGenerator generator = methodInfoBody.GetILGenerator();
  26:     return GenerationContext.SetCurrentContext(typeBuilder,generator, method);
  27: }

Array population:

   1: public Helper PopulateArray(IVariable arrayInstance, Type arrayItemType, Type[] parametersTypes, IVariable[] parameters, int offset, int length)
   2:        {
   3:            if (parametersTypes.Length != parameters.Length)
   4:                throw new InvalidOperationException("the number of parameter types is inconsistent with parameters number");
   5:  
   6:            int processed = 0;
   7:            for (int i = offset; i < parametersTypes.Length && processed < length; i++)
   8:            {
   9:                arrayInstance.Load();
  10:                GenerationContext.CurrentContext.Generator.Emit(OpCodes.Ldc_I4, i);           //load the array item i
  11:  
  12:                parameters[i].Load(); //load the variable
  13:  
  14:  
  15:                if (!arrayItemType.IsByRef)
  16:                {
  17:                    if (parametersTypes[i].IsValueType || parametersTypes[i].IsGenericParameter)
  18:                        GenerationContext.CurrentContext.Generator.Emit(OpCodes.Box, parametersTypes[i]);      //box value types
  19:  
  20:                }
  21:                GenerationContext.CurrentContext.Generator.Emit(OpCodes.Stelem_Ref);   //replace array item i
  22:  
  23:            }
  24:            return this;
  25:        }

I made a couple of more changes see the helper class for more information. 

 

There are 2 advice classes - feel free to add more.

 

P.S if you want to help me with this project drop me a note (if have ideas for couple of new features that might be useful).

 

That's it for this time as before you can download the relevant change set (38824) or browse the code in this project's codeplex site.

Visual Studio Extensibility/ DSL Tools

 

ASP.NET MVC

 

IIS

 

ESB

 

Architecture / Software Design

Posted by Eyal | with no comments