I am doing part 2 assignment (Big Cigar) and have a question:
1. So far I have never seen Payment to be an entity, where as this is part of the Domain Model in assignment. I am having hard time imagining how to picture that as an entity.
To me it is more of a transactional attribute, which doesn't or shouldn't have any existence outside the transaction.
Well, perhaps you want to capture more details about the payments of the orders (cc or paypal or check, date, owner of the cc if it is the case etc).
I think it can be (0,1)-(1,1) with Orders entity, if there is such entity.
It can be an entity-why not? Payment(One to One) is having relationship with Order as well as with Customer(One Customer many Payments). Like many eCommerce systems, you would also like to store/persist the details of payment-don't you think so?
Payment Transaction Request or Payment Transaction response could be transactional in nature.
I think we are talking in somewhat different context. Here is what i have done. There is payment entity (which could be sub classed to credit card or paypal or bank account etc...). System creates a payment request containing the payment method and customer details and send it to Payment Service(Merchant Bank system) and it returns back Payment response which contains transaction code, status, description and some other details which are required in these kind of systems.
I don't think there is any need to make Payment request and Payment response as entity-they are classes but not persistent.
How i am gonna track the payments?
I have the audit and system log where i am recording all such activities for a given order.
How Order and Payment are related?
One order one payment-but both of them are different entities. Note I can follow Dell's style here where you can pay for the order from multiple credit cards or multiple payment ways but i wanted to make architecture simple to some extent.