Masters project on how to annotate source code to make sure that architectural patterns/styles, used to design a system, is upheld in the actual implementation.
compile the project and then call:
javac -processor com.apkc.archtype.processors.ComponentProcessor -cp ~/path/to/archtype-1.0.jar
path/to/TestController.java path/to/TestView.java path/to/TestModel.java
An annotation looks like this
@Component(
patterns = {@Pattern(name="testMvc",kind = "MVC", role="Controller"), @Pattern(...)}
)
Certain patterns may require meta data, such as layers and presenter-abstraction-control. This can be done by post fixing the role name with the meta data in {}. Like this:
@Component(
patterns = {@Pattern(name="testLayer",kind = "Layered", role="layer{1}")}
)
where patterns is a list of patterns the component participates in. A pattern consists of a name of the pattern, the kind of the pattern, and the role the components plays in the pattern.
- Layers ( Components: Layer{layer#}, Pattern name: Layered)
- Indirection Layers ( Components: Inlayer{inlayer#}, Pattern name: Indirectionlayer)
- Model-View-Control ( Components: Model, View, Controller, Pattern name: MVC)
- Client-Server ( Components: Client, Server, Pattern name: clientserv)
- Peer-to-Peer ( Components: Peer, Pattern name: peer2peer)
- Publish-Subscribe ( Components: Producer, SubscriptionManager, Consumer, Pattern name: publishsubscribe)
- Shared Repository
- Active Repository
- Blackboard
all extern jars should be placed in lib/ folder.
You have to install alloy locally to maven
mvn install:install-file -Dfile=/path/to/alloy4.2.jar -DgroupId=alloy4.2 -DartifactId=alloy4 -Dversion=1.0.0 -Dpackaging=jar
Also make sure that the java jdk and jre are the same by updating and by setting:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home"