My apology, correcting a few things in my example, was being rushed for
lunch.

On Mon, Aug 20, 2012 at 11:36 AM, George Christman
<gchrist...@cardaddy.com>wrote:

>
>
> On Mon, Aug 20, 2012 at 11:06 AM, Thiago H de Paula Figueiredo [via
> Tapestry] <ml-node+s1045711n5715610...@n5.nabble.com> wrote:
>
>> On Mon, 20 Aug 2012 11:16:28 -0300, George Christman
>> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5715610&i=0>>
>> wrote:
>>
>> > He say's what I'm calling a factory is actually a service locator and
>> > that AutoMateParser should be defined as a service in the AppModule.
>>
>> Yep . . .
>>
>> > He also stated the objects I use to pass in through the constructor now
>>
>> > need to be passed in through set methods
>>
>> This isn't correct for Tapestry and not even for Spring. Both support
>> injection through constructors.
>>
>> Thiago, could you elaborate on this a little bit? I've seen in the app
> module you can define a builder method that takes in some service args
>
> public static SomeService someServiceBuilder(Service1 service1, Service2
> service2) {
>   return new SomeService(service1, service2);
> }
>
> I wasn't aware you could pass in non service objs into the method. In my
> case I have an entity called ImportTask.class. I'm populating the
> ImportTask from a hibernate criteria query.
>
> @Inject
> private AutoMateParser autoMateParser;
>
> ImportTask importTasks = (ImportTask) session.get(ImportTask.class,
> DatabaseConstant.AUTOMATE_PARSER);
>
>    //non service
>    AutoMateParser autoMateParser = new AutoMateParser(importTask);
>
>    //With Service
>    autoMateParser.set(importTasks);
>
>
> I tried something like this below,
>
> public static AutoMateParser autoMateParserBuilder(ImportTask importTask) {
>     return new AutoMateParser(importTask);
> }
>
> but couldn't figure out how to actually pass my import obj into the
> builder method so it ends up . The only way I know of getting that non
> service obj into my Service is with a set. Could you explain an alternate
> way to passing in that obj so it ends up in the service constructor?
>
>> > The last question where I'm still a little confused is related to using
>> > services inside extended classes. Because I'm declaring
>> > AutoMateParser.class as a service, but extending say Parser.class,
>> would
>> > I be able to inject my services inside my extended class without having
>>
>> > to declare Parser.class in my AppModule a service?
>>
>> Yes.
>>
>> --
>> Thiago H. de Paula Figueiredo
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=5715610&i=1>
>> For additional commands, e-mail: [hidden 
>> email]<http://user/SendEmail.jtp?type=node&node=5715610&i=2>
>>
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://tapestry.1045711.n5.nabble.com/Question-tapestry-service-tp5715573p5715610.html
>>  To unsubscribe from Question tapestry service, click 
>> here<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5715573&code=Z2NocmlzdG1hbkBjYXJkYWRkeS5jb218NTcxNTU3M3wxNjMyOTYxMjA3>
>> .
>> NAML<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Question-tapestry-service-tp5715573p5715613.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Reply via email to