Docsity

Object-Oriented .NET Programming: Building a Library Management System, High school final essays of Computer science

Toggle sidebar
bg1
Acknowledgement
I would like to thank my parents and friends who supported to complete this project
within the allocated time. I would also like to thank Mr. Asanka Dinesh our lecturers
for giving us their support to complete the project successfully. This assignment
helped me to get a good knowledge about object oriented programming and C#
language. Designing a system using object oriented programming concepts was a
good experience for me.
Shashin Nishad
Object Oriented Programming Using Net Page 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Object-Oriented .NET Programming: Building a Library Management System and more High school final essays Computer science in PDF only on Docsity!

Acknowledgement

I would like to thank my parents and friends who supported to complete this project within the allocated time. I would also like to thank Mr. Asanka Dinesh our lecturers for giving us their support to complete the project successfully. This assignment helped me to get a good knowledge about object oriented programming and C# language. Designing a system using object oriented programming concepts was a good experience for me. Shashin Nishad

Table of Contents

  • 1 Task 01......................................................................................................................
    • 1.1 Executive Summary...........................................................................................
    • reasons for the selection of OOP concepts to develop the system........................... 1.2 Characteristic and principles of object oriented programming (OOP) and
      • 1.2.1 Abstraction..................................................................................................
      • 1.2.2 Polymorphism.............................................................................................
      • 1.2.3 Inheritance...................................................................................................
      • 1.2.4 Encapsulation..............................................................................................
    • 1.3 Why OOP for this system?.................................................................................
  • 2 Task 2........................................................................................................................
    • each class you have identified using UML notation................................................ 2.1 Identify the classes from the scenario and list all the attributes and methods of
      • 2.1.1 Class Abstraction.........................................................................................
      • 2.1.2 Identified classes from the scenario............................................................
      • 2.1.3 Classes of Sarasavi Library Management System......................................
  • 3 Task 03......................................................................................................................
    • 3.1 Use Case Diagram..............................................................................................
    • 3.2 Sequence Diagram..............................................................................................
    • 3.3 ER diagram.........................................................................................................
    • 3.4 Class Diagram....................................................................................................
  • 4 Task 04......................................................................................................................
    • 4.1 Implementation...................................................................................................
      • 4.1.1 Login Page...................................................................................................
      • 4.1.2 Change the password Page..........................................................................
      • 4.1.3 Main Menu Page.........................................................................................
    • 4.2 On Screen Help..................................................................................................
  • 5 Task 05......................................................................................................................
  • 6 Task 06......................................................................................................................
    • 6.1 Advantages of using an IDE in the system development...................................
    • 6.2 Windows forms of the Sarasavi Library Management System..........................
      • 6.2.1 Login Form..................................................................................................
      • 6.2.2 User Registration Tab..................................................................................
      • 6.2.3 Book Registration Tab.................................................................................
      • 6.2.4 Book Issue Tab............................................................................................
      • 6.2.5 Return Book Tab.........................................................................................
      • 6.2.6 Inquiries Tab................................................................................................
      • 6.2.7 Help Tab......................................................................................................
  • 7 Task 07 and Task 08..................................................................................................
    • 7.1 Test Plan.............................................................................................................
      • 7.1.1 Introduction.................................................................................................
      • 7.1.2 Elements to be tested...................................................................................
      • 7.1.3 Types of testing done..................................................................................
      • 7.1.4 Testing schedule..........................................................................................
      • 7.1.5 Hardware and software requirements..........................................................
      • 7.1.6 Testing approach.........................................................................................
    • 7.2 Test Cases...........................................................................................................
      • 7.3 Analysis of the test results................................................................................
  • 8 Task 09.................................................................................................................... - 8.1 Interview with the Library officer-in-charge (Sample Form).......................... - 8.2 Questionnaires for the Librarian (Sample Form)............................................. - 8.3 Recommendations and Suggestions................................................................. - 8.4 Conclusion........................................................................................................ - 8.5 Self Criticism....................................................................................................
  • 9 Task 10.................................................................................................................... - 9.1 Technical documentation................................................................................. - 9.1.1 Functional Requirements........................................................................... - 9.1.2 Non-functional Requirements................................................................... - 9.1.3 Installation Guide...................................................................................... - 9.2 User Manual..................................................................................................... - 9.3 Maintenance and Troubleshooting Guide........................................................ - 9.3.1 Maintenance Guide.................................................................................... - 9.3.2 Troubleshooting Guide..............................................................................
  • 10 Appendix............................................................................................................... - 10.1 Gantt Chart..................................................................................................... - 10.2 Feedback Form filled by the librarian............................................................ - 10.3 Interview with the Library officer-in-charge..................................................
  • 11 References.............................................................................................................
    • Table 1- Testing Schedule........................................................................................... List Of Tables
    • Table 2- Test Case 1....................................................................................................
    • Table 3- Test Case 2....................................................................................................
    • Table 4- Test Case 3....................................................................................................
    • Table 5- Test Case 4....................................................................................................
    • Table 6- Test Case 5....................................................................................................
    • Table 7- Test Case 6....................................................................................................
    • Table 8- Test Case 7..................................................................................................
    • Table 9- Test Case 8..................................................................................................
    • Figure 1- Use Case Diagram....................................................................................... Table Of Figures
    • Figure 2 - Sequence Diagram......................................................................................
    • Figure 3- ER diagram..................................................................................................
    • Figure 4- Class Diagram..............................................................................................
  • Figure 5 - Association..................................................................................................
  • Figure 6- Composition.................................................................................................
  • Figure 7- Generalization...............................................................................................
    • Figure 8.......................................................................................................................
    • Figure 9.......................................................................................................................
    • Figure 10.....................................................................................................................
    • Figure 11.....................................................................................................................
    • Figure 12.....................................................................................................................
    • Figure 13.....................................................................................................................
    • Figure 14.....................................................................................................................
  • Figure 15.....................................................................................................................
  • Figure 16.....................................................................................................................
  • Figure 17.....................................................................................................................
  • Figure 18.....................................................................................................................
  • Figure 19.....................................................................................................................
  • Figure 20.....................................................................................................................
  • Figure 21.....................................................................................................................
  • Figure 22.....................................................................................................................
  • Figure 23.....................................................................................................................
  • Figure 24.....................................................................................................................
  • Figure 25.....................................................................................................................
  • Figure 26.....................................................................................................................
  • Figure 27.....................................................................................................................
  • Figure 28.....................................................................................................................
  • Figure 29.....................................................................................................................
  • Figure 30.....................................................................................................................
  • Figure 31.....................................................................................................................
  • Figure 32.....................................................................................................................
  • Figure 33.....................................................................................................................
  • Figure 34.....................................................................................................................
  • Figure 35.....................................................................................................................
  • Figure 36.....................................................................................................................
  • Figure 37.....................................................................................................................
    • Figure 38.....................................................................................................................
    • Figure 39.....................................................................................................................
    • Figure 40.....................................................................................................................
    • Figure 41.....................................................................................................................
    • Figure 42.....................................................................................................................
    • Figure 43.....................................................................................................................
    • Figure 44.....................................................................................................................
    • Figure 45- Login Form................................................................................................
    • Figure 46- User Registration Tab................................................................................
    • Figure 47- Book Registration Tab...............................................................................
    • Figure 48- Book Issue Tab..........................................................................................
    • Figure 49- Return Book Tab.......................................................................................
    • Figure 50- Inquiries Tab..............................................................................................
    • Figure 51 -Help Tab....................................................................................................
    • Figure 52.....................................................................................................................
    • Figure 53.....................................................................................................................
    • Figure 54.....................................................................................................................
    • Figure 55.....................................................................................................................
    • Figure 56.....................................................................................................................
    • Figure 57.....................................................................................................................
  • Figure 58......................................................................................................................
  • Figure 59......................................................................................................................
    • Figure 60.....................................................................................................................
    • Figure 61.....................................................................................................................
    • Figure 62.....................................................................................................................
    • Figure 63.....................................................................................................................
  • Figure 64......................................................................................................................
  • Figure 65......................................................................................................................
  • Figure 66......................................................................................................................
  • Figure 67......................................................................................................................
  • Figure 68......................................................................................................................
  • Figure 69......................................................................................................................
  • Figure 70......................................................................................................................
  • Figure 71......................................................................................................................
  • Figure 72......................................................................................................................
  • Figure 73......................................................................................................................
  • Figure 74......................................................................................................................
  • Figure 75......................................................................................................................
  • Figure 76......................................................................................................................
  • Figure 77......................................................................................................................
  • Figure 78......................................................................................................................
  • Figure 79......................................................................................................................
  • Figure 80......................................................................................................................
  • Figure 81......................................................................................................................
  • Figure 82......................................................................................................................
  • Figure 83......................................................................................................................
  • Figure 84......................................................................................................................
  • Figure 85......................................................................................................................
  • Figure 86......................................................................................................................
  • Figure 87......................................................................................................................
  • Figure 88......................................................................................................................
  • Figure 89......................................................................................................................
  • Figure 90......................................................................................................................
  • Figure 91......................................................................................................................
  • Figure 92......................................................................................................................
  • Figure 93......................................................................................................................
  • Figure 94......................................................................................................................
  • Figure 95......................................................................................................................
  • Figure 96....................................................................................................................
  • Figure 97....................................................................................................................
  • Figure 98....................................................................................................................
  • Figure 99....................................................................................................................
  • Figure 100..................................................................................................................
  • Figure 101..................................................................................................................
  • Figure 102..................................................................................................................
  • Figure 103..................................................................................................................
  • Figure 104..................................................................................................................
  • Figure 105..................................................................................................................
  • Figure 106..................................................................................................................
  • Figure 107..................................................................................................................
  • Figure 108..................................................................................................................
    • Figure 109.................................................................................................................
    • Figure 110- Feedback Form......................................................................................
    • Figure 111- Feedback Form......................................................................................
    • Figure 112.................................................................................................................
    • Figure 113.................................................................................................................
    • Figure 114.................................................................................................................
    • Figure 115.................................................................................................................
    • Figure 116.................................................................................................................
    • Figure 117.................................................................................................................
    • Figure 118.................................................................................................................
    • Figure 119.................................................................................................................
    • Figure 120.................................................................................................................
    • Figure 121.................................................................................................................
    • Figure 122.................................................................................................................
    • Figure 123.................................................................................................................
  • Figure 124- Filled Feedback Form.............................................................................
  • Figure 125- Filled Feedback Form.............................................................................
  • Figure 126- Question Form........................................................................................
  • Figure 127- Question Form........................................................................................

