MagmaAnnotationsVsConfigurationPage added by Simone GianniAnnotations and configurationJava 5 introduced annotations. Annotations are great cause they provide :
Annotations are gaining popularity as an alternative to configuration. For example, JPA can work with an XML file defining it's configuration or with annotations placed on the beans directly. Annotations, however, are unfortunately extremely static. Also using aspects and other advanced programming techniques that offer a more dynamic system, still annotations are static. So, in Magma, we had to setup guidelines for using annotations, configuration, aspects or other runtime systems to achieve a good balance between simplicity, customizability and dynamicity. When Magma uses annotationsMagma uses annotations as much as possible, cause they are easy and fast to use. Since they are not dynamic, annotations are used to express default settings in a quick and easy way. When Magma uses configurationConfiguration should be used only when supplying a parameter that is configurable. Such a parameter should be avalue that does not change a behaviour. For example, the email SMTP address is a good parameter, but a boolean to decide whether to support HTML emails or not should not be a parameter but an aspect in a specific component. When Magma uses additional componentsSince Magma uses composition for both data and behaviours, where many frameworks use configuration options Magma uses additional components that can be woven when needed. This gives a great advantage for runtime performance, compile time checking of the code and with IDE content assist. Additional components are added or removed using the Maven pom.xml file. When Magma uses runtime systemsAll the systems described above are compile time. Often there is the need to change things at runtime depending on runtime conditions. For these situations Magma offers proper manipulation methods and callbacks. Where Magma does not provide sufficient support, aspects can always be written to change the behaviour.
Change Notification Preferences
View Online
|
Add Comment
|
- [CONF] Apache Labs > MagmaAnnotationsVsConfiguration confluence
- [CONF] Apache Labs > MagmaAnnotationsVsConfiguration confluence
- [CONF] Apache Labs > MagmaAnnotationsVsConfiguration confluence
- [CONF] Apache Labs > MagmaAnnotationsVsConfiguration confluence
