• Post Reply Bookmark Topic Watch Topic
  • New Topic

Design advice

 
Ricardo Polero
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi fiends !
I want other point of view regarding the choice for Persistence lawer.
Interface or Abstract classes ?
I wait for some advice !
Thx in adv
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are only three general cases I use abstract classes for:
1) To dictate method procedure, as with a Template pattern
2) To define the general framework of class relationships, but leave certain implementation details wide open
3) As a specific case of 1) and 2), to dictate how a class must be constructed, but require all subclasses to implement one underlying type that puts it all together
After those cases, I'm hard-pressed to use an abstract class over an interface.
For the purposes of the exam, there's no advantage to using an abstract class that I can think of.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!