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]

Reply via email to