top of page

Orchestra class - Part A

  • Writer: Renee Li
    Renee Li
  • Oct 12
  • 1 min read

A simple book order system using Csharp and oop concepts.


There are somethings I still need to refine and might add other classes as suggested by Copilot. Below are what are work and what can be improved by Copilot.


What is working:
  • Separation of Concerns: You’re not mixing validation, storage, and execution logic.

  • Extensibility: You can easily add more commands (SendEmailCommand, UpdateInventoryCommand, etc.).

  • Batch-Ready: Lists allow you to process multiple orders in sequence or parallel.

  • Command Execution: You’ve got a method to run individual commands, which is great for modularity.


What can be refined:

1. Clarify the Role of Lists

Right now, you're storing lists of orders, addresses, and payments—but the ExecuteOrder method only takes one of each. You might want to:

  • Either link them by index (e.g., Orders[0] goes with ShippingAddresses[0])

  • Or create a wrapper class like OrderBundle:


Honestly, I think create a wrapper class to bundle these three lists might be the way to go, which I will show in Part B.


  1. Add a Batch Executor

public void ExecuteAllCommands()

{

//

}


  1. Rename GetX Methods

    The methods GetOrder, GetShippingAddress, GetPaymentDetails are actually adders, not getters.


I need to re-think about all the properties of the attributes and encapsulation concepts as well.


Also, Generic<T> can be added and lambda functions can be applied in main programs. Something to think about when extending the program.


Without further due, below is the implementation for part A.


ree

ree

Stay tuned for part B!


Comments


bottom of page