Re: About abstract class and abstract method
- From: Roedy Green <look-on@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 00:59:14 GMT
On 30 Aug 2005 10:32:06 -0700, "Sameer" <sameer75@xxxxxxxxx> wrote or
quoted :
>This abstract class java.awt.Toolkit contains one abstract method beep.
Some Sun classes, such as java.awt.Toolkit are abstract or only have
private constructors. This is infuriating. Where do you get one of
these objects from??
The key is SOMEWHERE in there is a static factory method that will
create such objects for you. For the beep problem see
http://mindprod.com/jgloss/beep.html
You often seen this pattern when Sun wanted to make implementations
pluggable. The implementation can be replaced at run time by one
tuned to the platform or by a third party enhancement.
The entire JCE works this way.
What we need is a browsing tool of the JavaDocs what will find those
factories for you.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
.
- References:
- About abstract class and abstract method
- From: Sameer
- About abstract class and abstract method
- Prev by Date: Re: Tomcat, Precompile JSP Pages
- Next by Date: Re: Type erasure bug?
- Previous by thread: Re: About abstract class and abstract method
- Next by thread: Newbie help
- Index(es):