Simple Transformer
SiTra is a simple Java library for supporting a programming approach to writing transformations aiming to, firstly use Java for writing transformations, and secondly, to provide a minimal framework for the execution of transformations. SiTra consists of two interfaces and a class that implements a transformation algorithm. The aim is to facilitate a style of programming that incorporates the concept of transformation rules. The two interfaces are as follows and are described below.
Click Here

 interface Rule<S,T> {

   boolean check(S source);

   T build(S source, Transformer t);

   void setProperties(T target, S source, Transformer t);


 interface Transformer {

   Object transform(Object source);

   List<Object> transformAll(List<Object> sourceObjects);

   <S,T> T transform(Class<Rule<S,T>> ruleType, S source);

   <S,T> List<T> transformAll(Class<Rule<S,T>> ruleType, List<S> source);


Description  Rule interface: A class that implements this interface should be written for each of the rules in the transformation. The methods of this interface are described as follows:

1. The implementation of the check method should return a value of true if the rule is applicable to the source object. This is particularly important if multiple rules are applicable for objects of the same type. This method is used to distinguish which of multiple rules should be applied by the transformer.

2. The build method should construct a target object that the source object is to be mapped to. A recursive chain of rules must not be invoked within this method.

3. The setProperties method is used for setting properties of the target object (attributes or links to other objects). Setting the properties is split from constructing the target so that recursive calling of rules is possible when setting properties.

Transformer: In order to use the rules, add the rule classes to an instance of the Transformer interface and call the transform method with the root object(s) of the source model.



Latest News 28.06.11 Brand new Sitra website goes live. New website contains more updated information regarding the SiTra object.


16.04.10 C# version of SiTra is available for download now. For more details please Click Here.

15.09.08 SiTra (Simple Transformer) project introduced. Tool is available for download.

Contact Us Dr. Behzad Bordbar,
School of Computer Science,
University of Birmingham,
B15 2TT, Birmingham
United Kingdom.

For online Enquiry

Phone: 0044 (0) 121 414 3487
B.Bordbar  {-AT_} cs.bham.ac.uk