OOP Programming Task 1 Introduce oop concepts Object-oriented programming this is a technique used to create real-world entities around the program. OOPS programming model, program development around the objects and data rather than actions and logic. Oh, every real life objects properties and behaviors.
Objects and classes
Inheritance
Polymorphism
Encapsulation
Abstraction
Classes A class defines the properties and behavior (variables and methods) is shared by all objects. This is a blueprint to create an object.
Objects The object is the object-oriented programming language entity. The class itself has nothing to do but the real functionality through its object. The object is an instance of the class. Its attributes (variables) and behavior (methods) defined in the class.
Tharuka Silva HND/49/07
Page 1
OOP Programming Inheritance Inheritance allows a class (subclass) to obtain another class of properties and behaviors of (ultra). In Java, a class can inherit only o nly one class (parent class) at the same time, bu t a class can have an y number of subclasses. It helps to reuse, customize, an d strengthen the existing code. Therefore, it helps to write code and reduce development time. Java uses extend keyword to extend the class.
Polymorphism Polymorphism allows an interface will be used as a set of actions. A name, may be related to different functions. Polymorphism allows objects to accept a client (and th en the correct interpretation of requirements, such as selecting the appropriate method), the different requirements based on the current state of the runtime system response, did not disturb the user.
Tharuka Silva HND/49/07
Page 2
OOP Programming Encapsulation Package together a single entity and the process of data variables. This makes the function code security of data and from the outside world. Hidden in the data of the class, it is only through the method.
Tharuka Silva HND/49/07
Page 3
OOP Programming Task 2 ER Diagram
Tharuka Silva HND/49/07
Page 4
OOP Programming Assumptions
Patient This pharmacy has a lot of customs so they have to give a id so it is easy to search, in here the is the person s NIC because it is unique to every person
Physician This is the people who work in the pharmacy. in here all the necessary information about the works are includes
Order Before buying the drugs customs need to order the product
Drug In here all the drug information like drug id e tc.. are includes
Supply This entity has the supply name, supply id,supply tell etc..
Normalized relational schema
Patient
P_ID
Name
Tell
Adders
Gender
Order_Date
P_ID
Drug _ID
Drug_Name
Price
Supplier_ID Order ID
Name
Address
FK
Orders
Order_ID FK
FK
Drugs
Drug_ID
FK
Supplier
Supplier_ID
Tharuka Silva HND/49/07
Phone NO
Page 5
OOP Programming Task 3 Class diagram
Tharuka Silva HND/49/07
Page 6
OOP Programming Task 4 Sequence diagram
Tharuka Silva HND/49/07
Page 7
OOP Programming Task 5 Task5 Section A
Log In After entering the correct User name and the password, the librarian has to click this button. When this button is clicked, this security form will disappear and th e main menu will appear. Exit This button is used to exit from the system. When it is clicked, a confirmation message appears asking the librarian if he is sure about the command he has given.
Tharuka Silva HND/49/07
Page 8
OOP Programming
In the main menu we can choose system functions such as patient Information , Emplo yee Information , Drug Information And sales Information . Patient Information : When we click this button we get the patent’s information . In here we can add new patients and remove old patients information . Employee Information : When we click this button we can get the Employees Information , In here we can add information about employees and remove the old information . Drug Information : When we click this button we can get details about drug information . Here we can add information and remove information about drugs . Sales Information : When we click this button we can get information about the drug sales we have done . Help : when we click this button u will get the help menu
Tharuka Silva HND/49/07
Page 9
OOP Programming
Save . When we click this button the details we have insert is been saved . Clear : When we click this button the details we have insert is been cleared Back : When we click the Back button we go back to the sales Information Sub Menu .
Tharuka Silva HND/49/07
Page 10
OOP Programming Section B Special features provided by IDE Suggestion for coding
Debug points
Tharuka Silva HND/49/07
Page 11
OOP Programming Intelligence
Auto generated codes
Tharuka Silva HND/49/07
Page 12
OOP Programming Task 6 OOP Object relations IF and Else
While
An object-oriented system can be used as the system characteristics of the partner. Some object with some other objects to interact, or only a specific set of objects. Sometimes object con sidered as equivalent, even though there may be of them. That specific differences Instead, system designers may want to commonalities between the expression of apples and oranges. An oriented object system, there are two different mechanisms to ex press the concept of these relationships: "Yes," which is technically known as "inheritance" and "This is technically known as" component ".
Tharuka Silva HND/49/07
Page 13
OOP Programming
Task 7 How the OOP concepts are used in java Modularity The Java programming language provides man y features to support the construction of large projects, but can do more to reduce JAR hell and simplify application packaging. This talk will describe how the modular program can solve these problems, and how to design the functionality of the Java language and virtual machine can make the program more modular, while retaining compatibility with legacy code.
Tharuka Silva HND/49/07
Page 14
OOP Programming
Re-usability Java's reusable means that, once you write some code, you can use it again - if you write so that it can be reused.
Maintainability Programmers need to be precise. If you are sloppy and inconsistent space indent, name, or the access modifier of confidence in your logic is any more accurate. A of the framework, developers can sometimes help to avoid you do not have to reinvent the wheel every time, but a bad frame is infinitely better than no framework at all worse. Well-designed framework is very, very hard. Carefully consider this and draw their o wn conclusions. Test your code, and keep testing. Automated unit testing is very useful, especially the program or d river module from the command line. The other hand, trying to automate GUI testing is a noble goal, but is usually doomed to failure. Has a very small return, which requires a lot of effort. The production test is very "brittle". Keep the code simple and understanding. Source code, no one understands, if there is no file, no source code, a bug-ridden does not support third-party library is useful, think abo ut your reward structure. If you reward the length of their file systems analysts, programmers, lines of code written for them, day, they can invoice the number of consultants, and they hired the size of the team manager, then the collective would be powerless to reduce the size or development costs. Do not optimize too early. Unless you do the I / O or perform the same operation a million times or more, forgot to optimize it, until your nex t run the program analyzer. Tharuka Silva HND/49/07
Page 15
OOP Programming Task 8 Test No 4
Item Add button
Event Clicked
Expected Result Confirmation message helping the user to proceed in the addition process
5
Edit
Clicked
Confirmation message helping the user to proceed in the editing process
6
Delete
Clicked
Confirmation message helping the user to proceed in the deleting process
7
Search
Clicked
Find and display expected record
8
Update
Clicked when adding
Confirmation message saying that the new entry was saved
Clicked when adding –
Error message – record already
employee no. which
exists
already exists Clicked when adding –
Confirmation message – record
employee no. which
doe not exist. Can enter a new
does not exist
record
Clicked when editing
Confirmation message saying that the new entry was edited
Clicked when editing-
Error message – record does not
employee no. which
exist
does not exist
Tharuka Silva HND/49/07
Page 16
OOP Programming Clicked when deleting
Confirmation message saying that the new entry was deleted
Clicked when editing -
Error message – record does not
employee no which does
exist
not exist 9
Clear all
Clicked
All the textboxes will be cleared
10
Go to main
clicked
The current for will disappear
menu 11
Clear
and the main menu will appear clicked
All the textboxes will be cleared
Test Case
01
Test Objectives
To testing the user ID and password
Test Data
123,123
Expected Results
Go to main menu
Actual Results
Went to main menu
Conclusion
Results are match to expected results.
Test Case
02
Test Objectives
From main menu to Sales information
Test Data
Clicking the sales information icon
Expected Results
Go to Sales information
Actual Results
Went to Sales information
Conclusion
Results are match to expected results.
Tharuka Silva HND/49/07
Page 17
OOP Programming Test Case
03
Test Objectives
Exit
Test Data
Clicking the sales Exit icon
Expected Results
Terminate the program
Actual Results
Program was Terminated
Conclusion
Results are match to expected results.
Test Case
04
Test Objectives
Search information
Test Data
Searching the information
Expected Results
Get the search result
Actual Results
Search result was came
Conclusion
Results are match to expected results.
Test Case
05
Test Objectives
Add information
Test Data
Adding the information
Expected Results
Add the entered data
Actual Results
Add the data to data base
Conclusion
Results are match to expected results.
Tharuka Silva HND/49/07
Page 18
OOP Programming Task 9
Tharuka Silva HND/49/07
Page 19
OOP Programming Task 10
In this interface show how the system button are working and there functions
This error comes when the system is not conne cted to the my sql
Tharuka Silva HND/49/07
Page 20
OOP Programming This messages comes when trying to delete information
This message comes when we are trying to save information
Tharuka Silva HND/49/07
Page 21
OOP Programming Task 11 User manual This is where we have to enter the password and user name to continuer
This is main menu from here you have to select the task u need to do
Tharuka Silva HND/49/07
Page 22
OOP Programming
After clicking the patient information on the main menu this will display and from this we can enter patient in formations, edit patient information’s, delete patient information’s and search patient information’s. and all so this interface shows all the patient information’s of the pharmacy
After clicking the Sales information on the main menu this will display and from this we can enter Sales information, edit Sales information, delete Sales information and search Sales information by invoice id and all so this interface shows all the Sales information of the pharmacy
Tharuka Silva HND/49/07
Page 23
OOP Programming
After clicking the Drug information on the main menu this will display and from this we can enter Drug information, edit Drug information, delete Drug information and search Drug information by id and name, and all so this interface shows all the Drug information of the pharmacy
After clicking the employee information on the main menu this will display and from this we can enter employee information, edit employee information (when the details are change ), delete employee information and search employee information b y id and name, and all so this interface shows all the employee information of the pharmacy
Tharuka Silva HND/49/07
Page 24
OOP Programming
After clicking the Help on the main menu this will display and it will give a ll the actives done by buttons
Tharuka Silva HND/49/07
Page 25
OOP Programming Future Recommendation
In the future this can be converted in to wed basic system which will give more access to the owner of the pharmacy
The data base can be go to a higher version of My SQL from older one
This can be made a online store so the customers can order goods online
The login can be generated by a biometric screener so it is more secure then the password protection
More detail report can be generated
Tharuka Silva HND/49/07
Page 26
OOP Programming Conclusion Here, I have to do this document very carefully; other hand, I do a good running program on the allocation request. According to this problem, I made a successful system. In this assignment i had made a system for the "Medi friends pharmacy". Through scenarios, I made a comfortable system. In all the many problems I do this task during the period, in the face, but I'm trying to solve the whole problem and related to OOP concepts, I got a good idea. One last thing to mention is that I try to give a nice interface. But it is still a command interface and users prefer GUI-based point, and then click interface. If this is such an application, it will be more and more system attractive to users. In this softer ware it is very easy to understand and to any person, its very user-friendly and In this programs some buttons are not working
Tharuka Silva HND/49/07
Page 27
OOP Programming Hayward Referencing
Tharuka Silva HND/49/07
Page 28
OOP Programming Gantt chart
Tharuka Silva HND/49/07
Page 29