Java Programing
Java Programing
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.
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 one class (parent class) at the same time, but a class can have any number of subclasses. It helps to reuse, customize, and 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 then 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.
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.
Page 3
OOP Programming
Task 2 ER Diagram
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 etc.. are includes Supply This entity has the supply name, supply id,supply tell etc..
Patient
P_ID
FK
Name
Tell
Adders
Gender
Orders
Order_ID
FK
Order_Date
P_ID
Drug _ID
FK
Drugs
Drug_ID
FK
Drug_Name
Price
Supplier_ID Order ID
Supplier
Supplier_ID
Name
Address
Phone NO
Page 5
OOP Programming
Task 3 Class diagram
Page 6
OOP Programming
Task 4 Sequence diagram
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 the 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.
Page 8
OOP Programming
In the main menu we can choose system functions such as patient Information , Employee Information , Drug Information And sales Information . Patient Information : When we click this button we get the patents 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
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 .
Page 10
OOP Programming
Section B Special features provided by IDE Suggestion for coding
Debug points
Page 11
OOP Programming
Intelligence
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 considered 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 express the concept of these relationships: "Yes," which is technically known as "inheritance" and "This is technically known as" component ".
Page 13
OOP Programming
Task 7 How the OOP concepts are used in java Modularity The Java programming language provides many 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.
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 own conclusions. Test your code, and keep testing. Automated unit testing is very useful, especially the program or driver 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 about 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 next run the program analyzer.
Tharuka Silva HND/49/07 Page 15
OOP Programming
Task 8 Test No 4 Item Add button Clicked Event 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 8 Search Update Clicked Clicked when adding Find and display expected record Confirmation message saying that the new entry was saved Clicked when adding employee no. which already exists Clicked when adding employee no. which does not exist Clicked when editing Confirmation message record doe not exist. Can enter a new record Confirmation message saying that the new entry was edited Clicked when editingemployee no. which does not exist Error message record does not exist Error message record already exists
Page 16
OOP Programming
Clicked when deleting Confirmation message saying that the new entry was deleted Clicked when editing employee no which does not exist 9 10 Clear all Go to main menu 11 Clear clicked Clicked clicked All the textboxes will be cleared The current for will disappear and the main menu will appear All the textboxes will be cleared Error message record does not exist
Test Case Test Objectives Test Data Expected Results Actual Results Conclusion
01 To testing the user ID and password 123,123 Go to main menu Went to main menu Results are match to expected results.
Test Case Test Objectives Test Data Expected Results Actual Results Conclusion
02 From main menu to Sales information Clicking the sales information icon Go to Sales information Went to Sales information Results are match to expected results.
Page 17
OOP Programming
Test Case Test Objectives Test Data Expected Results Actual Results Conclusion 03 Exit Clicking the sales Exit icon Terminate the program Program was Terminated Results are match to expected results.
Test Case Test Objectives Test Data Expected Results Actual Results Conclusion
04 Search information Searching the information Get the search result Search result was came Results are match to expected results.
Test Case Test Objectives Test Data Expected Results Actual Results Conclusion
05 Add information Adding the information Add the entered data Add the data to data base Results are match to expected results.
Page 18
OOP Programming
Task 9
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 connected to the my sql
Page 20
OOP Programming
This messages comes when trying to delete information
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
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 informations, delete patient informations and search patient informations. and all so this interface shows all the patient informations 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
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 by id and name, and all so this interface shows all the employee information of the pharmacy
Page 24
OOP Programming
After clicking the Help on the main menu this will display and it will give all the actives done by buttons
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
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
Page 27
OOP Programming
Hayward Referencing
Page 28
OOP Programming
Gantt chart
Page 29