• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting Exensibility Story rite ...

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have been thinking about how to get the extensibility rite in my application ..

Scenario -->
1) something as simple as a Customer ( Name, ID, Address) creation use case ..

I have designed it with something very similar to Model 2 Front Controller pattern as mentioned in http://www.javaranch.com journal.

So potentially I have components like given below:

CustomerCreation.jsp --> CustomerCreationCommand.java -->ServiceLocator.java -->CustomerCreationDomain.java --> CustomerDAO.java

Across all this layer is passed a VO called CustomerVO.java

I have about 4 layers namely UI , Commands , Service (Domain) & Data Access Layer.

If there is a requirement change in the Usecase which is like adding another 2 fields ( say Phone Number & Marital Status), I need to change all the layer
1) Change in Table
2) Change in DAO
3) Change in VO
4) Change in Command
5) Change in Domain

Is there a way out if this change?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not an advanced question. Moving...
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unless this really is a distributed application, the first thing I would do is getting rid of the DTO (what you call VO) (see http://www.martinfowler.com/bliki/LocalDTO.html ).

Then you could think about generating code from meta data. I recently worked on an application that uses Hibernate for persisting generated beans. So we had a hibernate mapping file, a (proprietary) bean description file and some java code for business and presentation logic that could not be generated from the meta data. Worked great.
 
Ingudam Manoranjan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ilja Preuss.

Let's say it is a distributed application where the service is hosted somewhere and the web layer is somewhere.

Also, the requirement is such that:
1) I would like to vary the customer creation behavior based on a operating context. Say if I were in Country = US, I need those 2 additional fields while in Country = remaining, I need to switch to the default behavior.
2) In the above scenario, I would have to introduce a concept of Operating Context ( which will right now have only Country as the variation point)

Now the framework will have to be intelligent enough to choose the right JSP, Commands, Service & DAO based on the context.

~ Still breaking my head to get it rite :-)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic