Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Why not Sender and Receiver be references to Customer objects. Going the other way, each Customer has a List of references to Transaction objects that it is participating in. If your design will allow for a circular reference, this is the way I would go.</p> <p>Something along these lines:</p> <pre><code>using System; using System.Collections.Generic; namespace Sample { public abstract class Customer { protected string _name; //... } public class PrivateCustomer : Customer { private List&lt;Transaction&gt; _transactions; //... } public class BusinessCustomer : Customer { private List&lt;Transaction&gt; _transactions; //... } public class Transaction { private Customer _sender; private Customer _receiver; private double _amount; private DateTime _date; private AccountType _accountType; //... } public enum AccountType { Downpayment, Regular } } </code></pre> <p>a revision taking into account the account information (no pun intended):</p> <pre><code>using System; using System.Collections.Generic; namespace Sample { public abstract class Customer { private List&lt;Account&gt; _accounts; protected string _name; //... } public class PrivateCustomer : Customer { //... } public class BusinessCustomer : Customer { //... } public class Transaction { private Account _sender; private Account _receiver; private double _amount; private DateTime _date; //... } public abstract class Account { private Customer _customer; private Collection&lt;Transaction&gt; _transactions; } public class RegularAccount { //... } public class DownpaymentAccount { //... } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload