Hi, Dan.
Many thanks. I'll complete it with the CollectionRemoveFrom... logic.
I've seen now the treat to avoid using the CollectionFacet on:
final Object referencedObject =
AdapterUtils.unwrap(referencedObjectAdapter);
// get hold of underlying collection
final Object collection =
getterFacet.getProperty(targetAdapter);
// don't post event if has set semantics and contains object
if(collection instanceof Set) {
Set<?> set = (Set<?>) collection;
if(set.contains(referencedObject)) {
return;
}
}
That's clear now!
Also, I've seen you've introduced a WrapperFactory policy that seems to not
force the Disable or Hidden checks, but stills execute the business logic
associated.
So this way we can always configure use
wrapperFactory(domainObject).setXXX
to ensure that the business logic on the modifyXXX methods is execute, despite
the property is hidden or disabled.
That's really useful on domain entities code.
Unlike the previous case, on BDD tests (testing the user's behavior) it makes
more sense to test forcing those hidden and disabled policies.
So, how (or where) should be inject, configure or invoke the WrapperFactory on
each case?
- Domain Entities.
- BDD tests.
I'm sure there's something I'm missing...
Thanks,
Oscar
El 07/05/2014, a las 09:56, Dan Haywood <[email protected]>
escribió:
> Hi Oscar,
> I've just pushed branch ISIS-550; this pretty much implements the collection
> add-to stuff.
>
> The CollectionFacet isn't needed; that's for iterating over collections, not
> for manipulating them.
>
> Take a look at the ToDoItem class, specifically its getDependencies() method.
> Note also the add(...) method, and how it can use the wrap(...) even though
> the colleciton is disabled (via ToDoItem.layout.json).
>
> Cheers
> Dan
>
>
>
>
>
>
> 2014-05-06 17:35 GMT+01:00 GESCONSULTOR - Óscar Bou <[email protected]>:
> Many thanks.
>
> Cheers,
>
> Oscar
>
>
> El 06/05/2014, a las 17:05, Dan Haywood <[email protected]>
> escribió:
>
>
>> Thanks for starting on this Oscar ... I'll look at it this eve.
>>
>> Cheers
>> Dan
>>
>>
>>
>> On 6 May 2014 15:49, GESCONSULTOR - Óscar Bou <[email protected]>wrote:
>>
>>>
>>> Hi, Dan.
>>>
>>> I've tried to complete an implementation of @PostsCollectionAddedToEvent,
>>> but unable to complete it.
>>>
>>> I think that there's a need to import CollectionFacet, in order to detect
>>> if the element had been previously added to the collection, and that forces
>>> to specify if it's a JavaCollection or an ArrayCollection.
>>>
>>> Dan, please, can you complete this one?
>>>
>>> I can replicate it aftewards for @PostsCollectionRemovedFromEvent
>>>
>>>
>>> We need it for decoupling one projection that must be generated
>>> automatically from another context, and that's the best way we've found.
>>> The alternatives seems to be to implement on each collection the addToXXX,
>>> removeFromXXX and inside those methods, post the event.
>>>
>>>
>>>
>>> Many Thanks,
>>>
>>> Oscar
>>>
>>>
>>> [1] https://issues.apache.org/jira/browse/ISIS-550
>>>
>>>
>
>
> Ó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.
>
>
>
>
>
>
Ó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.