When creating a customer management system for your manager or a client, consider the requirements before writing any code. Take for instance, your boss or client wants you to solve a problem and want you to design a software to keep track of all their customers, products and orders. View the requirements in the second slide above to get the idea of where to begin your applications. Pick out the commonality in each set of requirements and write them out. See the example above.
Where should you start?
Start with the nouns
I learned that by starting with the nouns you will have an idea of what your classes might be. The above example has the three classes, which include: Customer, Product, and Order.
Define its Members
The next step is defining its members under each class. Note the example below.
Along with defining the members is identifying and setting the methods. Notice the methods validate(), retrieve(), and save().
Methods are the actions that will be able to do a certain function.
A good practice I've learned is when you create an application is to think about if the application will retrieve data from a product or customer. Another thing to ponder about is how are you going to retrieve an order of a product or how are you going to update the customer's contact information if they move. Also, when a customer buys an item are you going save it in memory, so when they decide to purchase something from your company it's automatically saved for them if they decide to repurchase the item again. Some of these scenarios are put in reality, for example if you buy an item from Amazon your account is already showing your previous items you purchased in the past.
In the second step I will show you how to set up the Customer class.