You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Mark Struberg <st...@yahoo.de> on 2012/05/02 13:54:16 UTC

Re: [cdi-dev] Dynamic stereotypes

I have not seen those dynamic stereotypes in free nature yet.

Actually I'm not using Stereotypes that much at all. Mainly because their usage is limited by the Java Annotation boundaries.

Imagine the following Stereotype for my Services (I spare out the standard stuff)


@StereoType
@Secured
@Transactional
@ApplicationScoped
public @interface @Service {}

The problem here is that there is no way to 'propagate' any rolesAllowed from @Service to @Secured, etc.

What I'd like to have is something like
...
public @interface @Service {

    String[] rolesAllowed();
    TransactionAttributeType transactionType();

}

where the rolesAllowed() would get propagated to the @Secured meta-annotation and transactionType() to the @Transactional

With such an annotation I could use:

@Service(rolesAllowed={"admin", "editor"}, transactionType =  REQUIRES_NEW)
public String doSomething() {...



But that's not possible with Java Annotations. Or do you have any ideas how to do that? (without having to manually propagate this in each and every interceptor).


LieGrue,
strub



----- Original Message -----
> From: Pete Muir <pm...@redhat.com>
> To: cdi-dev@lists.jboss.org; deltaspike-dev@incubator.apache.org; David Blevins <da...@gmail.com>
> Cc: 
> Sent: Wednesday, May 2, 2012 1:05 PM
> Subject: [cdi-dev] Dynamic stereotypes
> 
> Hi all
> 
> The Java EE spec leads would like feedback on how often stereotypes are 
> "dynamic" vs "static".
> 
> A static stereotype is one that is defined in Java code, compiled, and then 
> deployed without modification from a container extension.
> 
> A dynamic stereotype is one that defined in Java code, compiled, and then 
> modified by an extension.
> 
> Another way of putting it is:
> 
> * Are there any extensions which modify stereotypes?
> * Is this something that is common or not?
> 
> This relates to David's metatype proposal.
> 
> Pete
> _______________________________________________
> cdi-dev mailing list
> cdi-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 

Re: [cdi-dev] Dynamic stereotypes

Posted by Fabien Marsaud <fa...@gmail.com>.
It's weird to see the word dynamic next to the word stereotype.

Same as Mark here. We defined one or two @Stereotype's ever since we
started using CDI. We play much more with qualifiers and annotation
litterals.

I don't know if any extentions programatically manipulate them, but I'm
sure it's not common.
For instance, a quick look at seam-solder and seam-faces shows only one
stereotype is defined, and there's no tweaking with it.

fm.


On Wed, May 2, 2012 at 1:54 PM, Mark Struberg <st...@yahoo.de> wrote:

> I have not seen those dynamic stereotypes in free nature yet.
>
> Actually I'm not using Stereotypes that much at all. Mainly because their
> usage is limited by the Java Annotation boundaries.
>
> Imagine the following Stereotype for my Services (I spare out the standard
> stuff)
>
>
> @StereoType
> @Secured
> @Transactional
> @ApplicationScoped
> public @interface @Service {}
>
> The problem here is that there is no way to 'propagate' any rolesAllowed
> from @Service to @Secured, etc.
>
> What I'd like to have is something like
> ...
> public @interface @Service {
>
>     String[] rolesAllowed();
>     TransactionAttributeType transactionType();
>
> }
>
> where the rolesAllowed() would get propagated to the @Secured
> meta-annotation and transactionType() to the @Transactional
>
> With such an annotation I could use:
>
> @Service(rolesAllowed={"admin", "editor"}, transactionType =  REQUIRES_NEW)
> public String doSomething() {...
>
>
>
> But that's not possible with Java Annotations. Or do you have any ideas
> how to do that? (without having to manually propagate this in each and
> every interceptor).
>
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Pete Muir <pm...@redhat.com>
> > To: cdi-dev@lists.jboss.org; deltaspike-dev@incubator.apache.org; David
> Blevins <da...@gmail.com>
> > Cc:
> > Sent: Wednesday, May 2, 2012 1:05 PM
> > Subject: [cdi-dev] Dynamic stereotypes
> >
> > Hi all
> >
> > The Java EE spec leads would like feedback on how often stereotypes are
> > "dynamic" vs "static".
> >
> > A static stereotype is one that is defined in Java code, compiled, and
> then
> > deployed without modification from a container extension.
> >
> > A dynamic stereotype is one that defined in Java code, compiled, and then
> > modified by an extension.
> >
> > Another way of putting it is:
> >
> > * Are there any extensions which modify stereotypes?
> > * Is this something that is common or not?
> >
> > This relates to David's metatype proposal.
> >
> > Pete
> > _______________________________________________
> > cdi-dev mailing list
> > cdi-dev@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
> >
>
> _______________________________________________
> cdi-dev mailing list
> cdi-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>



-- 
http://www.suntriprecords.com

Re: [cdi-dev] Dynamic stereotypes

Posted by "John D. Ament" <jo...@gmail.com>.
Seam JMS supported this functionality (dynamic steroetypes) for a short
period of time.  When we saw the behavior inconsistent w/ OWB it was
dropped.  It was originally meant to emulate JNDI lookups in an SE
environment.

John


On Wed, May 2, 2012 at 7:54 AM, Mark Struberg <st...@yahoo.de> wrote:

> I have not seen those dynamic stereotypes in free nature yet.
>
> Actually I'm not using Stereotypes that much at all. Mainly because their
> usage is limited by the Java Annotation boundaries.
>
> Imagine the following Stereotype for my Services (I spare out the standard
> stuff)
>
>
> @StereoType
> @Secured
> @Transactional
> @ApplicationScoped
> public @interface @Service {}
>
> The problem here is that there is no way to 'propagate' any rolesAllowed
> from @Service to @Secured, etc.
>
> What I'd like to have is something like
> ...
> public @interface @Service {
>
>     String[] rolesAllowed();
>     TransactionAttributeType transactionType();
>
> }
>
> where the rolesAllowed() would get propagated to the @Secured
> meta-annotation and transactionType() to the @Transactional
>
> With such an annotation I could use:
>
> @Service(rolesAllowed={"admin", "editor"}, transactionType =  REQUIRES_NEW)
> public String doSomething() {...
>
>
>
> But that's not possible with Java Annotations. Or do you have any ideas
> how to do that? (without having to manually propagate this in each and
> every interceptor).
>
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Pete Muir <pm...@redhat.com>
> > To: cdi-dev@lists.jboss.org; deltaspike-dev@incubator.apache.org; David
> Blevins <da...@gmail.com>
> > Cc:
> > Sent: Wednesday, May 2, 2012 1:05 PM
> > Subject: [cdi-dev] Dynamic stereotypes
> >
> > Hi all
> >
> > The Java EE spec leads would like feedback on how often stereotypes are
> > "dynamic" vs "static".
> >
> > A static stereotype is one that is defined in Java code, compiled, and
> then
> > deployed without modification from a container extension.
> >
> > A dynamic stereotype is one that defined in Java code, compiled, and then
> > modified by an extension.
> >
> > Another way of putting it is:
> >
> > * Are there any extensions which modify stereotypes?
> > * Is this something that is common or not?
> >
> > This relates to David's metatype proposal.
> >
> > Pete
> > _______________________________________________
> > cdi-dev mailing list
> > cdi-dev@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
> >
>

Re: [cdi-dev] Dynamic stereotypes

Posted by Mark Struberg <st...@yahoo.de>.

Yikes *like*

I've created a CDI spec issue for it.

https://issues.jboss.org/browse/CDI-229

LieGrue,
strub




>________________________________
> From: Gerhard Petracek <ge...@gmail.com>
>To: deltaspike-dev@incubator.apache.org 
>Sent: Sunday, May 6, 2012 2:04 PM
>Subject: Re: [cdi-dev] Dynamic stereotypes
> 
>hi mark,
>
>right now we have a similar feature e.g. for @Secured, but you need to
>implement it on your own.
>if we need such a feature for the spec., i would prefer the approach used
>in bean-validation (@OverridesAttribute)
>
>regards,
>gerhard
>
>
>
>2012/5/2 Mark Struberg <st...@yahoo.de>
>
>> I have not seen those dynamic stereotypes in free nature yet.
>>
>> Actually I'm not using Stereotypes that much at all. Mainly because their
>> usage is limited by the Java Annotation boundaries.
>>
>> Imagine the following Stereotype for my Services (I spare out the standard
>> stuff)
>>
>>
>> @StereoType
>> @Secured
>> @Transactional
>> @ApplicationScoped
>> public @interface @Service {}
>>
>> The problem here is that there is no way to 'propagate' any rolesAllowed
>> from @Service to @Secured, etc.
>>
>> What I'd like to have is something like
>> ...
>> public @interface @Service {
>>
>>     String[] rolesAllowed();
>>     TransactionAttributeType transactionType();
>>
>> }
>>
>> where the rolesAllowed() would get propagated to the @Secured
>> meta-annotation and transactionType() to the @Transactional
>>
>> With such an annotation I could use:
>>
>> @Service(rolesAllowed={"admin", "editor"}, transactionType =  REQUIRES_NEW)
>> public String doSomething() {...
>>
>>
>>
>> But that's not possible with Java Annotations. Or do you have any ideas
>> how to do that? (without having to manually propagate this in each and
>> every interceptor).
>>
>>
>> LieGrue,
>> strub
>>
>>
>>
>> ----- Original Message -----
>> > From: Pete Muir <pm...@redhat.com>
>> > To: cdi-dev@lists.jboss.org; deltaspike-dev@incubator.apache.org; David
>> Blevins <da...@gmail.com>
>> > Cc:
>> > Sent: Wednesday, May 2, 2012 1:05 PM
>> > Subject: [cdi-dev] Dynamic stereotypes
>> >
>> > Hi all
>> >
>> > The Java EE spec leads would like feedback on how often stereotypes are
>> > "dynamic" vs "static".
>> >
>> > A static stereotype is one that is defined in Java code, compiled, and
>> then
>> > deployed without modification from a container extension.
>> >
>> > A dynamic stereotype is one that defined in Java code, compiled, and then
>> > modified by an extension.
>> >
>> > Another way of putting it is:
>> >
>> > * Are there any extensions which modify stereotypes?
>> > * Is this something that is common or not?
>> >
>> > This relates to David's metatype proposal.
>> >
>> > Pete
>> > _______________________________________________
>> > cdi-dev mailing list
>> > cdi-dev@lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/cdi-dev
>> >
>>
>
>
>

Re: [cdi-dev] Dynamic stereotypes

Posted by Gerhard Petracek <ge...@gmail.com>.
hi mark,

right now we have a similar feature e.g. for @Secured, but you need to
implement it on your own.
if we need such a feature for the spec., i would prefer the approach used
in bean-validation (@OverridesAttribute)

regards,
gerhard



2012/5/2 Mark Struberg <st...@yahoo.de>

> I have not seen those dynamic stereotypes in free nature yet.
>
> Actually I'm not using Stereotypes that much at all. Mainly because their
> usage is limited by the Java Annotation boundaries.
>
> Imagine the following Stereotype for my Services (I spare out the standard
> stuff)
>
>
> @StereoType
> @Secured
> @Transactional
> @ApplicationScoped
> public @interface @Service {}
>
> The problem here is that there is no way to 'propagate' any rolesAllowed
> from @Service to @Secured, etc.
>
> What I'd like to have is something like
> ...
> public @interface @Service {
>
>     String[] rolesAllowed();
>     TransactionAttributeType transactionType();
>
> }
>
> where the rolesAllowed() would get propagated to the @Secured
> meta-annotation and transactionType() to the @Transactional
>
> With such an annotation I could use:
>
> @Service(rolesAllowed={"admin", "editor"}, transactionType =  REQUIRES_NEW)
> public String doSomething() {...
>
>
>
> But that's not possible with Java Annotations. Or do you have any ideas
> how to do that? (without having to manually propagate this in each and
> every interceptor).
>
>
> LieGrue,
> strub
>
>
>
> ----- Original Message -----
> > From: Pete Muir <pm...@redhat.com>
> > To: cdi-dev@lists.jboss.org; deltaspike-dev@incubator.apache.org; David
> Blevins <da...@gmail.com>
> > Cc:
> > Sent: Wednesday, May 2, 2012 1:05 PM
> > Subject: [cdi-dev] Dynamic stereotypes
> >
> > Hi all
> >
> > The Java EE spec leads would like feedback on how often stereotypes are
> > "dynamic" vs "static".
> >
> > A static stereotype is one that is defined in Java code, compiled, and
> then
> > deployed without modification from a container extension.
> >
> > A dynamic stereotype is one that defined in Java code, compiled, and then
> > modified by an extension.
> >
> > Another way of putting it is:
> >
> > * Are there any extensions which modify stereotypes?
> > * Is this something that is common or not?
> >
> > This relates to David's metatype proposal.
> >
> > Pete
> > _______________________________________________
> > cdi-dev mailing list
> > cdi-dev@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/cdi-dev
> >
>