You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2007/10/23 02:54:45 UTC

Model intents and policySets attached under elements, was:Re: Transaction policy seed code and questions on the Tuscany policy framework

Hi,

Basically there are two concepts:

1) The introspected implemention code (for example, a java class or a BPEL 
file). Usually the metadata contributes to the corresponding component type 
which is shared by all components that use the same implementation code.

2) The <implementation.xxx> element inside the component declaration. It's 
used to configure a component. And the information pertains to the declaring 
component only.

+1 on Sebastien's proposal to hold the implementation-level 
intents/policySets in the Component model. The component:implementation is a 
1:1 relationship so we don't have to define an extra model to represent 2). 
The method component.getImplementation() returns information for 1) today.

We can have something like:

public interface Component extends PolicyAttachPoint {
...
    // List<Intent> getRequiredIntents(); // from PolicyAttachPoint
    // List<PolicySet> getPolicySets(); // from PolicyAttachPoint
    List<OperationPolicyAttachPoint> getOperationPolicyAttachPoints();
}

public interface OperationPolicyAttachPoint extends PolicyAttachPoint {
    String getOperation();
    String getService();
    void setOperation(String operation);
    void setService(String service);
}

Thanks,
Raymond

----- Original Message ----- 
From: "Jean-Sebastien Delfino" <js...@apache.org>
To: <tu...@ws.apache.org>
Sent: Monday, October 22, 2007 11:55 AM
Subject: Re: Transaction policy seed code and questions on the Tuscany 
policy framework


> [snip]
> Venkata Krishnan wrote:
>> Hi Raymond,
>>
>> Please see my comments inline.
>>
>> Also, now that you are with this, may I request your views on the problem
>> that I am facing with attaching intents and policysets on implementation
>> model instances.  Presently, atleast for the JavaImplementation model
>> instances we reuse instances across components.  i.e. assuming we have 
>> CompA
>> and CompB using the same java implementation, then the implementation 
>> model
>> instance that we create is just one.  This is a bit of a problem when 
>> CompA
>> and CompB have different intents specified and the underlying
>> implementations must inherit that.  Please see
>> http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg24574.html
>>
>> Thanks
>>
>> - Venkat
>>
>>
>
> I still think that a proper logical model (independent of its XML 
> representation) for policies inside component declarations is:
> - policy intents on <implementation.xyz>, store them in the 
> Component.requiredIntents list
> - policy intents associated with operations, have a list of operations on 
> the Intent


>
> Let me know if you want me to prototype it, as we can discuss this at 
> length in email but only code will show if a model or another is the right 
> one for this.
>
> -- 
> Jean-Sebastien
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Model intents and policySets attached under elements, was:Re: Transaction policy seed code and questions on the Tuscany policy framework

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Venkata Krishnan wrote:
> Hi,
>
> 1) So for intents and policysets attached to implementation.xxx I understand
> that you are proposing the addtion of another field in the Component model
> to hold this information.  i.e.
>
> -List<Intent> getRequiredIntents()   /* this will capture intents specified
> at the component element level
>                                                       so that
> implementation, services and references inherit these */
> - List<PolicySet> getPolicySets()  /* this will capture policysets specified
> at the component level
>                                                       so that
> implementation, services and references inherit these */
>
> - List<Intent> getIntentsForImplementation();  /* for capturing intents
> specied at the implementation
>
> element level */
>
> - List<PolicySet> getPolicySetForImplementation(); /* for capturing intents
> specied at the
>
> implementation element level */
>
> If this is what you are suggesting, I am ok with this and will roll this
> out.
>   

I don't think that this is necessary. Component.requiredIntents and 
components.policySets should be sufficient.

>
> 2) For Operations, please help me understand further what you are
> proposing... if its Intent.getOperations and PolicySet.getOperations.  Here
> are some questions I have in mind with this...
>
>      i) this seems like Intent and PolicySets have Operations whereas
> Operations are actually another kind of Intent / Policy attach point, very
> much like composite, component, service, reference.. etc.
>   


>     ii) to find out the bunch of intents that apply to an operation I'd have
> to run thro all the Intents in the domain
>   

I can't make sense of "all the intents in the domain". In my view, 
intents are associated with a component, a service, a reference or a 
property, and optionally apply to a list of operations.

>    iii) if Operation model instances are going to be shared then again what
> intents or policysets are attached in the context of one service may not be
> in the context of another service.
>   

