jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@eurobell.co.uk>
Subject Re: Instantiating an abstract class
Date Tue, 02 Apr 2002 22:58:57 GMT
> of course you can not instantantiate a class with abstract methods.
> You can and should provide a constructor, however.
>
> Cheers
> Markus

> I think it is nothing bad to use factory, and in the most cases it is
> better.
>  Factory design pattern very useful for refactoring, in situation like you
> have desktop application and need to make it distributed. Change
> factory method and it become distributed or persistent.
> I use factory then possible.
> Juozas

Thanks for the responses.
The question was prompted by an attept to try to create JavaBeans where only
the signatures of the get and set methods had to be written. The answer is
what I expected, so I will be two choices left to create an abstract Person:
1) Use a factory - Person p = Person.create();
2) Use a naming pattern - Person p = new PersonImpl()
The first one would rely on creating a subclass on the fly, an ideal
candidate for Juozas's simplestore Enhancer.
The second one would rely on a classloader creating PersonImpl on the fly,
which I believe BCEL can do as well.

Thanks
Stephen


--
To unsubscribe, e-mail:   <mailto:bcel-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:bcel-user-help@jakarta.apache.org>


Mime
View raw message