Critical Report on Coursework 2: Object-Oriented Programming in Java

Verified

Added on  2025/08/07

|9
|1005
|438
AI Summary
Desklib provides solved assignments and past papers to help students succeed.
Document Page
Coursework 2
Critical report
Student name:
Student ID:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Contents
Introduction......................................................................................................................................3
Utilization of concepts of OOPs......................................................................................................4
Inheritance:..................................................................................................................................4
Abstraction...................................................................................................................................4
Polymorphism..............................................................................................................................4
Design criteria..................................................................................................................................7
Conclusion.......................................................................................................................................8
References........................................................................................................................................9
Document Page
Introduction
This critical report will cover the assessment of the solution given in coursework 1 of this
assignment. The assessment will also cover the approach implemented in the solution and
perspective of using OOPs concepts in Java programming. To justify the given solution, the
report will include examples, samples of code and snapshots. The report will include the
overview of OOPs concepts which are polymorphism, abstraction and inheritance and their
significance in the given code solution. This is followed by the analysis of the design criteria, by
determining that the design criteria are fulfilled or not.
Document Page
Utilization of concepts of OOPs
Inheritance: This is a concept of OOPs in which the properties of a parent class is acquired by
the object of a child class. This feature of OOPs is used to reuse the fields and methods of the
parent class. This improved the reusability of code and reduced the complexity of it. Another
reason behind the use of this concept is method overriding in order to achieve runtime
polymorphism. The real-life example of inheritance is that the child inherits the characteristics
and behavior of parents (Vaidya, 2019). In inheritance, there are two classes, which are parent
class and child class. The child class inherits the features and properties of another class. This is
also known as derived class or subclass. The parent class is the class whose characteristics are
used by child class. This is also called base class or superclass ("Inheritance in Java -
GeeksforGeeks", 2019). In the given solution of coursework 1, this concept of inheritance is not
used properly as both the parent and child class get tightly coupled. Thus changes in class may
affect the functionality of others, so to avoid this, this concept is not used.
Abstraction: Abstraction is the concept of OOPs, which is used to show only the required
information to the user. This is helpful to determine the necessary characteristics to ignore the
irrelevant components. For example, a man who is driving the car only knows the use of
accelerators and breaks but does not know the actual working behind it. Encapsulation and
abstraction are both look similar but are different concepts. Abstraction is the process of detail
hiding whereas the abstraction is the process of information hiding. This is used in the code to
reduce complexity (Golan, 2014). This is also helpful in the elimination of data deduplication
and improves the code reusability. This is mainly required to enhance the application security
because only the important data is displayed to user.
Polymorphism: This is the feature of OOPs which enables to perform a task in multiple
different ways. In java, there can be two types of polymorphism that are run-time and compile-
time polymorphism (Panda, 2013). In java polymorphism can be achieved by method overriding
and overloading. For example, animal class has sound () function, then this function can be used
in different manners in child classes (Singh, 2019).
Figure 1 Polymorphism example in code
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Figure 2 Polymorphism example 2
The above-given screenshots of the code describe the use of polymorphism concept in the code.
By using override feature, in the given code toString() function is used to return different values
which show the use of polymorphism concept.
The program is also using the concept of error handling in the code, as it gives error if the user
enters the wrong input. For example, menu has 6 options that are numbered 1-6, if the user enters
0, a negative number or a value more than 6 then the program will show error.
Document Page
Figure 3 error handling the feature in code
Document Page
Design criteria
According to the requirement of the case study, the design criteria are fulfilled. The program is
meeting all the criteria and requirements and providing necessary functionalities. As per the
design criteria, the program is offering menu, booking an appointment, feature to cancel the
appointment, schedule of doctor, schedule of doctors between two given dates, feature to print
the details of booking and exit. Although the program met all the design criteria and providing
necessary functionalities, there are still areas where improvements can be done. The program did
not properly use the concepts of object-oriented programming such as inheritance,
polymorphism, and abstraction. Thus, the code is simple to understand but lengthy. Also the
code is not secure enough in absence of abstraction. But the implementation of error handling
concept makes it a little secure by avoiding errors in inputs. If the application is developed by
properly using the OOPs concepts like inheritance, polymorphism, and abstraction then the code
will become more secure. This way of implementing the code improves the visibility of code and
will minimize the code complexity (Vaidya, 2019).
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Conclusion
The report is a critical report which covered the overview of the OOPs concepts that are
polymorphism, abstraction, and inheritance. This also covered the importance and significance of
these concepts in code. These OOPs concepts are mainly responsible to increase the reusability,
flexibility, and security of the code. Although the program is meeting the design criteria of the
given case scenario, there are also areas where improvements can be done. The application code
is simple but lengthy; in order to avoid this, inheritance can be used. Also the application is not
secure enough; polymorphism can be used for the same. The OOPs concepts should be used to
make it more reusable and secure.
Document Page
References
Golan, E. (2014). Why Abstraction is Really Important - DZone Agile. Retrieved 28 August
2019, from https://dzone.com/articles/why-abstraction-really
Inheritance in Java - GeeksforGeeks. (2019). Retrieved 28 August 2019, from
https://www.geeksforgeeks.org/inheritance-in-java/
Panda, S. (2013). Quick Guide To Polymorphism In Java. Retrieved 28 August 2019, from
https://www.sitepoint.com/quick-guide-to-polymorphism-in-java/
Singh, C. (2019). Polymorphism in Java with example. Retrieved 28 August 2019, from
https://beginnersbook.com/2013/03/polymorphism-in-java/
Vaidya, N. (2019). Inheritance in Java | Object Oriented Programming Concepts | Edureka.
Retrieved 28 August 2019, from https://www.edureka.co/blog/inheritance-in-java/
chevron_up_icon
1 out of 9
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]