Correct, they have to be shared, and this is why storing intents under 
operations, which you tried before, does not work.

> Does this all make sense or am I missing something very fundamental here ?
>
> Thanks for helping with your thoughts around this - I've been really needing
> this for a while now :)
>
> - Venkat
>
>   
[snip]
>   
>> Yes, it's tricky here. The operation-level intents/policySets can be
>> attached to different levels in the configuration:
>>
>> (interface, operation)
>> (service, operation)
>> (reference, operation)
>> (binding, operation)
>> (implementation, operation)
>> (implementation, service, operation)
>>
>> Are you proposing List<Operation> Intent.getOperations() and
>> List<Operation>
>> PolicySet.getOperations()?
>>
>>     

Yes, I'm not only proposing, it's how it was initially coded, see line 
62 of Intent.java. I've been repeating that I think it is the correct 
way to model the Intent -> operations relationship. I guess I'm going to 
stop repeating it as we've already experimented with different other 
ways to model this and I'm sure it'll go full circle... back to where we 
were on line 62 of Intent.java :)

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Model intents and policySets attached under elements, was:Re: Transaction policy seed code and questions on the Tuscany policy framework

Posted by Venkata Krishnan <fo...@gmail.com>.
Hi,

1) So for intents and policysets attached to implementation.xxx I understand
that you are proposing the addtion of another field in the Component model
to hold this information.  i.e.

-List<Intent> getRequiredIntents()   /* this will capture intents specified
at the component element level
                                                      so that
implementation, services and references inherit these */
- List<PolicySet> getPolicySets()  /* this will capture policysets specified
at the component level
                                                      so that
implementation, services and references inherit these */

- List<Intent> getIntentsForImplementation();  /* for capturing intents
specied at the implementation

element level */

- List<PolicySet> getPolicySetForImplementation(); /* for capturing intents
specied at the

implementation element level */

If this is what you are suggesting, I am ok with this and will roll this
out.


2) For Operations, please help me understand further what you are
proposing... if its Intent.getOperations and PolicySet.getOperations.  Here
are some questions I have in mind with this...

     i) this seems like Intent and PolicySets have Operations whereas
Operations are actually another kind of Intent / Policy attach point, very
much like composite, component, service, reference.. etc.
    ii) to find out the bunch of intents that apply to an operation I'd have
to run thro all the Intents in the domain
   iii) if Operation model instances are going to be shared then again what
intents or policysets are attached in the context of one service may not be
in the context of another service.

Does this all make sense or am I missing something very fundamental here ?

Thanks for helping with your thoughts around this - I've been really needing
this for a while now :)

- Venkat





On 10/23/07, Raymond Feng <en...@gmail.com> wrote:
>
> More comments inline.
>
> Thanks,
> Raymond
>
> ----- Original Message -----
> From: "Jean-Sebastien Delfino" <js...@apache.org>
> To: <tu...@ws.apache.org>
> Sent: Monday, October 22, 2007 6:16 PM
> Subject: Re: Model intents and policySets attached under
> <implementation.xxx> elements, was:Re: Transaction policy seed code and
> questions on the Tuscany policy framework
>
>
> > [snip]
> > Raymond Feng wrote:
> >>
> >> We can have something like:
> >
> > Well... You know what I think about how to model the intent ->
> operations
> > relationship :) I think that you should experiment a bit with what
> you're
> > proposing, I'd like to just bring to your attention that:
> >
> > - modeling operation and service as just strings is not consistent with
> > what we're doing elsewhere in the model, and will require lookups all
> over
> > the place
>
> You are right. We should use Operation and Service instead.
>
> >
> > - IIRC policies can be associated with operations on services,
> references,
> > callbacks and implementations, component types (and I'm not sure about
> > constraining types)
> >
>
> Good catch. I was too focused on the implementation.xxx specific issue. We
> should try to have a model that works with all the cases and combinations.
>
> > - policies can also be associated with all operations on an interface,
> or
> > all operations on an implementation
> >
>
> Yes, it's tricky here. The operation-level intents/policySets can be
> attached to different levels in the configuration:
>
> (interface, operation)
> (service, operation)
> (reference, operation)
> (binding, operation)
> (implementation, operation)
> (implementation, service, operation)
>
> Are you proposing List<Operation> Intent.getOperations() and
> List<Operation>
> PolicySet.getOperations()?
>
> > - you'll need to distinguish between intent attach points and policySet
> > attach points
> >
> >>
> >> public interface Component extends PolicyAttachPoint {
> >> ...
> >>    // List<Intent> getRequiredIntents(); // from PolicyAttachPoint
> >>    // List<PolicySet> getPolicySets(); // from PolicyAttachPoint
> >>    List<OperationPolicyAttachPoint> getOperationPolicyAttachPoints();
> >> }
> >>
> >> public interface OperationPolicyAttachPoint extends PolicyAttachPoint {
> >>    String getOperation();
> >>    String getService();
> >>    void setOperation(String operation);
> >>    void setService(String service);
> >> }
> >>
> >> Thanks,
> >> Raymond
> >>
> > --
> > Jean-Sebastien
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: Model intents and policySets attached under elements, was:Re: Transaction policy seed code and questions on the Tuscany policy framework

