Re: Breaking the Last Dependency in C++?
- From: "Alvin Ryder" <alvin321@xxxxxxxxxxx>
- Date: 23 Feb 2006 16:41:12 -0800
Daniel T. wrote:
In article <4338f75e$0$11868$3b214f66@xxxxxxxxxxxxxxxxxxxx>,
Joerg Simon <j_simon@xxxxxx> wrote:
Hi experts,
Short:
-----------------------------------------------------------------------
Is there an equivalent technique for a factory like one with refelction
in Java like in the article of Elisabeth Freeman and Eric Freeman on
Java.Net?
-----------------------------------------------------------------------
Article URL:
http://today.java.net/pub/a/today/2005/04/14/dependency.html
-------
On java.net there is an article from Elisabeth Freeman and Eric Freeman,
in advice of Erich Gamma claiming to "break the last dependency",
meaning that factories still are fixed to implementations (new ops) and
there can be something better. So they indroduced the idear of a factory
which uses Reflection and File-IO to create the factory-products.
That there are arguments that the code is slow/could be better... and so
on doesn't concern me, my question is, is there an Equivalent in C++?
Since I know Java quite well {kind of ;) }, but are, hm, intermediate in
C++ (I know what Templtes, Template-specializations and so are and some
of std c++ [one year working with it on the University], and have some
minor knowledge of boost [gregorian time and sharet pointer]), I don't
know if there is a technology in c++ which supports this kind of dynamic
creation.
I noticed that no one actually answered this question so: Yes.
Andrei Alexandrescu came up with the method and published it in his book
"Modern C++ Design: Generic Programming and Design Patterns Applied"
It can also be found @ <http://sourceforge.net/projects/loki-lib/>
I don't wish to be contentious but doesn't that make the answer no?
AFAIK C++ still has no easy and direct language support for virtual
construction. The only language I've used that can do it is Perl.
Using the loki library may break the last depenency in one sense but
only by shifting it to another place, namely a dependency on that
library. Luggage I won't want to carry.
Although that seems like an interesting book so thank's for the link
;-)
Cheers
.
- References:
- Re: Breaking the Last Dependency in C++?
- From: Daniel T.
- Re: Breaking the Last Dependency in C++?
- Prev by Date: Re: protected or private
- Next by Date: software architecture/design question
- Previous by thread: Re: Breaking the Last Dependency in C++?
- Next by thread: software architecture/design question
- Index(es):
Relevant Pages
|