OOP
What are the techniques classes can use to link with each other?
1. Association 2. Aggregation 3. Composition
What are the four main OOP Concepts?
1. Encapsulation 2. Abstraction 3. Inheritance 4. Polymorphism
What is a Use Case?
A Use Case is a thing an actor perceives from the system. A Use Case maps actors with functions. Importantly, the actors need not be people. As an example, a system can perform the role of an actor, when it communicate with another system.
What is a Class?
A class is kind of a container or capsule or a cell, which encapsulates a set of methods, attribute and properties to provide its intended functionalities to other classes.
What is a Sequence Diagram?
A sequence diagrams model the flow of logic within a system in a visual manner, it enable both to document and validate your logic, and are used for both analysis and design purposes.
What is an Abstract class?
Abstract classes, which declared with the abstract keyword, cannot be instantiated. It can only be used as a super-class for other classes that extend the abstract class
What is Abstraction?
Abstraction is an emphasis on the idea, qualities and properties rather than the particulars (a suppression of detail). The importance of abstraction is derived from its ability to hide irrelevant details and from the use of names to reference objects.
What is Aggregation?
Aggregation is a weak type of Association with partial ownership. For an Aggregation relationship, we use the term *uses* to imply a weak *has-a* relationship.
What is Association?
Association is a (*has a*) relationship between two classes. It allows one object instance to cause another to perform an action on its behalf. Association is the more general term that define the relationship between two classes.
What is a Class Diagram?
Class diagrams are widely used to describe the types of objects in a system and their relationships. Class diagrams model class structure and contents using design elements such as classes, packages and objects.
What is Composition?
Composition is a strong type of Association with full ownership. For a Composition relationship, we use the term *owns* to imply a strong *has-a* relationship.
What is Method Overloading?
Method overloading is the ability to define several methods all with the same name.
What is Method Overriding?
Method overriding is a language feature that allows a subclass to override a specific implementation of a method that is already provided by one of its super-classes.
What is a Package Diagram?
Package diagrams are used to reflect the organization of packages and their elements. When used to represent class elements, package diagrams provide a visualization of the name-spaces.
What is Polymorphism?
Polymorphisms is a generic term that means 'many shapes'. More precisely Polymorphisms means the ability to request that the same operations be performed by a wide range of different types of things.
What is an Interface?
The Interface separates the implementation and defines the structure, and this concept is very useful in cases where you need the implementation to be interchangeable
What is Inheritance?
The ability of a new class to be created, from an existing class by extending it
What are Implicit and Explicit Interface Implementations?
The concept of implicit and explicit implementation provide safe way to implement methods of multiple interfaces by hiding, exposing or preserving identities of each of interface methods, even when the method signatures are the same.
What is Encapsulation?
The encapsulation is the inclusion-within a program object-of all the resources needed for the object to function, basically, the methods and the data. In OOP encapsulation is mainly achieved by creating classes.
What is Operator Overloading?
The operator overloading (less commonly known as ad-hoc polymorphisms) is a specific case of polymorphisms in which some or all of operators like +, - or == are treated as polymorphic functions and as such have different behaviors depending on the types of its arguments.
What is the difference between a Class and an Interface?
When a class implements an interface, an object of such class can be encapsulated inside an interface.
What is the difference between an Interface and an Abstract class?
o Interface definition begins with a keyword interface so it is of type interface o Abstract classes are declared with the abstract keyword so it is of type class o Interface has no implementation, but they have to be implemented. o Abstract class's methods can have their own default implementations and they may be extended. The Abstract class's methods could run independant of the inherting class. o Interfaces can only have method declaration (implicitly public and abstract) and properties (implicitly public static) o Abstract class's methods can't have implementation only when declared abstract. o Interface can inherit more than one interfaces o Abstract class can implement more than one interfaces, but can inherit only one class o Abstract class must override all abstract method and may override virtual methods o Interface can be used when the implementation is changing o Abstract class can be used to provide some default behavior for a base class. o Interface makes implementation interchangeable o Interface increase security by hiding the implementation o Abstract class can be used when implementing framework o Abstract classes are an excellent way to create planned inheritance hierarchies and also to use as non-leaf classes in class hierarchies.