Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Object Tress and SessionWrapper wire()
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
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Allen  
View profile  
 More options Dec 8 2011, 2:15 pm
From: John Allen <johnfal...@gmail.com>
Date: Thu, 8 Dec 2011 14:15:47 -0500
Local: Thurs, Dec 8 2011 2:15 pm
Subject: Object Tress and SessionWrapper wire()

Hey Group,
I am SUPER enjoying the new ColdSpring 2. A really great piece of work.

I have an approach question for you smart developers, and I'll use the
model of a Blog to illustrate:

   1. I'm in the middle of saving a Post object.
   2. I want to check which Blog the post belongs to so I get it using
   post.getBlog().
   3. Because I'm getting the Blog object from the Posts object graph, it
   isn't "wired" with its dependencies because I'm not getting it from the
   SessionWrapper which is using the BeanInjector for my transients.

To fix the situation: in my Blog objects init method I'm setting the
dependencies by reaching out to CS (in the application scope) and getting
the beans from there. While this works fine, and still follows the single
point of access pattern, I just don't like the approach that much.

Anyone else have a similar situation and another way around it?

Thanks
John Allen


 
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.
Tony Nelson  
View profile  
 More options Dec 8 2011, 2:19 pm
From: Tony Nelson <tonynelso...@gmail.com>
Date: Thu, 8 Dec 2011 11:19:25 -0800 (PST)
Local: Thurs, Dec 8 2011 2:19 pm
Subject: Re: Object Tress and SessionWrapper wire()
You could use a global ORM EventHandler to inject the dependencies
using either a preLoad() or postLoad() event.

On Dec 8, 1:15 pm, John Allen <johnfal...@gmail.com> wrote:


 
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.
John Allen  
View profile  
 More options Dec 8 2011, 4:10 pm
From: John Allen <johnfal...@gmail.com>
Date: Thu, 8 Dec 2011 16:10:46 -0500
Local: Thurs, Dec 8 2011 4:10 pm
Subject: Re: [coldspring-users] Re: Object Tress and SessionWrapper wire()

Thanks for the suggestion and I have tried that, but I'm finding an issue
which seems like odd behavior for ORM.

In postLoad() I'm using the beanInjector to wire up the entity, BUT the
entity that is finally returned from ORM is NOT being wired. Matter of
fact, I can't modify the entity at all in the EventHandler.

I would think that the entity being passed to the postLoad() is the same
entity that is returned form ORM. Maybe I'm crazy.


 
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.
Tony Nelson  
View profile  
 More options Dec 8 2011, 4:14 pm
From: Tony Nelson <tonynelso...@gmail.com>
Date: Thu, 8 Dec 2011 15:14:38 -0600
Local: Thurs, Dec 8 2011 4:14 pm
Subject: Re: [coldspring-users] Re: Object Tress and SessionWrapper wire()

Have you verified your EventHandler is working correctly? And you have code
looks something like the following?

public void function preLoad(any entity) {

application.beanFactory.getBean("beanInjector").autowire(arguments.entity);

}

-Tony


 
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.
Mark Mandel  
View profile  
 More options Dec 8 2011, 4:14 pm
From: Mark Mandel <mark.man...@gmail.com>
Date: Fri, 9 Dec 2011 08:14:19 +1100
Local: Thurs, Dec 8 2011 4:14 pm
Subject: Re: [coldspring-users] Re: Object Tress and SessionWrapper wire()

John,

Are you using the BeanInjectorEventHandler?
https://sourceforge.net/apps/trac/coldspring/wiki/ORMDependencyInject...

Or your own event handler?

What dependency are you looking to inject? Some sort of Service object, or
something else?

Mark

--
E: mark.man...@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

2 Devs from Down Under Podcast
http://www.2ddu.com/


 
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.
John Allen  
View profile  
 More options Dec 8 2011, 4:52 pm
From: John Allen <johnfal...@gmail.com>
Date: Thu, 8 Dec 2011 16:52:10 -0500
Local: Thurs, Dec 8 2011 4:52 pm
Subject: Re: [coldspring-users] Re: Object Tress and SessionWrapper wire()

@Mark OOPS! No I was just using the BeanInjector. Didn't see
BeanInjectorEventHandler!

BeanInjectorEventHandler works like a champ! And yes, I was inserting
Service/Config objects. I like me some smart domain objects.

Maybe next time I'll _really_ try to read the documentation.

Thanks!


 
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.
John Allen  
View profile  
 More options Dec 8 2011, 4:57 pm
From: John Allen <johnfal...@gmail.com>
Date: Thu, 8 Dec 2011 16:57:57 -0500
Local: Thurs, Dec 8 2011 4:57 pm
Subject: Re: [coldspring-users] Re: Object Tress and SessionWrapper wire()

And one more thing...

@Mark - this version of ColdSpring IS TOTALLY COOL!

So thanks millions and billions.


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »