What does both a staff member and a student have in common? They are both People, and many of the common methods are common to all people. getName(), getAge(), getPhoneNumber(), getAddress(), etc can easily be applied to both, which under this structure means that you would have to duplicate those methods for both Student and Staff. One template is typically used to construct more than one class (although it is not necessary for a class to be used more than once, using it once (or not using it at all) is fine).Īs you can see, there is going to be a lot of duplication between staff and students. It also involves maintaining the database of entering new books and the record of books that have been retrieved or issued, with their respective dates. You have a "class" per person, which really limits your design because, if you want to add a student or teacher, you need to start writing a new class.Ĭlasses are templates, and each template is used to construct an "instance of the class" or more specifically an "instance". Library management system is all about organizing, managing the library and library-oriented tasks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |