Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic