📄️ Pamela : an annotation-based Java modelling framework
openflexo-core component
📄️ Model at runtime computation
PAMELA model at runtime is computed dynamically, working on the classpath of launched java application, and starting from a simple java interface (or a collection of java interfaces) which is/are PAMELA-annotated. From a mathematical point of view, internal representation of the underlying model is a graph whose vertex are PAMELA ModelEntities (annotated java interface), and edges are either inheritance links or reference links (a property whose type is another ModelEntity). @Imports and @Import annotations allows to include some other ModelEntities in the model. On the contrary, an annotation attribute @Getter(...ignoreType=true) allows to ignore the link. In that context, PAMELA model computation is a graph closure computation, starting from a collection of vertices.
📄️ PAMELA objects life-cycle management
A Metamodel computation is represented by a ModelContext and uses a ModelFactory built with that model context to handle instances of that metamodel. The ModelFactory is responsible of the life-cycle of instances of metamodel (construction and destruction of Java instances). @Initializer annotation allows to define parametered constructors for ModelEntity instances.
📄️ Meta-programming support
Following figure represents PAMELA metamodel.
📄️ Multiple inheritance and traits programming
Traits programming is generally described as a way to organize the code around the notion of feature (while a more classical methodology in object-oriented programming present a class-oriented structure, where a class generally combines many features around the notion of responsability). With traits programming, classes are defined as the composition of traits using inheritance operation. Multiple inheritance is thus a requirement for such a programming methodology, at the condition that naming collisions (known as diamond problem) may be solved by explicit disambiguation.
📄️ Containment management
As it was previously described, PAMELA metamodel supports containment.
📄️ Cloning support
PAMELA framework offers cloning features, and support is provided for many cloning strategies.
📄️ Clipboard operations
PAMELA framework offers a native support for clipboard operations. Model should be annotated with @PastingPoint annotations, defined on ModelProperty. This indicates that this property may receive the "pasting" of the contents of a given clipboard, if the type of data in clipboard is assignable to the related property (either a single object or a set of object with a compatible type).
📄️ Notification support
Without any intervention of the developper, PAMELA framework offers a fine-tuned notification support. This notification scheme relies on the execution of write-access ModelProperties (properties using set, add, remove and undelete: protocols). Since the execution of ModelProperty-related methods is performed by embedded PAMELA interpreter, a default notification scheme is executed.
📄️ Persistance support, XML serialization/deserialization
In most applications, persistency is generally required to guarantee the recovery and communication of structured data along time and applications.
📄️ Equality computing support
PAMELA framework additionnaly offers various interesting features in the context of object graph manipulations, such as equality computation, visiting patterns, and diff/merge support with differential updating.
📄️ Visiting features
Visitor pattern is offered by AccessibleProxyObject base API, with the two methods accept(PAMELAVisitor) and accept(PAMELAVisitor,VisitingStrategy).
📄️ Differential updating
Differential updating for object graphs is natively supported using method
📄️ Validation API
PAMELA framework natively offers a validation definition scheme at ModelEntity level. To be validable, the ModelEntity support interface must extends Validable interface. This allows to define a set of ValidationRules.
📄️ Support for Contract Programming, JML
The Design by Contract (DbC) concept was coined by B. Meyer as an approach to design reliable software based on the idea that elements of a software system collaborate with each other on the basis of mutual obligations and benefits.
📄️ Design patterns / Aspect programming / Code weaving
PAMELA framework offers some Aspect-Oriented Programming (AOP) features enabling the definition of additional behaviour to existing Java code. Code weaving is performed at run-time.