Tag Archives: plastic

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


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 III: @Property

Remember the @Property annotation in Tapestry, let us try its implementation in Plastic. In order to transform an existing class in Tapestry, it has to be placed in a controlled package. This package has to be passed to the PlasticManager along with the PlasticClassTransformer for the magic to take place. 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

Meeting Plastic I: Introduction

With Tapestry, you know things improve very fast. For the users, everything stays much the same(Ok, only after Tapestry5) but for developers, it keeps you on your toes especially if you are constantly peeking into the source code. In Tapestry 5.3, we are going to see complete replacement of Javassist by Plastic. It is a wrapper around ASM.

Continue reading

%d bloggers like this: