wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Keep it simple or... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Keep it simple or..." Watch "Keep it simple or..." New topic
Author

Keep it simple or...

adriano lorentino
Greenhorn

Joined: Jun 20, 2010
Posts: 4
Hi all,

I'm facing a dilemma. I've set up my own architecure, and then I read Andrew Monkhouse's book. I can see lots of variations so I'm now a little bit confused...Should I change my architecture to something more simple?Or is it worth to take a risk by keeping a more complicated architecture...

The variations beetween my idea and the book are:

  • I want to put a Service class in front of my Data class.
  • I want to have a DAO layer, (DAO FActory, FileAccessDAOImpl)
  • I want an exception mecanism, with 3 kind of exceptions:
    1)TechnicalExceptions - Database exceptions etc...
    2)FunctionnalExceptions - Exceptions from Data file and service layer
    3)GUIException - UI Exceptions
    The idea is to send exceptions from layers to layer until UI



  • I was quite satisfied with this architecture, but reading the book make me feel less confident now...Should I come back to an easier solution? (Data file-FileAccess-LockingManager only?) Without DAO/Services and a less complex Exception handling?

    I would have no problem to change my idea, if that easier solution is enough to pass the exam...As I can imagine, implementing a more complex solution is more work, and also more risks to make mistakes...

    I'm reading the forum, and what I see is that people seems to keep their own solution instead of a more "Generic" simple solution...Is there a particular reason for this?Does examinators are more sensible if someone wrote his own architecture instead of a "Generic" one?

    Thanks for yours precious advices...!


    Adrien
    Roel De Nijs
    Bartender

    Joined: Jul 19, 2004
    Posts: 5152
        
      12

    Hi Adrien,

    The book just gives you some kind of guidance to succeed with the certification, covering big topics like the networking protocol, the GUI and so on. Although it is a great book (which helped me a lot) my design differs a lot of the one described by the book (e.g. my Data class is not a facade).

    You just have to do what you think is ok considering the requirements you got, also considering the ones like code reuse, extensibility, maintainability, simple approach which is understandable by a junior programmer,... And if you think you need something like a Services class and/or a DAO factory, just go for it and explain in your choices.txt why you made these decisions.

    And as a final remark: my approach is similar to yours.

    Kind regards,
    Roel


    SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
    http://www.javaroe.be/
    adriano lorentino
    Greenhorn

    Joined: Jun 20, 2010
    Posts: 4
    Hi Roel,

    That gives me more confidence to keep my solution and continue on this path.

    Thanks for this response!

    Adrien
    Roberto Perillo
    Bartender

    Joined: Dec 28, 2007
    Posts: 2258
        
        3

    I thought this topic was something like "complete the sentence"!


    Cheers, Bob "John Lennon" Perillo
    SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
    adriano lorentino
    Greenhorn

    Joined: Jun 20, 2010
    Posts: 4
    Another remaining point of interrogation for me is about my DAO layer.

    What I was thinking is that my Data file as a reference to a dao. This dao is instanciated by a DaoFactory that send back a FileAccessDao implementation. (this way I want to make sure there's no problem when swithching db file to a commercial database).

    But reading the forum seems many people see the Data class as a DAO already...so That's mean if that the case I don't need an extra Dao Layer.

    But I'm not really convinced by this idea that Data file (Wich is the implementation of the interface provided by sun) is actually a DAO. I can see it more like a service class, that using a DAO.

    But I could be wrong...so better to be sure before I start to implement anything...
    Roel De Nijs
    Bartender

    Joined: Jul 19, 2004
    Posts: 5152
        
      12

    adrien frediani wrote:But I'm not really convinced by this idea that Data file (Wich is the implementation of the interface provided by sun) is actually a DAO. I can see it more like a service class, that using a DAO.

    If that's your point of view, you should just go for it.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Keep it simple or...
     
    Similar Threads
    Understanding a DAO v Service seperation...
    architecture
    throw/(s) runtime exception
    Architectural Complexity
    Facade and Delegate