Re: Factory methods.

2003-10-29 Thread Carlos Pereira
  Factory is a design pattern. Design patterns are ways of designing
objects that are typical and have been used before, and thus can be reused
(note: reuse of the design, not the source code). Have you ever heard about
the Model-View-Controller (MVC) design pattern, for instance?
  You'll find design patterns in lots of APIs, so knowing about them helps
you understand things better. Probably, you have come across more design
patterns without even knowing.
  If you want to know more about design patterns, just google for it. Or try
http://www.bruceeckel.com/ and find a book about design patterns there; it
starts with the basics.

Regards,
Carlos Pereira

- Original Message -
From: anunay ashish [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, October 28, 2003 11:35 AM
Subject: Factory methods.


 Why are some methods called factory methods?
 e.g. prepareStatement() in java.sql.PreparedStatement

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






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



Factory methods.

2003-10-28 Thread anunay ashish
Why are some methods called factory methods?
e.g. prepareStatement() in java.sql.PreparedStatement

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



Re: Factory methods.

2003-10-28 Thread walkerce
To hide the implementation class.  For example, this construct avoids 
having to do this

OraclePreparedStatement p = new OraclePreparedStatement(conn);

or

PreparedStatement p = new MySQLPreparedStatement(conn);

So, you can write portable database code by using vendor-neutral 
factory methods in place of actually referencing the vendor classes 
(implementation) themselves.
- Original Message -
From: anunay ashish [EMAIL PROTECTED]
Date: Tuesday, October 28, 2003 6:35 am
Subject: Factory methods.

 Why are some methods called factory methods?
 e.g. prepareStatement() in java.sql.PreparedStatement
 
 ---
 --
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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



Re: Factory methods.

2003-10-28 Thread Micael
They create objects -- the are an object factory/maker.

At 05:05 PM 10/28/2003 +0530, you wrote:
Why are some methods called factory methods?
e.g. prepareStatement() in java.sql.PreparedStatement
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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