需要帮助在C#中正确建立库系统的OOP结构 [英] need help in making correct OOP structure of library system in c#

查看:73
本文介绍了需要帮助在C#中正确建立库系统的OOP结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的想法,告诉我它是正确的

类成员
姓名:姓名,类型,会员ID,密码,地址,借用限制
方法:注册,登录,借阅,还书,接收

班级图书管理员
字段:名称,ID,密码
方法:登录,添加书,删除书,更新书

课堂书
字段:名称,作者,版本,出版商,书籍编号,状态,机架编号

图书类在会员和图书馆员类中继承.

its what i thought, tell me is it correct

class Member
Feilds: Name , type, member ID,password, Address, borrowing limitation
methods: registeration, login, borrow, return book, reciept

Class Librarian
Fields: Name, ID, password
Methods: login, Add book, delete book, update book

Class Book
Fields: name, author, edition, publisher, no of books, status , rack no

book class is inherited in Member and librarian class

推荐答案

为什么一本书从会员或图书馆员那里继承?图书管理员是可以签出书籍的人,因此图书管理员班级将包含该人签出的书籍清单.
Why would a book inherit from a member or librarian? A librarian is a person who can check out a book, so the librarian class would contain a list of books checked out by that person.


u需要具有人员分类和图书馆分类
成员的图书馆员继承人(成员是一个人)
图书馆的书籍,成员,馆员的组成(图书馆有书籍,成员和馆员)

班级人员:
字段:名称,ID,地址,电子邮件等
方法:与字段相关

班级成员:Person
字段:用户名,密码,Borrowed [],ReturnedBooks [],收据,BorrowingLimitation,IsDefaulter
方法:与字段相关,但您应将登录方法添加到库中

班级图书管理员:人
字段:用户名,密码,等级
方法:添加书,删除书,更新书

(由于在真正的OOP中,图书管理员没有书籍的任何信息,因此它将校准书籍类的方法来相应地设置其属性和字段)

课堂书
字段:ID,名称,作者,版本,出版商,InStock(总书数),已发行(总书数),机架号
方法:IssueBook,ReturnBook,EditBook


类库
字段:姓名,地址,电话,书籍[],成员[],图书管理员[]
方法:AddMemebr,RomoveMemebr 、. . .. AddBook,RemoveBook


希望你能理解.
u need to have a person class and library class
inheritance in member, Librarian from Person (member is-a person)
composition of book, member, librarian in Library (library has books, members and librarian)

Class Person:
Fields: Name, ID, Address, Email etc
Methods: Related To Fields

Class Member: Person
Fields: Username, Password, Borrowed[], ReturnedBooks[], Receipt, BorrowingLimitation, IsDefaulter
Methods: Related to Fields, but u should add Login Method to Library

Class Librarian: Person
Fields: Username, password, Rank
Methods: Add book, delete book, update book

(since in true OOP, Librarian doesn''t have any info of book, so it will cal methods of books class to set their properties, fields accordingly)

Class Book
Fields: ID, name, author, edition, publisher, InStock(total no of books), Issued(total no of Issued Books), rack no
Methods: IssueBook, ReturnBook, EditBook


Class Library
Fields: Name, Address, TelePhone, Books[], Members[], Librarians[]
Methods: AddMemebr, RomoveMemebr, . . .. . AddBook, RemoveBook


Hope u get it.


可汗,你的意思是书本类继承了Member&Librarian? IMO,图书馆员和会员"类应继承书籍,以便您可以访问利比里亚人已添加,修改或删除的书籍属性,并且可以访问每个成员可以访问的书籍.这似乎是"cr脚的"方法,但我认为它会产生预期的结果.
Khan, do you mean the book class inherit Member & Librarian? IMO, The Librarian & Member class should inherit books so that you can access the book properties that the Liberian has added, modified or deleted and you can access the the books that each members have access to. This seems like a ''crappy'' method, but I think it produce the desired results.


这篇关于需要帮助在C#中正确建立库系统的OOP结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