Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
[OT] Non-abstract factory design pattern versus using constructordirectory
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Joshua Cranmer, post: 3690895"] comp.theory is probably a good place (I am not a denizen of said newsgroup, so I can't say for sure). A minor point, but factories are probably more future-proof. If you decide that a class would be, in the future, better designed as a light hierarchy based on some of the inputs via a factory method, you can make that change without breaking compatibility. If you have a constructor, you're stuck with it. This point, though, does need to be evaluated on a case-by-case basis. Factories are also flexible in the creation of objects. Suppose you decide at some point that you need (for performance reasons) to have interned representations of objects. A constructor has to create a new object, but a factory can choose to reuse an existing item. Those two are the first reasons that come to my mind; there are other reasons, though (probably). [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
[OT] Non-abstract factory design pattern versus using constructordirectory
Top