On Jan 2, 5:02 pm, Frank Weiss fewe...@gmail.com wrote:
For your first issue, can you refactor to use singleton Factory instead and
make the factory methods non-static? Example:
MyFactory factory = MySubclassedFactory.getInstance();
MyWidget = factory.createMyWidget();
This and the Builder
Consider using the builder pattern instead of static factory methods:
http://en.wikipedia.org/wiki/Builder_pattern
On Sat, Jan 2, 2010 at 2:58 PM, jotobjects jotobje...@gmail.com wrote:
Here is a start...
Class barClass = com.example.Bar.class;
Method m = barClass.getMethod(foo, ...) // add
Here is a start...
Class barClass = com.example.Bar.class;
Method m = barClass.getMethod(foo, ...) // add parameter types to
call
Object val = m.invoke(null, ...) // add parameter values to call
On Jan 2, 12:10 pm, Philip philip.dese...@gmail.com wrote:
2. I am trying to replicate the easy
For your first issue, can you refactor to use singleton Factory instead and
make the factory methods non-static? Example:
MyFactory factory = MySubclassedFactory.getInstance();
MyWidget = factory.createMyWidget();
Then the createMyWidget method (possibly abstract in MyFactory) can be
overridde
4 matches
Mail list logo