Monday, March 23, 2009

Week 33

Development

Design -


The MIS design is a simple one. The three object with their relative composition and relationship links. The design's most complex parts is the middleware and even though i have the requirements, working out how these actions will get done is still a blur in my head.


I started putting the actual code together in the frameworks I am using. This week I successfully built a basic structure and I'm coding in the objects slowly but surely.

The process of entering an object in appfuse and configuring it is very structured and a bit more work that I am used to.

First we must write the POJO (Plain Old Java Object).
With Setters and getter, no args constructor and to string methods.

Then each object that must be persisted must have a DAO interface and an implementation of that interface.

The access to the DAO's is provided by managers. The actual manager class is the interface and there must be a implementation of the interface (just as with the DAO).

The next step is to define an action class for the object. The action class is the connection between the web tier of the system and the business logic.

We implement the logic with the Objects and their DAO's and the managers and the Web Application part is structured in using Struts2 in appfuse as a separate logic. (This makes it significantly easier to extend implementation of either part of the whole app)

So I have all the objects thus far connected and using the hibernate annotations to be persisted to the databases. Joining the tables took some work ... but the associations and the compositions are cohesive and working.


Also the framework (Struts2) promotes test first development. This means that the managers, DAO and action classes all have test that are written before the actual classes.
Test driven architecture.






No comments: