You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by QUALITEC - Óscar Bou <ob...@qualitec.es> on 2014/09/06 18:17:55 UTC
Has Java "Traits" and "Mixins" by means of Apache Isis ?
Hi to all.
Just to notice that I've been reading recently about the concept of "traits" [1] and "mixins" [2], as a way to encourage code reuse avoiding inheritance problems.
This language features are supported by languages like Ada, Groovy, Scala or Python, but there's no native support for Java.
It's REALLY noticeable that we, as Apache Isis users, have somewhat an implementation of those concepts by means of contributions [3].
So, can we think about contributions as a "traits" or "mixins" implementation for Apache Isis developed systems?
Regards,
Oscar
[1] http://en.wikipedia.org/wiki/Trait_(computer_programming)
[2] http://en.wikipedia.org/wiki/Mixin
[3] http://isis.apache.org/more-advanced-topics/how-to-01-062-How-to-decouple-dependencies-using-contributions.html
Re: Has Java "Traits" and "Mixins" by means of Apache Isis ?
Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Ged,
Yes, I'm familiar with the concepts in DCI; one of our other committers,
Maurizio, has also made that observation in the past. I do think one could
describe Isis as an implementation of the DCI approach and not be bending
the truth very much (perhaps even at all).
In fact, there's a bit of a deeper connection between DCI and Naked
Objects. Trygve Reenskaug, with Jim Coplein one of the authors of DCI, was
one of the external examiners to Richard Pawson's PhD thesis on Naked
Objects, and was good enough to write a forward to Richard's document [1].
Whatever the theory, I do think that with Isis one could use the entities
just to define the structure, and then layer all the behaviour on top as
contributions. Indeed, each use case could be a separate domain service
named after that use case. Moreover, the event bus stuff we added in
1.5.0/1.6.0 then allows those original use cases to be modified outside of
their original context... a subscriber to an event (=action) can disable
(or even hide) an action if appropriate.
And its for this capability of Isis to be able to decouple applications
that we chose the word "module" for the different components that we are
assembling on the new isisaddons.org site [2]... trying to breathe a bit of
life into a much neglected pattern of DDD [3].
Cheers
Dan
[1] http://www.nakedobjects.org/downloads/Pawson%20thesis.pdf
[2] http://www.isisaddons.org
[3] http://domainlanguage.com/ddd/patterns/DDD_Reference_2011-01-31.pdf
On 7 Sep 2014 10:58, "Ged Byrne" <ge...@gmail.com> wrote:
> Hi Dan,
>
>
> Are you familiar with DCI?
>
>
>
>
> "Object-oriented programming was supposed to unify the perspectives of the
> programmer and the end user in computer code: a boon both to usability and
> program comprehension. While objects capture structure well, they fail to
> capture system action. DCI is a vision to capture the end user cognitive
> model of roles and interactions between them."
>
> http://www.artima.com/articles/dci_vision.html
>
>
>
>
> It's always struck me that there is a similarity between DCI and Naked
> Objects. Lack of traits is one of the big differences sice DCI relies so
> heavily on them.
>
>
>
>
> So I'm intrigued to learn about contributions.
>
>
>
>
> Regards,
>
>
>
>
>
>
>
> Ged
>
>
>
>
>
>
>
>
>
> —
> Sent from Mailbox
>
> On Sun, Sep 7, 2014 at 10:00 AM, Dan Haywood <dan@haywood-associates.co.uk
> >
> wrote:
>
> > Hi Oscar,
> > Yes, the are many similarities between traits and contributions.
> > In fact I've often thought that Isis is in some regards more of an
> > aspect-oriented framework than an object - oriented frameworks. At the
> > system level it implements presentation logic as a cross - cutting
> concern,
> > sell as the more usual security, transactions and auditing.
> > Using the event bus one can also book into these pointcuts at an
> > application level.
> > Cheers,
> > Dan.
> > On 6 Sep 2014 18:01, "QUALITEC - Óscar Bou" <ob...@qualitec.es> wrote:
> >>
> >> Hi to all.
> >>
> >> Just to notice that I've been reading recently about the concept of
> >> "traits" [1] and "mixins" [2], as a way to encourage code reuse avoiding
> >> inheritance problems.
> >>
> >> This language features are supported by languages like Ada, Groovy,
> Scala
> >> or Python, but there's no native support for Java.
> >>
> >> It's REALLY noticeable that we, as Apache Isis users, have somewhat an
> >> implementation of those concepts by means of contributions [3].
> >>
> >> So, can we think about contributions as a "traits" or "mixins"
> >> implementation for Apache Isis developed systems?
> >>
> >>
> >> Regards,
> >>
> >> Oscar
> >>
> >>
> >>
> >> [1] http://en.wikipedia.org/wiki/Trait_(computer_programming)
> >>
> >> [2] http://en.wikipedia.org/wiki/Mixin
> >>
> >> [3]
> >>
> http://isis.apache.org/more-advanced-topics/how-to-01-062-How-to-decouple-dependencies-using-contributions.html
Re: Has Java "Traits" and "Mixins" by means of Apache Isis ?
Posted by GESCONSULTOR - Óscar Bou <o....@gesconsultor.com>.
Hi, Ged.
Jeroen can give you more detail, but as far as I know:
- CommunicationChannels is the service that holds the properties, collections and actions to be contributed (i.e., it's the trait) [1].
- CommunicationChannelOwner is the interface to "mark" those Entities that must be contributed with [2].
- CommunicationChannel is an ABSTRACT Entity that can be contributed (as a property, as a collection) [3].
- The whole package that contains concrete implementations of CommunicationChanel to be contributed [4].
See at [1] how easy and clear is the code to define a contribution / "trait", thanks to Dan and Jeroen's efforts :))
REALLY powerful for decoupling, reuse among entities and ease code maintenance...
HTH,
Oscar
[1] https://github.com/estatio/estatio/blob/master/dom/src/main/java/org/estatio/dom/communicationchannel/CommunicationChannels.java
[2] https://github.com/estatio/estatio/blob/master/dom/src/main/java/org/estatio/dom/communicationchannel/CommunicationChannelOwner.java
[3] https://github.com/estatio/estatio/blob/master/dom/src/main/java/org/estatio/dom/communicationchannel/CommunicationChannel.java
[4] https://github.com/estatio/estatio/tree/master/dom/src/main/java/org/estatio/dom/communicationchannel
El 07/09/2014, a las 11:58, Ged Byrne <ge...@gmail.com> escribió:
> Hi Dan,
>
>
> Are you familiar with DCI?
>
>
>
>
> "Object-oriented programming was supposed to unify the perspectives of the programmer and the end user in computer code: a boon both to usability and program comprehension. While objects capture structure well, they fail to capture system action. DCI is a vision to capture the end user cognitive model of roles and interactions between them."
>
> http://www.artima.com/articles/dci_vision.html
>
>
>
>
> It's always struck me that there is a similarity between DCI and Naked Objects. Lack of traits is one of the big differences sice DCI relies so heavily on them.
>
>
>
>
> So I'm intrigued to learn about contributions.
>
>
>
>
> Regards,
>
>
>
>
>
>
>
> Ged
>
>
>
>
>
>
>
>
>
> —
> Sent from Mailbox
>
> On Sun, Sep 7, 2014 at 10:00 AM, Dan Haywood <da...@haywood-associates.co.uk>
> wrote:
>
>> Hi Oscar,
>> Yes, the are many similarities between traits and contributions.
>> In fact I've often thought that Isis is in some regards more of an
>> aspect-oriented framework than an object - oriented frameworks. At the
>> system level it implements presentation logic as a cross - cutting concern,
>> sell as the more usual security, transactions and auditing.
>> Using the event bus one can also book into these pointcuts at an
>> application level.
>> Cheers,
>> Dan.
>> On 6 Sep 2014 18:01, "QUALITEC - Óscar Bou" <ob...@qualitec.es> wrote:
>>>
>>> Hi to all.
>>>
>>> Just to notice that I've been reading recently about the concept of
>>> "traits" [1] and "mixins" [2], as a way to encourage code reuse avoiding
>>> inheritance problems.
>>>
>>> This language features are supported by languages like Ada, Groovy, Scala
>>> or Python, but there's no native support for Java.
>>>
>>> It's REALLY noticeable that we, as Apache Isis users, have somewhat an
>>> implementation of those concepts by means of contributions [3].
>>>
>>> So, can we think about contributions as a "traits" or "mixins"
>>> implementation for Apache Isis developed systems?
>>>
>>>
>>> Regards,
>>>
>>> Oscar
>>>
>>>
>>>
>>> [1] http://en.wikipedia.org/wiki/Trait_(computer_programming)
>>>
>>> [2] http://en.wikipedia.org/wiki/Mixin
>>>
>>> [3]
>>> http://isis.apache.org/more-advanced-topics/how-to-01-062-How-to-decouple-dependencies-using-contributions.html
Óscar Bou Bou
Responsable de Producto
Auditor Jefe de Certificación ISO 27001 en BSI
CISA, CRISC, APMG ISO 20000, ITIL-F
902 900 231 / 620 267 520
http://www.twitter.com/oscarbou
http://es.linkedin.com/in/oscarbou
http://www.GesConsultor.com
Este mensaje y los ficheros anexos son confidenciales. Los mismos contienen información reservada que no puede ser difundida. Si usted ha recibido este correo por error, tenga la amabilidad de eliminarlo de su sistema y avisar al remitente mediante reenvío a su dirección electrónica; no deberá copiar el mensaje ni divulgar su contenido a ninguna persona.
Su dirección de correo electrónico junto a sus datos personales constan en un fichero titularidad de Gesdatos Software, S.L. cuya finalidad es la de mantener el contacto con Ud. Si quiere saber de qué información disponemos de Ud., modificarla, y en su caso, cancelarla, puede hacerlo enviando un escrito al efecto, acompañado de una fotocopia de su D.N.I. a la siguiente dirección: Gesdatos Software, S.L. , Paseo de la Castellana, 153 bajo - 28046 (Madrid), y Avda. Cortes Valencianas num. 50, 1ºC - 46015 (Valencia). Asimismo, es su responsabilidad comprobar que este mensaje o sus archivos adjuntos no contengan virus informáticos, y en caso que los tuvieran eliminarlos.
Re: Has Java "Traits" and "Mixins" by means of Apache Isis ?
Posted by Ged Byrne <ge...@gmail.com>.
Hi Dan,
Are you familiar with DCI?
"Object-oriented programming was supposed to unify the perspectives of the programmer and the end user in computer code: a boon both to usability and program comprehension. While objects capture structure well, they fail to capture system action. DCI is a vision to capture the end user cognitive model of roles and interactions between them."
http://www.artima.com/articles/dci_vision.html
It's always struck me that there is a similarity between DCI and Naked Objects. Lack of traits is one of the big differences sice DCI relies so heavily on them.
So I'm intrigued to learn about contributions.
Regards,
Ged
—
Sent from Mailbox
On Sun, Sep 7, 2014 at 10:00 AM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:
> Hi Oscar,
> Yes, the are many similarities between traits and contributions.
> In fact I've often thought that Isis is in some regards more of an
> aspect-oriented framework than an object - oriented frameworks. At the
> system level it implements presentation logic as a cross - cutting concern,
> sell as the more usual security, transactions and auditing.
> Using the event bus one can also book into these pointcuts at an
> application level.
> Cheers,
> Dan.
> On 6 Sep 2014 18:01, "QUALITEC - Óscar Bou" <ob...@qualitec.es> wrote:
>>
>> Hi to all.
>>
>> Just to notice that I've been reading recently about the concept of
>> "traits" [1] and "mixins" [2], as a way to encourage code reuse avoiding
>> inheritance problems.
>>
>> This language features are supported by languages like Ada, Groovy, Scala
>> or Python, but there's no native support for Java.
>>
>> It's REALLY noticeable that we, as Apache Isis users, have somewhat an
>> implementation of those concepts by means of contributions [3].
>>
>> So, can we think about contributions as a "traits" or "mixins"
>> implementation for Apache Isis developed systems?
>>
>>
>> Regards,
>>
>> Oscar
>>
>>
>>
>> [1] http://en.wikipedia.org/wiki/Trait_(computer_programming)
>>
>> [2] http://en.wikipedia.org/wiki/Mixin
>>
>> [3]
>> http://isis.apache.org/more-advanced-topics/how-to-01-062-How-to-decouple-dependencies-using-contributions.html
Re: Has Java "Traits" and "Mixins" by means of Apache Isis ?
Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Oscar,
Yes, the are many similarities between traits and contributions.
In fact I've often thought that Isis is in some regards more of an
aspect-oriented framework than an object - oriented frameworks. At the
system level it implements presentation logic as a cross - cutting concern,
sell as the more usual security, transactions and auditing.
Using the event bus one can also book into these pointcuts at an
application level.
Cheers,
Dan.
On 6 Sep 2014 18:01, "QUALITEC - Óscar Bou" <ob...@qualitec.es> wrote:
>
> Hi to all.
>
> Just to notice that I've been reading recently about the concept of
> "traits" [1] and "mixins" [2], as a way to encourage code reuse avoiding
> inheritance problems.
>
> This language features are supported by languages like Ada, Groovy, Scala
> or Python, but there's no native support for Java.
>
> It's REALLY noticeable that we, as Apache Isis users, have somewhat an
> implementation of those concepts by means of contributions [3].
>
> So, can we think about contributions as a "traits" or "mixins"
> implementation for Apache Isis developed systems?
>
>
> Regards,
>
> Oscar
>
>
>
> [1] http://en.wikipedia.org/wiki/Trait_(computer_programming)
>
> [2] http://en.wikipedia.org/wiki/Mixin
>
> [3]
> http://isis.apache.org/more-advanced-topics/how-to-01-062-How-to-decouple-dependencies-using-contributions.html
Re: Has Java "Traits" and "Mixins" by means of Apache Isis ?
Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Estatio had several, also in the new isisaddons/isis-module-security that
we're just finishing up, see the app package in the -dom module.
Dan
On 7 Sep 2014 09:05, "Ged Byrne" <ge...@gmail.com> wrote:
> Contributions look useful. Where can I find out more about them?
>
>
> Is there a good example of contribution use somewhere on GitHub?
> —
> Sent from Mailbox
>
> On Sat, Sep 6, 2014 at 6:01 PM, QUALITEC - Óscar Bou <ob...@qualitec.es>
> wrote:
>
> > Hi to all.
> > Just to notice that I've been reading recently about the concept of
> "traits" [1] and "mixins" [2], as a way to encourage code reuse avoiding
> inheritance problems.
> > This language features are supported by languages like Ada, Groovy,
> Scala or Python, but there's no native support for Java.
> > It's REALLY noticeable that we, as Apache Isis users, have somewhat an
> implementation of those concepts by means of contributions [3].
> > So, can we think about contributions as a "traits" or "mixins"
> implementation for Apache Isis developed systems?
> > Regards,
> > Oscar
> > [1] http://en.wikipedia.org/wiki/Trait_(computer_programming)
> > [2] http://en.wikipedia.org/wiki/Mixin
> > [3]
> http://isis.apache.org/more-advanced-topics/how-to-01-062-How-to-decouple-dependencies-using-contributions.html
Re: Has Java "Traits" and "Mixins" by means of Apache Isis ?
Posted by Ged Byrne <ge...@gmail.com>.
Contributions look useful. Where can I find out more about them?
Is there a good example of contribution use somewhere on GitHub?
—
Sent from Mailbox
On Sat, Sep 6, 2014 at 6:01 PM, QUALITEC - Óscar Bou <ob...@qualitec.es>
wrote:
> Hi to all.
> Just to notice that I've been reading recently about the concept of "traits" [1] and "mixins" [2], as a way to encourage code reuse avoiding inheritance problems.
> This language features are supported by languages like Ada, Groovy, Scala or Python, but there's no native support for Java.
> It's REALLY noticeable that we, as Apache Isis users, have somewhat an implementation of those concepts by means of contributions [3].
> So, can we think about contributions as a "traits" or "mixins" implementation for Apache Isis developed systems?
> Regards,
> Oscar
> [1] http://en.wikipedia.org/wiki/Trait_(computer_programming)
> [2] http://en.wikipedia.org/wiki/Mixin
> [3] http://isis.apache.org/more-advanced-topics/how-to-01-062-How-to-decouple-dependencies-using-contributions.html