1 Task 01

1.1 Executive Summary

Sarasavi is a popular fully stocked library with a collection of nearly 500 books. These books are available for loan as well as for reference by “Registered Members”, for free of charge. However, “Registered Visitors” cannot borrow any book instead they can only refer a book. The functions of the Sarasavi library are, Loan Process, Return Process, Reservation process, Inquiry Process, Book Registration Process and User Registration process. Currently they are planning to expand their services by introducing an automated system to manage their daily processes. Best Solutions Developers have been invited by the Sarasavi Library to fulfill the task of creating a suitable computerized system to make their needs easy. This contains all the details about the proposed solution and its features. Requirements Identified  Managing the heavy load of paperwork  Manually searching available books  Inappropriate data storing methods  Vague books and users registry Solution evaluated for Sarasavi Library Shashin Nishad

1.2.2 Polymorphism “Polymorphism is process of using anything (function, operator, and constructor) for more than one purpose with the same name. When the same identifier is used for more than one purpose it causes to overload and the system finds the best match for the overloaded identity.” (Ashu Kumar, 2004, p.7) Parent class reference variable can reference objects of a child class/subclass (Gaddis, 2011). Function overloading and operator overloading are two types of polymorphism. The main advantage of polymorphism is that the same function can be used several times using different parameters. Real Life Example A person having dual jobs (a lecturer for the day and a chef for the night) or a person who is bilingual (speaking two languages and having the same identity.). (Ashu Kumar, 2004) Code Example using System; namespace Polymorphism { class Printdata { void print(int i) { Console.WriteLine("Printing int: {0}", i ); Shashin Nishad

void print(double f) { Console.WriteLine("Printing float: {0}" , f); } void print(string s) { Console.WriteLine("Printing string: {0}", s); } static void Main(string[] args) { Printdata p = new Printdata(); // Call print to print integer p.print(1); // Call print to print float p.print(12.2); // Call print to print string p.print("Hi C++"); Console.ReadKey(); } } } When the above code is compiled and executed, it produces the following result: Printing int: 1 Printing float: 12. Shashin Nishad

public void setHeight(int h) { height = h; } protected int width; protected int height; } // Derived class class Square: Shape { public int getArea() { return (width * height); } } class SquareTester { static void Main(string[] args) { Square Squ = new Square(); Squ.setWidth(10); Squ.setHeight(10); // Print the area of the object. Console.WriteLine("Total area: {0}", Squ.getArea()); Console.ReadKey(); } } } Shashin Nishad

When the above code is compiled and executed, it produces the following result: Total area: 100 1.2.4 Encapsulation “Wrapping up of data and function into a single unit is called as Data Encapsulation.” (Ashu Kumar, 2004, p.9) This concept is also known as data hiding. The ability of the object to hide its data from the code that is outside the object is called data hiding (Gaddis, 2011). By this method data can be protected without being corrupted. Real Life Example The cement and sand are bind with its function to support the building taking the form of a pillar. (Ashu Kumar, 2004) Code Example using System; namespace Encapsulation { class Square { private double length; //member variables private double width; public void Acceptdetails() { Console.WriteLine("Enter Length: "); length = Convert.ToDouble(Console.ReadLine()); Shashin Nishad

Length: 4. Width: 4. Area: 19.

1.3 Why OOP for this system?

 A strong, secure library management system can be developed with these OOP concepts.  Interfaces (a template for class definitions) play a major role in object oriented programming and they are very useful because they represent methods of class.  With collections it is easy to add or remove elements of a class.  Using constructors in the program helps to access objects of classes easily.  Using destructor in the program helps to close database connections, return network resources and recover the space allocated for the object lifeline  Instance variables and instance methods can be included in the solution which is to be developed for Library Management System.  Object oriented programming uses class diagrams which help to identify the type of relationship each class has and help to understand the structure of the system clearly and it also helps to reduce data redundancy in the system. Shashin Nishad

2 Task 2

2.1 Identify the classes from the scenario and list all the attributes

and methods of each class you have identified using UML

notation.

2.1.1 Class Abstraction Before designing the class diagram all the candidate classes were listed in order to select the eligible abstract classes for the diagram. The list of candidate classes- Member Visitor Books User Loans Reservation From the above list the selected classes were Member, user, visitor, books and loans. Member class represents all the details of Registered members therefore it was selected. User class represents user details and its methods. Visitor class represents all the details of Registered visitors therefore it was selected. Loan class is for storing all the details of loans made by members/visitors. Since member and visitor classes had similar attributes and methods they were designed to be inherited from one class called ‘Person’. The ‘Person’ class acts as the parent class to the member and visitor classes and these classes will inherit all the attributes and methods of the ‘Person’ class. ‘Reservation’ class was not selected because the issue dates, return dates and loan details are already depicted by the ‘Loans’ class and there is no need of duplicating data. Shashin Nishad