About Question enthuware.ocpjp.v7.2.1096 :
Moderator: admin
-
- Posts: 5
- Joined: Thu Mar 06, 2014 9:29 am
- Contact:
About Question enthuware.ocpjp.v7.2.1096 :
As "getStudentDAO()" is static, isn't this also Singleton pattern? Just to clarify, thanks.
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1096 :
No, this is not a singleton pattern. You may read about Singleton pattern here: https://blogs.oracle.com/JavaFundamenta ... loops_with
-
- Posts: 17
- Joined: Fri Oct 11, 2013 10:31 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1096 :
Isn't it mandatory that factory pattern must take some type param in order to constuct an object?
for. e.g.
public class DAOManager{
public static StudentDAO getStudentDAO(String type){ return new StudentDAOJpaImpl(); } }
for. e.g.
public class DAOManager{
public static StudentDAO getStudentDAO(String type){ return new StudentDAOJpaImpl(); } }
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1096 :
No, it is not mandatory for a factory pattern to take some parameter.
Who is online
Users browsing this forum: No registered users and 8 guests