I would argue against making interfaces for all your DAOs unless you
know up front that you will be creating multiple implementations.  So
long as you don't make any of the methods on your DAOs static, it is
an easy matter to extract interfaces from them at a later point, when
and if you need to do so.  This will not only save time up front, but
will make your code simpler by removing an unneeded inheritance level.

Josh

On 6/28/07, Francesco Azzola <[EMAIL PROTECTED]> wrote:
Yep it is a good practice. Usually u should have an interface and several dao 
implementing that interface with a factory, so u can change your database 
implementation without having to change the whole code.
You can subclass dao too if u like even if i prefer to use an interface.
Bye
F.

Sun Certified Enterprise Architect (SCEA)
Sun Certified Web Component Developer (SCWCD)

----- Messaggio originale -----
Da: "Zhang, Larry (L.)" <[EMAIL PROTECTED]>
A: Struts Users Mailing List <user@struts.apache.org>
Inviato: Mercoledì 27 giugno 2007, 20:03:26
Oggetto: Dao subclass


 I have a question, is it a good practice to subclass dao? Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]












___________________________________
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail:
http://it.docs.yahoo.com/nowyoucan.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to