On 28 Apr 2017, at 14:02, Esteban A. Maringolo
<emaringolo(a)gmail.com> wrote:
Maybe the naming is misleading. I'd expect QCParentObject to be the
one that contains owned object (QCChildObject/QCOwnedObject).
I have similar classes in my apps, named TsModel (your QCObject) and
TsModelPart (your QCParentObject). ModelPart understands #owner and
have certain behavior delegating back to Model.
Regards!
Esteban A. Maringolo
2017-04-28 6:45 GMT-03:00 Diego Lont <diego.lont(a)delware.nl>nl>:
Hi Udo,
Yes, the basic idea is that a QCParentObject is an object that is owned by a parent. For
instance if you have in your domain model a todo list that belongs to a project, the todo
list items should be derived from QCParentObject. This also allows to delegate certain
things back to the parent, like accessing the model, that is the root the object belongs
to. Another example is for properties like “canEdit” where one can decide to have user
rights only for the parent object (the project) and not for the child objects (the todo
items).
For practical purposes I usually create a domain model that is an artificial owner: the
model that is the owner of all objects, thus resulting in all objects, except the modeli,
to be a subtype of QCParentObject. But one could easily make a different implementation to
link the objects back to the model (i.e. creating a subclass that returns for the model
always the singleton of a certain class)
I hope this rationale helps.
Regards,
Diego
On 27 Apr 2017, at 22:19, Udo Schneider
<udo.schneider(a)homeaddress.de> wrote:
All,
I can't really understand the difference between QCObject and QCParentObject and when
to use which.
From reading the source I can guess that a QCParentObject allows you to access the
ApplicationModel using #model (through it's parent ivar). But is this all?
CU,
Udo
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.list.inf.unibe.ch/listinfo/smallwiki
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.list.inf.unibe.ch/listinfo/smallwiki
_______________________________________________
Magritte, Pier and Related Tools ...