1) Polymorphism simply means multiple forms in everyday terms. However when described in terms of object-oriented programming (OOP), it is the feature of OOP that allows specific routines to use...

1 answer below »


1)



Polymorphismsimply means multiple forms in everyday terms. However when described in terms of object-oriented programming (OOP), it is the feature of OOP that allows specific routines to use different variable types at varying times. It is also the ability to present same interface for many different data types (“DevOps and Security Glossary Terms”, n.d). An example of polymorphism can be illustrated with a woman with several characteristics such as: A mother, a grandmother, a singer, and employee (“Polymorphism”, n.d).



Encapsulationdepicts the procedure of wrapping or grouping data and functions to perform operations on the data into the single unit called a class. It means hiding internal state and requiring all relation to be actualized by means of an object’s method (“Encapsulation in Object Oriented Programming OOP”. n.d) A school bag presents an example of encapsulation since within it are contained, books, pencils, pens, rulers and a mathematical set (“Encapsulation in Java | Realtime Example, Advantage”, n.d).


A Unified Modelling Language (UML) class diagram depicts a static structure diagram that expresses a system structure by making a representation of the system’s classes, operations, their attributes and how objects are related. Put in a much simpler way, UML class diagrams are graphical tools or notations used to envision and build object-oriented systems (Kondratowicz, 2022).


UML class diagrams provide the followingutility: The analyses and design of an application’s static view. Class diagrams help to show association relating to every instance in the static view and to describe functions performed by the system. Software construction using object-oriented languages is achieved using UML class diagrams (“UML class diagram”, n.d).


UML class diagrams present the followingbenefits: Notwithstanding the complexity of data and classes involved, class diagrams help in accurate representation of data models. The needs and requirements of a system can be visually represented. Class diagrams help in decision making with respect to the implementation procedures that best suits the system. With class diagrams, simpler overview and detailed system schematics is provided (Kondratowicz, 2022).


In his work, Frosch-Wilke (2003) sighted the following as the some of thechallengesassociated with using UML class diagrams: Identification of classes, identification of associations, user of general/specific relationships, avoidance of redundant associations and specification of multiplicities for associations (p. 180).




References


DevOps and Security Glossary Terms.(n.d). Sumo Logic.https://www.sumologic.com/glossary/polymorphism/


Encapsulation in Java | Realtime Example, Advantage. (n.d) Scientech | Easy.com.https://www.scientecheasy.com/2020/07/encapsulation-in-java.html/#:~:text=School%20bag%20is%20one%20of,have%20no%20control%20over%20it.


Encapsulation in Object Oriented Programming OOP. (n.d). TopperSkills.https://www.topperskills.com/tutorials/oop/object-oriented-programming-encapsulation-concepts.html




2)



Polymorphism


Polymorphism means "many forms", and it occurs when we have many classes that are related to each other by inheritance which allow classes to inherit attributes and methods from another class. This method is therefore what polymorphism uses to perform its different tasks that enables objects to have having different internal structures to share some external interface. (Swain, 2010) Polymorphism is an OOP concept that can be categorized into two namely,


Static or compile time polymorphism which is arrived at through method overloading in which several methods belonging to the same class and name (are bonded or compiled together) but having different types, order, or number of parameters. (Panda, 2013)


Dynamic or runtime polymorphism is one arrived by assigning object from a subclass to a superclass reference in a method that overrides but does not erase the subclass object. This is because at process runtime, if the overridden reference of the superclass is called, the subclass version of the superclass method will also be called.



Explain and provide an example of encapsulation. Do not use the same examples featured in the learning materials.


Unlike polymorphism, encapsulation is an OOP construct that center on class exclusivity. It creates parallel classes within a system whose variables or data is hidden from any other class and can be accessed only through any member function of its own class. It is therefore a process of wrapping code or data and their behavior together into a single unit or class and making them private through data hiding declaration.


These variables will be visible within the class only. This is basically what data hiding is wherein we hide the data of a class from outside world, so that other classes cannot change/access these data directly.


A good example of this is a student school bag that consist of so many items that makes schooling and studying easy on the student. Or the mechanics equipment box that contains all sort of different equipment for different mechanic works. These can be represented also in the world of computer programming where there are various stages of code writing.


Another example of encapsulation is our course with the class title of ITCO620. Considering its contents, the course will not be complete without going through its different course units that may be related but are studied separately in different class exercises.





What is the utility, benefits, and challenges of creating and using UML Class Diagrams? Who creates them and who uses them?


UML is an intensive software modelling language that focuses on both conceptual and physical representation of a system. In its modelling drive, UML does not recommend what model to create and the time to create them, rather it concentrates on how to arrive at well-formed models. (Swain, pg. 24) It is therefore, an advisory modelling language that specifies its advice along what requirements to fulfill in software language modelling towards code writing. It facilitates visualization, specification, construction, and documentation (Swain, pg. 24-25) of all conceptual and physical representation in a modelling language to arrive at a well-defined process of modelling.


UML as a language used and created by software developers and it consists of graphical symbols that may be misrepresented if not accompanied by notations. These notations make each symbol a well-defined semantic that can be understood unambiguously by other developer even at the post-original developer time and operations.


On a general note, UML is a modelling language that represents things (structural, behavioral, grouping, and annotation things), relationships (dependency, association, generalization, and realization), diagrams (use case, class, object, sequence, collaboration/interaction, state chart, activity, component, and deployment diagrams), UML software architecture and its interlocking views (design, implementation, use case, process, and deployment views), and software development life cycle (Swain, pg. 26-35).




