• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Adds new methos to BDMain

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all!,

My app is a 3-tier application.

Id' like to change DBMain interface (addings 3 methods)
1) public void setLockStrategy(LockStrategy)
2) public Accommodation recordToAccomodation(String[] record)
3) public String[] accomodationToRecord(Accomodation ac)

Explanation:
1) Just to be able to disable/enable lockstrategy in DAO (DBMain). I don't like using singleton with a LockManager
2) and 3): Application of value object pattern in DAO. In my opinion DBMain is responsible to transform domain objects (bussiness objects) in database format objects

Thanks in advance
 
Pablo Manrubia
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry but I forgot the question...

Am i authorized to do this change according to SUN exam rules??

Thanks
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi pablo,

I think adding methods to the interface is penalized by automatic failure.

My assignment states :


Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:





Which does not mean you can't add methods to your Data class. But I think the interface DBMain must be used as is.

HTH - Cheers - Nicolas
[ January 07, 2008: Message edited by: Nicolas Stern ]
 
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

2 things:

- adding private methods;
- adding public methods.

private methods are OK, no questions asked.

For public methods, it's not that it's forbidden, however if you Data depends on those methods, it cannot be used from its Interface.



It would be bad, and on top of that, if SUN has some test on your Data implementation, they will certainly access it through the interface!

Also, my Data Singleton returns the a reference to the Interface.

Regards,
Alex
 
Pablo Manrubia
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok

I won't add new methods to DBMain interface.

Thanks both for your replys.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic