Google Groups Home
Help | Sign in
{LightwireFramework} Re: Handling circular dependencies.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
lagos.tout  
View profile
 More options Feb 9, 3:33 pm
From: "lagos.tout" <lagos.t...@gmail.com>
Date: Sat, 9 Feb 2008 12:33:10 -0800 (PST)
Local: Sat, Feb 9 2008 3:33 pm
Subject: Re: {LightwireFramework} Re: Handling circular dependencies.

Hi, Paul.

Thanks for responding.
I was just curious for comparison sake with ColdSpring.
I guess I haven't figured out when to use CS over LW, or vice-versa.
Of course, for AOP I'd have no choice but CS.  But for the things they do have in common... ?
Thanks.

LT


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Marcotte  
View profile
 More options Feb 9, 9:47 pm
From: "Paul Marcotte" <pmarco...@gmail.com>
Date: Sat, 9 Feb 2008 18:47:35 -0800
Local: Sat, Feb 9 2008 9:47 pm
Subject: Re: {LightwireFramework} Re: Handling circular dependencies.

Hi LT,

My pleasure.  To give you a bit more information, you can use a superset of
ColdSpring xml definitions with Lightwire.  The difference is that since
Lightwire supports mixin injection, there is a <mixin/> tag.  What mixin
give you is the ability to reference the dependency as
variables.MyMixinwithout having to add a specific setter for
"MyMixin".

But that's where it stops.  You won't find  AOP, Autowiring, or remote
proxies with LightWire.

Regarding the circular dependency, I just wanted to mention that many of the
community leaders like Sean Corfield and Brian Kotek suggest that having a
1:1 ration of Services to business objects can cause issues like circular
dependencies.  Quick example.  Say you have a ProductService and and
CategoryService for your online catalog.  If you have a circular dependency
between the two, you might consider rolling them up into a CatalogService
that provides API methods Products and Categories.  This is a application
design paradigm that I'm currently working toward.

So, uh, that's my 2 cents...

Cheers,

Paul

On Feb 9, 2008 12:33 PM, lagos.tout <lagos.t...@gmail.com> wrote:

--
Paul Marcotte
Fancy Bread - in the heart or in the head?
http://www.fancybread.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Bell  
View profile
 More options Feb 10, 12:31 pm
From: Peter Bell <systemsfo...@gmail.com>
Date: Sun, 10 Feb 2008 12:31:17 -0500
Local: Sun, Feb 10 2008 12:31 pm
Subject: Re: {LightwireFramework} Re: Handling circular dependencies.

Also, LW was designed for DI into transients as well as singletons. You
*can* do that with CS, but it is not recommended. The recommended solution
in CS is to create a factory thatıs bean aware for the transient DI (say you
have a user that requires a UserDAO).

Oh, and if you want to write a programmatic config file (instead of XML),
that can be done in LW but in CS youıd have to write a script to gen your
xml and then pass that in.

I just find LW more elegant for my use cases and as I really need AOP or
other such features, I believe I can add them to LW while still keeping it
really tight.

Best Wishes,
Peter

On 2/9/08 9:47 PM, "Paul Marcotte" <pmarco...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lagos.tout  
View profile
 More options Feb 10, 1:38 pm
From: "lagos.tout" <lagos.t...@gmail.com>
Date: Sun, 10 Feb 2008 10:38:25 -0800 (PST)
Local: Sun, Feb 10 2008 1:38 pm
Subject: Re: {LightwireFramework} Re: Handling circular dependencies.

Thanks, Peter.
Would you mind explaining a bit more what you mean by "The recommended solution in CS is to create a factory that’s bean aware for the transient DI (say you have a user that requires a UserDAO)"  Also, why is injection into transients not recommended with CS?  
LT


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Bell  
View profile
 More options Feb 10, 1:54 pm
From: Peter Bell <systemsfo...@gmail.com>
Date: Sun, 10 Feb 2008 13:54:28 -0500
Local: Sun, Feb 10 2008 1:54 pm
Subject: Re: {LightwireFramework} Re: Handling circular dependencies.

If you want to DI into transients using CS, just email to the ColdSpring
list, explain what you want to do and ask whether you should use CS to
inject into the transients using ³singleton=²false²² and if not, what
approach theyıd recommend. Please donıt mention me or LightWire ­ seems to
piss them off over there :->

Best Wishes,
Peter

On 2/10/08 1:38 PM, "lagos.tout" <lagos.t...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lagos.tout  
View profile
 More options Feb 10, 4:57 pm
From: "lagos.tout" <lagos.t...@gmail.com>
Date: Sun, 10 Feb 2008 13:57:02 -0800 (PST)
Local: Sun, Feb 10 2008 4:57 pm
Subject: Re: {LightwireFramework} Re: Handling circular dependencies.

:)
ok. i will.
so do you not use factories?
is it not ok (read 'not best practice') to use LW with factories?
thanks.
LT


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Bell  
View profile
 More options Feb 10, 5:03 pm
From: Peter Bell <systemsfo...@gmail.com>
Date: Sun, 10 Feb 2008 17:03:16 -0500
Local: Sun, Feb 10 2008 5:03 pm
Subject: Re: {LightwireFramework} Re: Handling circular dependencies.

You can absolutely use LW with factories. However, because LW can act as a
simple factory, your ³factory² methods can be simpler. I have a
UserService.new() thatıll return a new user object, but the entire code for
it is:

cfreturn BeanFactory.getBean(³User²);

That returns my User with (say) a UserDAO or whatever else it needs injected
already and ready for use.

So, if I want a UserService.getByID(UserID) method, itıll just be:

var User = new();
User.loadQuery(DAO.getbyID(UserID));
cfreturn User

Obviously if I needed an abstract factory, itıd be a little more code.

Best Wishes,
Peter

On 2/10/08 4:57 PM, "lagos.tout" <lagos.t...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Marcotte  
View profile
 More options Feb 10, 5:14 pm
From: "Paul Marcotte" <pmarco...@gmail.com>
Date: Sun, 10 Feb 2008 14:14:54 -0800
Local: Sun, Feb 10 2008 5:14 pm
Subject: Re: {LightwireFramework} Re: Handling circular dependencies.

LT,

Before diving in and asking about transients on the CS list, do a search.
Brian Kotek recently announced a BeanInjector that is designed for singleton
injection into transients without the performance hit you get when doing
this natively in CS.

Cheers,

Paul

On Feb 10, 2008 1:57 PM, lagos.tout <lagos.t...@gmail.com> wrote:

--
Paul Marcotte
Fancy Bread - in the heart or in the head?
http://www.fancybread.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.