object oriented programming concepts
four main Object Oriented Programming (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 simply a representation of a type of object. It is the blueprint, or plan, or template, that describes the details of an object.
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 SOA?
A service-oriented architecture is essentially a collection of services. These services communicate with each other. The communication can involve either simple data passing or it could involve two or more services coordinating some activity.
What is Abstraction
Abstraction is an emphasis on the idea, qualities and properties rather than the particulars (a suppression of detail).
Structural Patterns
Adapter Match interfaces of different classes Bridge Separates an object's interface from its implementation Composite A tree structure of simple and composite objects Decorator Add responsibilities to objects dynamically Facade A single class that represents an entire subsystem Flyweight A fine-grained instance used for efficient sharing Proxy An object representing another object
What is the Business Logic Layer?
As a general advice when you define business entities, you must decide how to map the data in your tables to correctly defined business entities. The business entities should meaningfully define considering various types of requirements and functioning of your system.
What is Association?
Association is a (*a*) relationship between two classes. It allows one object instance to cause another to perform an action on its behalf.
DIP - The Dependency Inversion Principle
Depend on abstractions, not on concretions
LSP - The Liskov Substitution Principle
Derived classes must be substitutable for their base classes
What is Generalization?
Generalization is the broadening of application to encompass a larger domain of objects of the same or different type.
What is an Interface?
Interface separates the implementation and defines the structure
ISP - The Interface Segregation Principle
Make fine grained interfaces that are client specific
What is Method Overloading?
Method overloading is the ability to define several methods all with the same name.
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 means the ability to request that the same operations be performed by a wide range of different types of things.
What are the Three Tiers?
Presentation Tier or Web Server: User Interface, displaying/ accepting data/ input to/ from the user Application Logic/ Business Logic/ Transaction Tier or Application Server: Data validation, acceptability check before being added to the database and all other business/ application specific operations Data Tier or Database server: Simple reading and writing method to database or any other storage, connection, command, stored procedures etc
OCP - The Open Closed Principle
Should be able to extend any classes' behaviors, without modifying the classes
What is Gang of Four (GoF) Design Patterns?
The Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral.
hat is MVC architecture?
The Model-View-Controller (MVC) architecture separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes.
What is two-tier architecture?
The two-tier architecture is refers to client/ server architectures as well, the term client/ server was first used in the 1980s in reference to personal computers (PCs) on a network.
What is OOP?
"Object-oriented programming (OOP) is a programming paradigm using ""objects"" - data structures consisting of data fields and methods together with their interactions - to design applications and computer programs. There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation. Other parts include data abstraction, messaging and modularity."
SRP - The Single Responsibility Principle
A class should have one, and only one, reason to change.
Creational Patterns
Abstract Factory Creates an instance of several families of classes Builder Separates object construction from its representation Factory Method Creates an instance of several derived classes Prototype A fully initialized instance to be copied or cloned Singleton A class of which only a single instance can exist
What is an Object?
An object can be considered a "thing" that can perform a set of related activities. The set of activities that the object performs defines the object's behavior.
Behavioral Patterns
Chain of Resp. A way of passing a request between a chain of objects Command Encapsulate a command request as an object Interpreter A way to include language elements in a program Iterator Sequentially access the elements of a collection Mediator Defines simplified communication between classes Memento Capture and restore an object's internal state Observer A way of notifying change to a number of classes State Alter an object's behavior when its state changes Strategy Encapsulates an algorithm inside a class Template Method Defer the exact steps of an algorithm to a subclass Visitor Defines a new operation to a class without change
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 Inheritance?
The ability of a new class to be created, from an existing class by extending it, is called inheritance.
What is the Data Access Layer?
The data access layer (DAL), which is a key part of every n-tier system, is mainly consist of a simple set of code that does basic interactions with the database or any other storage device.
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.
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 three-tier architecture?
Three-tier is a client-server architecture in which the user interface, functional process logic, data storage and data access are developed and maintained as independent modules, some time on separate platforms.
Association
is a *has-a* relationship between two classes where there is no particular ownership in place. It is just the connectivity between the two classes.
Composition
is a strong type of Association with full ownership. This is strong compared to the weak Aggregation. For a Composition relationship, we use the term *owns* to imply a strong *has-a* relationship.
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.