Indeed, that would be better.
Meanwhile, I'll just inject services into an interface like Ron suggested. Hadn't thought of that before.

On Tue, 10 Jan 2006 15:38:26 +0100, Norbert Sándor <[EMAIL PROTECTED]> wrote:

I won't like this. @InjectObject is for injecting objects, so it shouldn't default to injecting a service...

BUT :)
What about a new InjectService annotation:

    @InjectService
    public abstract MyService getMyService();

    would be equivalent to

    (MyService)registry.getService(MyService.class)

and

    @InjectService("mymodule.MyService")
    public abstract MyService getMyService();

    would be equivalent to

    (MyService)registry.getService("mymodule.MyService", MyService.class)

I hope that I haven't reinvent the wheel :)))

BR,
Norbi

----- Original Message ----- From: "Martin Strand" <[EMAIL PROTECTED]>
To: <tapestry-user@jakarta.apache.org>
Sent: Tuesday, January 10, 2006 3:18 PM
Subject: InjectObject


Just a thought, wouldn't it be nice if InjectObject by default injected the service with an id equal to the return type's fully qualified name?


@InjectObject
public abstract MyService getMyService();

would be the same as

@InjectObject("service:my.package.MyService")
public abstract MyService getMyService();


At least for me the type's name is equal to the service id about 99% of the time. What do you think?.

--Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-- No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.16/225 - Release Date: 2006. 01. 09.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to