Messages In This Digest (4 Messages)
- 1.1.
- Re: Adding entities to another, questions around basic example From: sebaszipp
- 1.2.
- Re: Adding entities to another, questions around basic example From: Rickard Öberg
- 1.3.
- Re: Adding entities to another, questions around basic example From: Raoul Duke
- 1.4.
- Re: Adding entities to another, questions around basic example From: Nuno Lopes
Messages
- 1.1.
-
Re: Adding entities to another, questions around basic example
Posted by: "sebaszipp" sebaszipp@yahoo.com sebaszipp
Wed Dec 9, 2009 10:18 am (PST)
Hi Rickard,
You mention the following int he QI4J homepage:
>Composite Oriented Programming builds on some principles that are not >addressed by Object Oriented Programming at all.
> * Behavior depends on Context
> * Decoupling is a virtue
> * Business Rules matters more.
> * Classes are dead, long live interfaces.
and my question is about the meaning you are giving for OOP?
I've seen some code in the Qi4J homepage tutorials and looks pretty overelaborated, something that should be so simple as in other languages. Aren't you going against Java's nature? Its something Java doesn't provide, so I don't see bad implementing roles as objects.
It looks more simple and readable:
class SavingsAccount extends Account implements MoneyTransferSourceAccount, ...other roles... {
transferTo(ReceipientAccount, Money) {
...
ReceipientAccount.deposit(Money) ;
}
}
than making Javas workaround to extend what the language nature doesn't offer:
@Concerns({
AuditTrailConcern.class,
PurchaseLimitConcern.class,
InventoryConcern.class
})
@Mixins( TrailableMixin.class )
public interface OrderEntity
extends Order, HasSequenceNumber, HasCustomer,
HasLineItems, Confirmable, EntityComposite
{
}
maybe we should wonder what options look more schizophrenic?
Cheers!
- 1.2.
-
Re: Adding entities to another, questions around basic example
Posted by: "Rickard Öberg" rickardoberg@gmail.com rickardoberg
Wed Dec 9, 2009 5:28 pm (PST)
On 2009-12-10 02.14, sebaszipp wrote:
>> Composite Oriented Programming builds on some principles that are
>> not addressed by Object Oriented Programming at all. * Behavior
>> depends on Context * Decoupling is a virtue * Business Rules
>> matters more. * Classes are dead, long live interfaces.
>
> and my question is about the meaning you are giving for OOP? I've
> seen some code in the Qi4J homepage tutorials and looks pretty
> overelaborated, something that should be so simple as in other
> languages. Aren't you going against Java's nature? Its something Java
> doesn't provide, so I don't see bad implementing roles as objects.
Java was not meant to support roles-as-mixins, so in a sense it's "going
against Java's nature". Then again, so was AOP, and many other
variations of Java. The problem with implementing roles as objects has
little to do with syntax though, as it has to do with principles of
object schizophrenia. Whether you like the syntax or not is really not
the issue.
> than making Javas workaround to extend what the language nature
> doesn't offer:
>
> @Concerns({ AuditTrailConcern.class, PurchaseLimitConcer n.class,
> InventoryConcern.class }) @Mixins( TrailableMixin. class ) public
> interface OrderEntity extends Order, HasSequenceNumber, HasCustomer,
> HasLineItems, Confirmable, EntityComposite { }
>
> maybe we should wonder what options look more schizophrenic?
As above, "look more schizophrenic" has nothing to do with the problem
being discussed.
One problem that we do have, and which DDD in general has, is that it's
hard to show the benefits with small examples. It's when you get big
domain models, with lots of roles and interactions and business rules
that the benefits kick in. Focusing on syntax issues on small examples
misses the point, although it's an easy straw man to shoot down I guess.
/Rickard
- 1.3.
-
Re: Adding entities to another, questions around basic example
Posted by: "Raoul Duke" raould@gmail.com theraoulduke
Wed Dec 9, 2009 5:30 pm (PST)
>> overelaborated, something that should be so simple as in other
>> languages. Aren't you going against Java's nature? Its something Java
>> doesn't provide, so I don't see bad implementing roles as objects.
speaking of which, i'm enjoying learning about Lagoona.
http://en.allexperts.com/e/l/ la/lagoona_ programming_ language. htm
- 1.4.
-
Re: Adding entities to another, questions around basic example
Posted by: "Nuno Lopes" nbplopes@gmail.com nbplopes
Thu Dec 10, 2009 2:30 am (PST)
Hi Sebastian
On OSP: http://dos.iitm.ac.in/LabPapers/ p61-babu. pdf
This is an MDM paper, yet describes object schizophrenia problem very well. This is an abstract problem that can have concrete manifestations in bad models where the developer is no oracle.
Once you know what the problems are it is easy to solve them with the domain and bounded contexts. Stay away from dynamic inheritance in Roles, improve your modeling skills, you should be fine.
Cheers,
Nuno
Need to Reply?
Click one of the "Reply" links to respond to a specific message in the Daily Digest.
MARKETPLACE
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Individual | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe