I am creating a Java Project for my exam. The project asks me to do a groupon-like program using Object-oriented programming. It asks me to realize a program to sell discounted products. I have holidays, dinners and normal objects. I decided to create a super-class Product and then to extend it creating the other three classes, dinners, holidays, and objects. But it also asks me to manage a catalog of the products making have to every product an unique identifier, how can I? Even if I create a Catalog class, managing the product with an ArrayList, how can I add an identifier to each element? I also have to distinguish between users and administrator.Each of them can do different things, the administrator can add and remove products from the catalog, see the active offers and order them, and can see the no longer affordable offers. The User can register to the system, buy credits, see the avaible offers, buy something and can see everything that he bought, sorting them by the price or by the date of purchase.
My question is, how can i distinguish the user and allow them to do different things ? I have to allow a log-in operation at the beginning and show different button for users and administrator. Could help me? Give me an idea of how to manage the situation? (Should they be a superclass(user) with an administrator that extends the user?)
Thanks!