Pushing Guice in WOInject all the way down ?

2 views
Skip to first unread message

Joseph Pachod

unread,
Mar 30, 2012, 6:26:30 AM3/30/12
to webobje...@lists.apple.com
Hi all (and especially Henrique)

Currently, if I get it right, WOInject makes it possible to use
Guice's bindings. However, regarding WebObjects entities and (web)
components' bindings, it's still the good old
"_NSUtilities.setClassForName(WOSubmitButton.class,
"WOSubmitButton");".

Why not using Guice/Modules for this matter as well?

Then there would be only one place and logic to look up to find out
actual implementations.

It would also unify the behavior, since Guice doesn't allow multiple
times the same bindings whereas WebObjects does.

If the concept pleases you, we already have, at my workplace, an
implementation for it which we could share. This implementation works
through a subclass of Guice's AbstractModule which kind of "redirects"
WebObjects bindings, checking them the Guice's way and making them
happen the WebObjects way.

Eager to read you back

Best,
Joseph
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobje...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/webobjects-dev-garchive-31333%40googlegroups.com

This email sent to webobjects-dev...@googlegroups.com

Henrique Prange

unread,
Mar 30, 2012, 5:03:35 PM3/30/12
to Joseph Pachod, webobje...@lists.apple.com
Hi Joseph,

On 30/03/2012, at 07:26, Joseph Pachod wrote:

> Hi all (and especially Henrique)
>
> Currently, if I get it right, WOInject makes it possible to use
> Guice's bindings. However, regarding WebObjects entities and (web)
> components' bindings, it's still the good old
> "_NSUtilities.setClassForName(WOSubmitButton.class,
> "WOSubmitButton");".
>
> Why not using Guice/Modules for this matter as well?
>

It can be done. The instantiation mechanism of WOInject has to be improved to understand these bindings, though.

> Then there would be only one place and logic to look up to find out
> actual implementations.
>

It's certainly an improvement.

> It would also unify the behavior, since Guice doesn't allow multiple
> times the same bindings whereas WebObjects does.
>

That is another advantage.

> If the concept pleases you, we already have, at my workplace, an
> implementation for it which we could share. This implementation works
> through a subclass of Guice's AbstractModule which kind of "redirects"
> WebObjects bindings, checking them the Guice's way and making them
> happen the WebObjects way.
>

That is really nice. Definitely, I would like to take a look on this Module. How do you like to share? You can fork the WOInject project on GitHub or add a Gist with the code. Just let me know what you did.

> Eager to read you back
>

I hope I didn't disappoint you. :)

Cheers,

Henrique

Reply all
Reply to author
Forward
0 new messages