Category Archives: asm

Meeting Plastic V: A Method Shadow Builder

There are two shadow builders in tapestry, PropertyShadowBuilder(tapestry-ioc) and EnvironmentalShadowBuilder(tapestry-core) . PropertyShadowBuilder is used to create a service from a property of an object(source). It create a proxy for the service interface and then delegates all method calls of that service to the getter method of the source. In this post we will create a more generic shadow builder which will take a source, a method name and a set of parameters and in return create a service that will delegate all method calls to the given source method.
Continue reading

Meeting Plastic IV: Replacing interfaces

One of the most common use of class transformation is replacing interfaces by annotations. Earlier j2ee frameworks used to put restrictions on your classes by forcing you to implement a particular interface. Nowadays, modern frameworks just ask you to put an annotation here and there and the rest is handled by the framework. This gives you the freedom of working with pojos. Continue reading

ASM : Creating a ChainBuilder

ASM is to Plastic what javascript is to JQuery

Just curious about how ASM library works, I tried to create a simple Chain of Responsibility Pattern that I had already done in this post. It is a simple implementation where in the methods return void. Learning ASM is a good thing if you ever want to generate/transform bytecode. It will also help you understand the inner workings of Plastic. Continue reading

Meeting Plastic II: Simple ChainBuilder

This is a simple implementation of a Chain Of Responsibility or Chain Of Command design pattern. We already have such a service in TapestryIOC and I thought of implementing the same in Plastic.

In Chain of Command design pattern, we create a single service from a set of commands which implement a common interface. This pattern can be provided out of the box by using Class transformations. The assembled service will run all the commands in the given sequence unless any of the commands throw an exception. I am keeping the example simple by forcing the methods in the command interface to return only void.

Continue reading

Follow

Get every new post delivered to your Inbox.

Join 91 other followers

%d bloggers like this: