isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Óscar Bou - GOVERTIS <o....@govertis.com>
Subject Re: Many-to-1 relationship?
Date Fri, 18 Aug 2017 13:38:11 GMT

Dear Kevin,

Not sure if this question was properly answered, as there were a discussion about ValueObjects
on Apache Isis.


But if what you want is, as you detail, to have m-n relationships, being 2 different domain
entities, each with its own “identity” in terms of DDD, and most probably each one its
own table on the RDBMS, then you have different options to implement it through JDO annotations.

We defined some Eclipse & IntelliJ code templates covering those use cases:
- On IntelliJ as Isis settings live templates [1].
- On Eclipse as editor templates [2]

On [3] I’ve uploaded a screenshot with those templates appearing on Eclipse after writing
“isjd” (for Isis JDO templates) and pressing [CTRL] + [Space] (at least on my config …).

If it’s a 1-n relationship, you should use one of the options starting with “isjdc-1n-“.



HTH,

Oscar


[1] https://isis.apache.org/guides/dg/dg.html#_dg_ide_intellij <https://isis.apache.org/guides/dg/dg.html#_dg_ide_intellij>
[2] https://isis.apache.org/guides/dg/dg.html#_dg_ide_eclipse <https://isis.apache.org/guides/dg/dg.html#_dg_ide_eclipse>
[3] http://imgur.com/a/gbTdP <http://imgur.com/a/gbTdP>




> El 15 ago 2017, a las 12:16, Kevin Meyer <kevin@kmz.co.za> escribió:
> 
> Dear all,
> 
> While writing my previous reply, it also occurred to me to raise some
> questions about the relationship between Customer and
> CustomerContactInformation.
> 
> In Ekko's example:
> - the CustomerContactInformation only contains a telephone number.
> - there is a 1-to-1 relationship between Customer and
> CustomerContactInformation
> 
> My question is:
> - If I wanted to re-use a CustomerContactInformation between two or more
> customers (say all Customers that are employees of a company should re-use
> the company contact information), how do I annotate the POJOs?
> 
> Or is this domain design fundamentally flawed ? In this case, should the
> address instead be fetched (a getter) from the "Employer"'s
> ContactInformation? (where there is a 1-to-many, i.e. "Employer has many
> Employees" relationship).
> I suspect the real answer is probably "it depends on what you need"...
> 
> 
> Cheers,
> Kevin
> 
> 
>> Hi support,
>> 
>> 
>> I'm building project with Apache Isis,but I have some confusion.
>> 
>> 
>> In DDD,I know there have two objects,entity & value object.
>> 
>> 
>> When I plan a DomainObject,eg. Customer, a entity object. I think one
>> Customer may be have many value objects,for example contact information
>> or other value objects.
>> 
>> So I plan a value object called CustomerContactInformation,may be have
>> other value objects.
>> 
>> For the database,a entity object and its value objects may be persist to
>> diff tables.
>> 
>> I think CustomerContactInformation just a value object,it can not have
>> any actions and should be maintained by Customer.
>> 
>> In fact,Customer-CustomerContactInfomation definitely is 1-1.
>> 
>> 
>> Now,how should I display CustomerContactInformation in Customer's layout
>> and be able to edit CustomerContactInformation?
>> 
>> Any ideas?
>> 
>> 
>> Ekko
>> 
>> 
>> 
> 
> 
> -- 
> Kevin Meyer
> Ljubljana, Slovenia
> 
> 



Óscar Bou Bou
Socio - IT & GRC Management Services Director
m: +34 620 267 520
s:  <http://www.govertis.com/>www.govertis.com <http://www.govertis.com/> e: o.bou@govertis.com
<mailto:o.bou@govertis.com>

LinkedIn: https://www.linkedin.com/in/oscarbou <https://www.linkedin.com/in/oscarbou>
Twitter: 	@oscarbou <https://twitter.com/oscarbou>



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 GOVERTIS ADVISORY SERVICES, 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: GOVERTIS ADVISORY SERVICES, S.L. Avda Cortes Valencianas, 58 – 8º
- 6ª. 46015 - Valencia,  y Paseo de la Castellana, 153, 28045 - MADRID. Asimismo, es su responsabilidad
comprobar que este mensaje o sus archivos adjuntos no contengan virus informáticos, y en
caso que los tuvieran eliminarlos.



Mime
View raw message