> What's the point in implementing Provider yourself?
is there a way to not implement the Provider myself ?
through GIN's assisted inject ?
> The way you wrote it, yes (and it's therefore totally useless).
you are correct, the way I wrote it, wouldnt defer instantiation of
activities,
so it is useless.
however if I instead use a Factory
public class MyActivityFactory implements
AppActivityFactory<MyActivity> {
MyActivity getActivity(){
return new MyActivity();
}
}
this way, I can defer the instantiation of MyActivity until the time
it is actually requested.
and I can pass in other dependencies to MyActivity from this
MyActivityFactory.
my goal is to have a registry to hold all activities that are used in
the application.
to avoid early instantiation of activities.
>From your comments I realized it might be better
to keep a map of ActivityFactories instead of Activity instances,
so that upon request, these ActivityFactories can supply the
appropriate Activity.
I am not sure however having an ActivityFactory for each Activity, is
a good idea,
because with 150 Activities, having 150 ActivityFactories might be too
much.
is there a better/alternative way ?
and I intend to further expand these ActivityFactories to help in
CodeSplitting,
through AsyncProxyProvider.
therefore this is the reason I was planning to use one Provider per
Activity, now I am going to use
one Factory per Activity.
but you hinted on GIN assisted inject. could you please elaborate a
little on that ?
and in your opinion is the idea behind using ActivityFactory flawed ?
can you think of an alternative approach or suggest a way to improve
what I'm trying to achieve ?
Thank You
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.