References


Swain, G. (2010) Object-Oriented analysis and design through unified modelling language. University Science Press New Delhi.


Panda, S. (2013) Quick Guide to Polymorphism in Java Accessed fromhttps://www.sitepoint.com/quick-guide-to-polymorphism-in-java/
on 06/08/2022


Encapsulation in Java with real-time Examplehttps://www.refreshjava.com/java/encapsulation-in-java





3)



  1. Explain and provide an example of polymorphism. Do not use the same examples featured in the learning materials.


Polymorphism means many types. Using methods like overloading` known as static and method overriding also known as dynamic is made possible because of Polymorphism.


There are two types of polymorphism.


Dynamic is also known as run time. For methods on different types of objects uses the same interface. When the application is running run-time changes form.


Example


Types of objects like cooking meatloaf.


Oven


Slow cooker


Pressure cooker


These are different ways of cooking meatloaf with the same result.


Static also known as Compile-time is a key power of OOP. Multiple methods with the same name but different parameters. Method overloading. When the compilation is running compile-time changes form. The binding which can be resolved at compile time by the compiler is known as static or early binding. The binding of all the static, private, and final methods is done at compile time (Java, 2022).


Example


Two classes car and Chevrolet. The Chevrolet class extends the car class. Both classes have the same method and that makes them static.



  1. Explain and provide an example of encapsulation. Do not use the same examples featured in the learning materials.


Testing Elements of an object are contained. Some of the components of the object are restricted. Have a method of request because the control access is hidden. Black box testing is closing off the inside working. It only shows the input and output.


Example


Class customers and class customers both have names and phones the classes can hide certain information while having other information public. It can also have information read-only or write-only.



  1. What are the utility, benefits, and challenges of creating and using UML Class Diagrams? Who creates them and who uses them?


UML stands for Unified Modeling Language which is a standardized notation that is used in diagrams. It is to visualize Object-Oriented systems.


UML utilities


User-mode Linux is a port of the Linux kernel to its own system call interface. It provides a kind of virtual machine, which runs Linux as a user process under another Linux kernel. This is useful for kernel development, sandboxing, jailing, experimentation, and many other things.


This package contains userspace utilities for use with User-mode Linux, including uml_mconsole, uml_moo, uml_switch, uml_net and tunctl((20070815.4-1), n.d).


Benefits


Codes are readable to programmers. Can be reusable. UML is flexible.


Disadvantage


Time-consuming, and managing it takes time.


References


(20070815.4-1), P. u.-u. (n.d).Package: uml-utilities (20070815.4-1). Retrieved from Debian: packages.debian.org


Java, S. v. (2022, January 7).Static vs Dynamic Binding in Java. Retrieved from Geeks for Geeks: www.geeksforgeeks.org



4)



Explain and provide an example of polymorphism. Do not use the same examples featured in the learning materials.


Polymorphism is an objected oriented programming concept that refers to ability of a function to take on multiple forms. This programming language feature allows software developers to program in general rather than in the specific. When you send a message it can be displayed in multiple forms.


Example: An example of polymorphism can be placing a person in a non stressful environment and then placing them in a stressful environment. They will indeed act with different behaviors however, you are still dealing with the same person.





Explain and provide an example of encapsulation. Do not use the same examples featured in the learning materials. a


In objected oriented programming encapsulation is used to hide the internal working of the representation and also it classifies everything together so it works as one unit. This process is know as bundling as well when you wrap types of familiar programming in together.


Example: An example of encapsulation is logging into Facebook, instagram, email, or your bank accounts. You know and understand how to do it however, you have no clue what is going on in the background that is allow the processes to happen.





What is the utility, benefits, and challenges of creating and using UML Class Diagrams? Who creates them and who uses them?


A unified modeling language is the foundation that showcases a systems structure, operations, and similarities amongst the included languages. Unified Modeling Languages are widely used because they can be linked directly with objected oriented programming. Software developers actually can create UML diagrams and we can be the users of the programs. Before you write a research paper you can use a UML class diagrams to get yourself started.





https://www.geeksforgeeks.org/polymorphism-in-c/



https://stackify.com/oop-concept-for-beginners-what-is-encapsulation/



https://tallyfy.com/uml-diagram/

Answered Same DayJun 11, 2022

Answer To: 1) Polymorphism simply means multiple forms in everyday terms. However when described in terms of...

Aditi answered on Jun 11 2022
89 Votes
ASSIGNMENT
1. Explain and provide an example of polymorphism?
When something has polymorphism, it ha
s the capacity to take on a variety of different appearances.
Java supports two distinct kinds of polymorphism: compile-time polymorphism and runtime polymorphism. We can achieve polymorphism by overloading and overriding methods.
· Objects in Java that can pass more than one IS-A test are referred to as polymorphic.
· An operation may exhibit different behavior in different instances.
Reusing code, i.e., classes that have already been written, tested, and implemented, is a huge benefit for programmers. It is a huge time saver. Various data types can be stored in a single variable. The code is simple to debug.
E.g.: Human behavior. Humans, for example, exhibit a wide range of behaviors. It's possible for one person to exhibit a variety of behaviors. Among other things, a person can be an employee in the workplace, a consumer in a shopping mall, a bus/train passenger, a student in school, and a son at...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here