Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 591219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:36:43+00:00 2026-05-13T15:36:43+00:00

So I have started my initial design of a simple system. I have a

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:36:43+00:00Added an answer on May 13, 2026 at 3:36 pm

    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
        {
            //...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that once started will get some initial data from my
I have started a new website with visual studio, and it gave me initial
I have started to look into python and am trying to grasp new things
I have started to try out to use the new Search API, the demo
I have started developing for Adroid Phones a couple of days ago and I
I have started implementing Subscriptions into my app but I cannot get the API
I have started using WSO2 Stratos live and started using WSO2 data services server.
I have started using SqLite recently, so I am relatively new to it. I
I have started reading the book Essential Linux Device Drivers. I am following the
I have started playing with UIProgressView in iOS5, but havent really had luck with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.