A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by saikrishna cinux:
[Q]1)All factory methodes are from singleton classes true or false?--False
2)Is factory method creates only an object of an interface true or flase?---False
3)Why to go for factory methods while can create an object using constructor--What do you really understand by Factory method[/Q]
The Best way to predict your future is to create it - Every great individual common man
Originally posted by Ankur Sharma:
Factory method is just a fancy name for a method that instantiates objects.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by saikrishna cinux:
1)All factory methodes are from singleton classes true or false?
2)Is factory method creates only an object of an interface true or flase?
3)Why to go for factory methods while can create an object using constructor
You can't wake a person who is <b><i>pretending</i></b> to be asleep.<br />Like what <b>"it"</b> does not like - <i> Gurdjieff </i>
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Stan James:
I was probably using what Ilja called a vanilla creation method. I tend to blur these with "factory" because the first one I ran into lo these many years ago was on a class called BOFactory. That predates my exposure to GoF and in spite of their stature in the OO world, I have not yet let them make me change words. I said in another post I find GoF a bit "fussy" on these two patterns, and that's because they exclude the thing that I do all the time.
Originally posted by saikrishna cinux:
1)All factory methodes are from singleton classes true or false?
Rajah Nagur:
True. Singleton would be the best choice because it will the single place of management for all the objects created. i.e. The singleton's purpose is to control object creation. The objects can be cached etc.
I think even all ConnectionFactory objects in Java SE 1.4 API are singleton i.e QueueConnectionFactory, TopicConnectionFactory etc..
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|