Wednesday, March 25, 2009

Week 35

The Challenge of using more than one object oriented framework has proven to be much larger than I can handle under the stress of my final year project.

Initially I considered differing and starting a new project for another year. All my lecturers advised me to try and finish this project before April 17th.

I resorted to starting over my development using a contingency I had in mind from the beginning; C# using the DOT NET 3.5 framework. I am familiar with the environment, I used it in the development of the last course work in this degree.

There are high risks involved here; just because i used this environment before does not mean i know all the details for every facet of development in DOT NET. I have little experience here as well and I know where one framework will provide advantage I'm sure to find dis advantage as well.

The thing is I know how to create and connect web services in DOT NET so the main hurdle I can cross.

My lecturers advised a few days of rest before i start the next development phase.

So starting next week I have a little over 2 weeks to develop my entire 3 part system and write my report.

Week 36 - Monday 23

From Sunday 22nd March 2009

Work on the new platform - Dot Net 3.5 Environment.


Approach -

Seeing as the time frame is so short I have to re thing how i normally approach coding. There was a great advantage with the previous environment that i could write test and the testing framework (Junit and Jmock) would facilitate creating mock object and prevent continuous persistance of test while foundationing integration of test with every build (BVT - Build Verification Testing). Using C# I would have to write my own test. I dont know if i will have time to write test methods. The test strategy may have to change. Instead of automated unit testing I would now have to rely on more user testing of specific modules.

That aside I have decided to build the system in parts keeping the MVC structure used by the Struts 2 App Framework. In parts meaning instead of layer Models first, Controller/ Managers and then Views... I will have all facets (hopefully in time) but I would like to code by process. So I did login already. I have the base users and the dao for that base object and a view. Functionality only. I still need to come up with a design. I will try to do that today.



Time Frame -
12pm Sunday 22 - 3pm Monday

Work Done -
  1. Started Database in SQL Server 2005
  2. Wrote the basic objects necessary for login.
  3. Login Successful ...

Problems Encounters -

  • Familiarity with the environment
    After working for more than half a year in java and using a conglomeration of frameworks its a very sharp turn to get back into the mode of thinking necessary to build in C#. I have used C# and the .Net environment before, for course work and briefly at one of my previous jobs (The job experience was VB not C but in .Net 3.5). The previous experience could not displace the mental conditioning of working in so many different inter working Java frameworks - even though they provided differing functions and they individually varied in syntax it was still java and xml mostly and i grew dependently familiar with the style of syntax, use of annotations and other new things i was never previously aware of in Programming code.

  • When i attempted to test the first DAO it continually failed.
    The DAO code seemed fine. After 2 hours I moved around the code accessing it. Eventually after tweaking the 'code behind' of a web form the failures proved to be just lack of practice with the language.

  • I am constantly mixing up the design patterns. I used Facade the last time I built in .Net - And I am only a student programmer. As a result i realise i have associated the pattern with the environ. I learnt MVC in java. So some mental re - arranging is necessary.

Week 34

FrameWork Problems.


Before entering the actual objects in the framework I did the tutorial for the appfuse site. The tutorial exposed the Manager Classes as web services and the tutorial shows how access the WSDL when the service is accessible via XFire.

However when further test were done to try and consume the service .... they failed terribly.

In the beginning the only test that i did were to simply to view the WSDL ....

I realise now that may have been the biggest mistake of this project.

The following are some of the efforts i took to try and remedy the problem.


  1. XFIRE - I read through the documentation - it was so confusing. With the feeling of panic in my mind i read and re-read almost every config page trying to map something to my code.

    http://xfire.codehaus.org/Quick+Start
    http://xfire.codehaus.org/Spring%2C+XBean%2C+Servlets+and+more

    The are undergoing some serious upgrades so the XFIRE they are currently using will be obsolete soon. This does not vote well where pages are being removed and the site being revamped.


  2. I read alot of appfuse stuff - the big problem here is that the guides for adapting XFIRE from appfuse's support is to build in ANT and well Appfuse 2 is by default in MAVEN ...
    I cannot explain the the disheartenment I feel ...

    http://raibledesigns.com/wiki/AppFuseXFire.html

  3. I tried the forum a couple of time - i only got one response which was not helpful





  4. The next thing that i did took me into the next week.
    I tired to use an IDE - Netbeans to edit the project to create the web services .... this too was a task of emmense hardship.


I also sent a mail to the man behind the scenes in appfuse asking for guidance ,,, and his response was that he never used a GUI (i figured as much) and therefor could not guide me further.

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.