Hi all,

I'm wondering what's the best design to build a provider.

My library consists in a service package with a service class. In other 
package I store the model class, which I want it to have protected 
constructors. The model is a super-class (abstract) with some sub-classes 
(extending the super-class).

*/model/*
*    SuperClass*
*    ChildClass1*
*    ChildClass2*
*    ...*
*/service/*
*    Service*

I want to get instances of the sub-classes from (and only from) the service 
class. Guice Providers seem to be lacking the capacity of doing something 
like:

*public class ModelProvider extends Provider<SuperClass>{*
*  public SuperClass get(Class type) {
*
*    return "new instance of type";*
*  }*
*}*

I can't invoke get with parameters. Also, if the constructors of the model 
classes are private, the provider must be in the same package, which I 
think is a bad design for my library.

Any advice?

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to