ObjectWeb Consortium
Print

Advanced Search - Powered by Google

  Consortium     Activities     Projects     Forge     Events 

Fractal


Project Links
· Home
· Documentation
· Download
· License
· What's New
· Wiki

Developers' Corner
· Workplan
· SVN Repository
· ObjectWeb Forge Site

About
· Team
· Users
· Partners
· Mailing List Archive

About this document

  • Title: Migration Guide
  • Author: Romain Rouvoy (University of Lille 1)
  • Version: 3.2.2 (fraclet-java)
  • Released: March 19th, 2009

Table of Contents

  1. Migrating from Fraclet XDoc (XDoclet)
  2. Migrating from Fraclet Annotations (Spoon)

Migrating from Fraclet XDoc

The table below summarises the changes operated between the former Fraclet XDoc implementation (left-side column) and the new one (right-side column). Please also read the user guide to get aware of the new features.

/** @component */@Component (+ @Membrane)

public class MyComponent implements Runnable { (...) }
@Component
public class MyComponent implements Runnable { (...) }
/** @component */
public class MyComponent implements Runnable { (...) }
@Component
public class MyComponent implements Runnable { (...) }
/** @component name=comp */
public class MyComponent implements Runnable { (...) }
@Component(name="comp")
public class MyComponent implements Runnable { (...) }

/** @component controller=myPrimitive */
public class MyComponent implements Runnable { (...) }
@Component
@Membrane(controller="myPrimitive")
public class MyComponent implements Runnable { (...) }

/** @component template=myTemplate */
public class MyComponent implements Runnable { (...) }
@Component
@Membrane(template="myTemplate")
public class MyComponent implements Runnable { (...) }
/** @provides */@Interface (+ @Component)
/** @provides */
public interface MyInterface { (...) }
@Interface
public interface MyInterface { (...) }
/** @provides name=itf */
public interface MyInterface { (...) }
@Interface(name="itf")
public interface MyInterface { (...) }
/** @provides name=r signature=java.lang.Runnable */
public class MyComponent implements Runnable { (...) }
@Component(provides=@Interface(name="r",signature=Runnable.class))
public class MyComponent implements Runnable { (...) }
/** @requires */@Requires

public class MyComponent {
  /** @requires */
  protected MyInterface itf;
}
@Component
public class MyComponent {
  @Requires
  protected MyInterface itf;
}

public class MyComponent {
  /** @requires name=my-itf */
  protected MyInterface itf;

  /** @requires name=my-itf cardinality=collection signature=MyInterface */
  protected Map itf = new HashMap();
}
@Component
public class MyComponent {
  @Requires(name="my-itf")
  protected MyInterface itf;

  @Requires(name="my-itf",cardinality=Cardinality.COLLECTION) */
  protected Map<String,MyInterface> itf = new HashMap<String,MyInterface>();
}
/** @attribute */@Attribute

public class MyComponent {
  /** @attribute */
  protected int counter;
}
@Component
public class MyComponent {
  @Attribute
  protected int counter;
}

public class MyComponent {
  /** @attribute name=count value=1 */
  protected int counter;
}
@Component
public class MyComponent {
  @Attribute(name="count",value="1")
  protected int counter;
}
/** @control */@Controller

public class MyComponent {
  /** @control */
  protected Component comp;
}
@Component
public class MyComponent {
  @Controller
  protected org.objectweb.fractal.api.Component comp;
}

public class MyComponent {
  /** @control name=name-controller */
  protected NameController nc;
}
@Component
public class MyComponent {
  @Controller("name-controller")
  protected NameController nc;
}
/** @lifecycle */@Lifecycle

public class MyComponent {
  /** @lifecycle when=start */
  protected void whenStart() { (...) }
}
@Component
public class MyComponent {
  @Lifecycle(step=Step.START) */
  protected void whenStart() { (...) }
}
/** @data */@Data
/** @data */
public class MyData { (...) }
@Data
public class MyData { (...) }
/** @logger */No more supported

public class MyComponent {
  /** @logger */
  protected Logger log;
}
@Component
public class MyComponent {

  protected Logger log = Logger.getLogger("MyComponent");
}
/** @monolog.handler */No more supported

Migrating from Fraclet Annotation

The table below summarises the changes operated between the former Fraclet Annotation implementation (left-side column) and the new one (right-side column). Please also read the user guide to get aware of the new features.

@FractalComponent@Component (+ @Membrane)
@FractalComponent
public class MyComponent implements Runnable { (...) }
@Component
public class MyComponent implements Runnable { (...) }

@FractalComponent(controllerDesc="myPrimitive")
public class MyComponent implements Runnable { (...) }
@Component
@Membrane(controller="myPrimitive")
public class MyComponent implements Runnable { (...) }
@Interface@Interface
@Interface
public interface MyInterface { (...) }
@Interface
public interface MyInterface { (...) }
@Interface(name="itf")
public interface MyInterface { (...) }
@Interface(name="itf")
public interface MyInterface { (...) }
@Provides@Component
@Provides(interfaces=@Interface(name="r",signature=Runnable.class))
public class MyComponent implements Runnable { (...) }
@Component(provides=@Interface(name="r",signature=Runnable.class))
public class MyComponent implements Runnable { (...) }
@Requires@Requires
@FractalComponent
public class MyComponent {
  @Requires
  protected MyInterface itf;
}
@Component
public class MyComponent {
  @Requires
  protected MyInterface itf;
}
@FractalComponent
public class MyComponent {
  @Requires(name="my-itf")
  protected MyInterface itf;

  @Requires(name="my-itf",cardinality=Cardinality.COLLECTION) */
  protected Map<String,MyInterface> itf = new HashMap<String,MyInterface>();
}
@Component
public class MyComponent {
  @Requires(name="my-itf")
  protected MyInterface itf;

  @Requires(name="my-itf",cardinality=Cardinality.COLLECTION) */
  protected Map<String,MyInterface> itf = new HashMap<String,MyInterface>();
}
@Attribute@Attribute
@FractalComponent
public class MyComponent {
  @Attribute
  protected int counter;
}
@Component
public class MyComponent {
  @Attribute
  protected int counter;
}
@FractalComponent
public class MyComponent {
  @Attribute(argument="count",value="1")
  protected int counter;
}
@Component
public class MyComponent {
  @Attribute(name="count",value="1")
  protected int counter;
}
@Service@Controller
@FractalComponent
public class MyComponent {
  @Service
  protected Component comp;
}
@Component
public class MyComponent {
  @Controller
  protected org.objectweb.fractal.api.Component comp;
}
@LifeCycle@Lifecycle
@FractalComponent
public class MyComponent {
  @LifeCycle(on=LifeCycleType.START) */
  protected void whenStart() { (...) }
}
@Component
public class MyComponent {
  @Lifecycle(step=Step.START) */
  protected void whenStart() { (...) }
}
@MonologNo more supported
@FractalComponent
public class MyComponent {
  @Monolog
  protected Logger log;
}
@Component
public class MyComponent {

  protected Logger log = Logger.getLogger("MyComponent");
}
@MonologHandlerNo more supported

Copyright © 1999-2009, OW2 Consortium | contact | webmaster | Last modified at 2012-12-03 09:57 PM