Posted by Raymond Feng <en...@gmail.com>.
More comments inline.

Thanks,
Raymond

----- Original Message ----- 
From: "Jean-Sebastien Delfino" <js...@apache.org>
To: <tu...@ws.apache.org>
Sent: Monday, October 22, 2007 6:16 PM
Subject: Re: Model intents and policySets attached under 
<implementation.xxx> elements, was:Re: Transaction policy seed code and 
questions on the Tuscany policy framework


> [snip]
> Raymond Feng wrote:
>>
>> We can have something like:
>
> Well... You know what I think about how to model the intent -> operations 
> relationship :) I think that you should experiment a bit with what you're 
> proposing, I'd like to just bring to your attention that:
>
> - modeling operation and service as just strings is not consistent with 
> what we're doing elsewhere in the model, and will require lookups all over 
> the place

You are right. We should use Operation and Service instead.

>
> - IIRC policies can be associated with operations on services, references, 
> callbacks and implementations, component types (and I'm not sure about 
> constraining types)
>

Good catch. I was too focused on the implementation.xxx specific issue. We 
should try to have a model that works with all the cases and combinations.

> - policies can also be associated with all operations on an interface, or 
> all operations on an implementation
>

Yes, it's tricky here. The operation-level intents/policySets can be 
attached to different levels in the configuration:

(interface, operation)
(service, operation)
(reference, operation)
(binding, operation)
(implementation, operation)
(implementation, service, operation)

Are you proposing List<Operation> Intent.getOperations() and List<Operation> 
PolicySet.getOperations()?

> - you'll need to distinguish between intent attach points and policySet 
> attach points
>
>>
>> public interface Component extends PolicyAttachPoint {
>> ...
>>    // List<Intent> getRequiredIntents(); // from PolicyAttachPoint
>>    // List<PolicySet> getPolicySets(); // from PolicyAttachPoint
>>    List<OperationPolicyAttachPoint> getOperationPolicyAttachPoints();
>> }
>>
>> public interface OperationPolicyAttachPoint extends PolicyAttachPoint {
>>    String getOperation();
>>    String getService();
>>    void setOperation(String operation);
>>    void setService(String service);
>> }
>>
>> Thanks,
>> Raymond
>>
> -- 
> Jean-Sebastien
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Model intents and policySets attached under elements, was:Re: Transaction policy seed code and questions on the Tuscany policy framework

Posted by Jean-Sebastien Delfino <js...@apache.org>.
[snip]
Raymond Feng wrote:
>
> We can have something like:

Well... You know what I think about how to model the intent -> 
operations relationship :) I think that you should experiment a bit with 
what you're proposing, I'd like to just bring to your attention that:

- modeling operation and service as just strings is not consistent with 
what we're doing elsewhere in the model, and will require lookups all 
over the place

- IIRC policies can be associated with operations on services, 
references, callbacks and implementations, component types (and I'm not 
sure about constraining types)

- policies can also be associated with all operations on an interface, 
or all operations on an implementation

- you'll need to distinguish between intent attach points and policySet 
attach points

>
> public interface Component extends PolicyAttachPoint {
> ...
>    // List<Intent> getRequiredIntents(); // from PolicyAttachPoint
>    // List<PolicySet> getPolicySets(); // from PolicyAttachPoint
>    List<OperationPolicyAttachPoint> getOperationPolicyAttachPoints();
> }
>
> public interface OperationPolicyAttachPoint extends PolicyAttachPoint {
>    String getOperation();
>    String getService();
>    void setOperation(String operation);
>    void setService(String service);
> }
>
> Thanks,
> Raymond
>
-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org