[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: New By Name
From: |
Andrey Kulikov |
Subject: |
Re[2]: New By Name |
Date: |
Thu, 25 Sep 2003 13:13:45 +0400 |
Hi All.
>> I would like the Java introspection functionality - or at
>> least to be able to
>> create an instance of a class from its name. This would mean
>> there is no need
>> for "Factories". I call this feature "new by name" because
From my point of view the main advantage and reason for using
"Factories" is hiding from clients real implementation of
requested interfaces. I.e. if i request interface 'Logger from
'LoggerFactory', it does not matter for me, what the implementation of
this interface - 'FileLogger', 'DBLogger' or 'SMTPLogger'.
And if i explicitly specify a name of class - how can i forget about a
Factories?
And what the motivation for implementing this Java reflection API like
stuff?
>>
>> An example on how to use it:
>> ChildClass cl = (ChildClass)new_by_name("Children_of_ChildClass");
PB> Take a look at the persistence engine.
PB> There are some subtilities (it seems to me that the class name is written
PB> only once and then only short class ids instance of the class name, ...)
Yes, using persistent container is a good idea.
But implementing this is a very complex task, and purchasing it is
very expensive. All the more i don't know good open source C++
persistent container. :(
And opinion on this question is that in complex cases is only one way
for make instances of classes by name - persistent layer in
application of something like CORBA.
And in simple cases it not necessary, and can be implemented by other ways.
--
Best regards,
Andrey mailto:address@hidden