Q: Where should i place transactions in this system So I have started my initial design of a simple system.
I have a superclass/abstract called Customer. It has 2 subclasses: PrivateCustomer and BusinessCustomer.
I also have an account class. This account may be a downpayment account or just a regular account. It it determined by a Enum.
The Customer class has a List<> of accounts.
Now, I also have a transaction class, and this is where it gets tricky.
The transaction class has the following properties:


*

*Sender 

*Receiver 

*Amount 

*Date 

*Type (Enum)


As you might imagine:
A customer can have 1 or more accounts.
A customer can make 0 or more transactions.
An account has transactions (or the other way around?)
Now. Where do I place there transaction? Keep in mind, the system might have/get [insert large number] of transactions over time.


*

*Do I have a global list of all
transactions and simply filter the
list, when I want to see all
transaction for PrivateCustomer
12345?

*Do each account property, in the
Customer class, have a list of all
transactions instead?

*Something third?


As long as its an OO-solution, I will be satisfied.

A: 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.
Something along these lines:
using System;
using System.Collections.Generic;

namespace Sample
{
    public abstract class Customer
    {
        protected string _name;
        //...
    }

    public class PrivateCustomer : Customer
    {
        private List<Transaction> _transactions;
        //...
    }

    public class BusinessCustomer : Customer
    {
        private List<Transaction> _transactions;
        //...
    }

    public class Transaction
    {
        private Customer _sender;
        private Customer _receiver;
        private double _amount;
        private DateTime _date;
        private AccountType _accountType;

        //...
    }

    public enum AccountType
    {
        Downpayment,
        Regular
    }
}

a revision taking into account the account information (no pun intended):
using System;
using System.Collections.Generic;

namespace Sample
{
    public abstract class Customer
    {
        private List<Account> _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<Transaction> _transactions;
    }

    public class RegularAccount
    {
        //...
    }

    public class DownpaymentAccount
    {
        //...
    }
}

