Object-oriented programming uses objects and classes to organize code and data. The key principles are encapsulation, inheritance, abstraction, and polymorphism. Encapsulation hides unnecessary details within classes and provides a clear interface. Inheritance allows classes to inherit and extend functionality from parent classes. Abstraction deals with objects based on important characteristics while ignoring details. Polymorphism allows working with different objects in the same way by defining abstract behavior implementations.
Encapsulation is one of the best concept of Object Oriented Programming. It is the base of programming . It also used by Java, .Net and Php.
Basically Encapsulation is used for abstraction of codes or you can say data binding.
Yevhen Kalinichenko, Senior JavaScript Developer
“Object oriented concepts in real projects”
- Abstraction. What is it and what abstraction gives us
- Inheritance. Why do we need inheritance? Composition
over inheritance.
- Encapsulation. Why it’s so important to hide
implementation. Breaking of encapsulation leads us to
maintenance hell
- Polymorphism. Working with interface but not with
concrete implementation
- Single responsibility. Why “classes” must adhere single
responsibility
- Open/Closed principle
- Related topics – cohesion, coupling, interfaces,
separation of responsibilities for each team member.
Encapsulation is one of the best concept of Object Oriented Programming. It is the base of programming . It also used by Java, .Net and Php.
Basically Encapsulation is used for abstraction of codes or you can say data binding.
Yevhen Kalinichenko, Senior JavaScript Developer
“Object oriented concepts in real projects”
- Abstraction. What is it and what abstraction gives us
- Inheritance. Why do we need inheritance? Composition
over inheritance.
- Encapsulation. Why it’s so important to hide
implementation. Breaking of encapsulation leads us to
maintenance hell
- Polymorphism. Working with interface but not with
concrete implementation
- Single responsibility. Why “classes” must adhere single
responsibility
- Open/Closed principle
- Related topics – cohesion, coupling, interfaces,
separation of responsibilities for each team member.
Pdf Covers-- Concept of OOPS, Introduction to Java, Java Features, History of Java, Naming of Java, Java version release, Structure of Java Program, Creating a Simple Java Program, Java Virtual Machine
Pdf Covers-- Concept of OOPS, Introduction to Java, Java Features, History of Java, Naming of Java, Java version release, Structure of Java Program, Creating a Simple Java Program, Java Virtual Machine
it describes the main concepts of object oriented programming
For more posts : http://comsciguide.blogspot.com/
For full playlist of Interview puzzles videos : https://www.youtube.com/playlist?list=PL3v9ipJOEEPfI4zt4ExamGJwndkvg0SFc
24 standard interview puzzles: https://www.youtube.com/playlist?list=PL3v9ipJOEEPefIF4nscYOobim1iRBJTjw
Aptitude training playlist link : https://www.youtube.com/playlist?list=PL3v9ipJOEEPfumKHa02HWjCfPvGQiPZiG
for C and C++ questions, that are asked in the interviews, go through the posts in the link : http://comsciguide.blogspot.com/
for more videos, my youtube channel : https://www.youtube.com/channel/UCvMy2V7gYW7VR2WgyvLj3-A
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Object
1. Object
WHY SHOULD I USE OBJECT ORIENTED?
WHAT IS THE OBJECT?
PRINCIPLE OF OBJECT ORIENTED
INHERITANCE
ENCAPSULATION
ABSTRACTION
POLYMORPHISM
2. Why should i Use Object oriented?
Code Reuse and Recycling
Encapsulation (part 1): Once an Object is created, knowledge of its
implementation is not necessary for its use.
Encapsulation (part 2): Objects have the ability to hide certain parts of
themselves from programmers.
Design Benefits
Software Maintenance
3. Why not?
Size: Object Oriented programs are much larger than other programs.
Effort: Object Oriented programs require a lot of work to create.
Speed: Object Oriented programs are slower than other programs.
5. How to find object?
▶ Everything that exists
▶ Understanding the objects properties or attributes.
▶ Understanding it's uses, behaviors or actions (methods).
▶ Anything written on paper
▶ In design a DB use Entity discovering method
6. Principle Of object oriented
Major Elements
▶ Encapsulation: We will learn to hide unnecessary details in our
classes and provide a clear and simple interface for working with
them.
▶ Inheritance: We will explain how class hierarchies improve code
readability and enable the reuse of functionality.
▶ Abstraction: We will learn how to work through abstractions: to deal
with objects considering their important characteristics and ignore
all other details.
▶ Polymorphism: We will explain how to work in the same manner with
different objects, which define a specific implementation of some
abstract behavior.
7. Principle Of object oriented
Minor Elements
▶ Typing: According to the theories of abstract data type, a type is a
characterization of a set of elements
▶ Concurrency: In an object-oriented environment, there are active
and inactive objects.
▶ Persistence: An object occupies a memory space and exists for a
particular period of time.
8. Inheritance
▶ Inheritance is one of the fundamental attributes of object-oriented
programming. It allows you to define a child class that reuses
(inherits), extends, or modifies the behavior of a parent class.
▶ C# is (single inheritance), unlike C++ which supports inheriting from
multiple classes (multiple inheritance).
9. ▶ /// <summary>Felidae is latin for "cats"</summary>
▶ public class Felidae
▶ {
▶ private bool male;
▶ // This constructor calls another constructor
▶ public Felidae() : this(true)
▶ { }
▶ // This is the constructor that is inherited
▶ public Felidae(bool male)
▶ {
▶ this.male = male;
▶ }
▶ public bool Male
▶ {
▶ get { return male; }
▶ set { this.male = value; }
▶ }
▶ }
10. ▶ public class Lion : Felidae
▶ {
▶ private int weight;
▶ // Keyword "base" will be explained in the next paragraph
▶ public Lion(bool male, int weight) : base(male)
▶ {
▶ this.weight = weight;
▶ }
▶ public int Weight
▶ {
▶ get { return weight; }
▶ set { this.weight = value; }
▶ }
▶ }
11. Access Modifiers of Class Members
and Inheritance
▶ All of its public, protected and protected internal members
(methods, properties, etc.) are visible to the inheriting class.
▶ All of its private methods, properties and member-variables are not
visible to the inheriting class.
▶ All of its internal members are visible to the inheriting class, only if the
base class and the inheriting class are in the same assembly.
12. Virtual Methods:
class BC
{
public virtual void Display()
{
System.Console.WriteLine("BC::Display");
}
}
class DC : BC
{
public override void Display()
{
System.Console.WriteLine("DC::Display");
}
}
class Demo
{
public static void Main()
{
BC b;
b = new BC();
b.Display();
b = new DC();
b.Display();
}
}
BC::Display
DC::Display
13. abstraction
▶ Abstraction means working with something we know how to use
without knowing how it works internally. A good example is a
television set.
▶ Abstraction allows us to do something very important – define an
interface for our applications, i.e. to define all tasks the program is
capable to execute and their respective input and output data.
15. Interfaces:
▶ In the C# language the interface is a definition of a role (a group of abstract actions).
▶ It defines what sort of behavior a certain object must exhibit, without specifying how
this behavior should be implemented.
▶ An interface can only declare methods and constants.
▶ A method is identified by its signature. The return type is not a part of it. If two
methods' only difference is the return type (as in the case when a class inherits
another), then it cannot be unequivocally decided which method must be
executed.
16. public interface IReproducible<T> where T : Felidae
{
T[] Reproduce(T mate);
}
public class Lion : Felidae, IReproducible<Lion>
{
Lion[] Reproducible<Lion>.Reproduce(Lion mate)
{
return new Lion[] { new Lion(true, 12), new Lion(false, 10) };
}
}
17. When Should We Use Abstraction and Interfaces?
The answer to this question is: always when we want to achieve
abstraction of data or actions.
Working through interfaces is common and a highly recommended
practice – one of the basic rules for writing high-quality code.
It is always a good idea to use interfaces when functionality is exposed
to another component.
18. ENCAPSULATION
It is also called "information hiding". An object has to provide its users only
with the essential information for manipulation, without the internal details.
Therefore parts of the properties and methods remain hidden to her.
19. public class Felidae
{
public virtual void Walk()
{
}
}
public class Lion : Felidae, IReproducible<Lion>
{
private Paw frontLeft;
private Paw frontRight;
private Paw bottomLeft;
private Paw bottomRight;
private void MovePaw(Paw paw)
{
}
public override void Walk()
{
this.MovePaw(frontLeft);
this.MovePaw(frontRight);
this.MovePaw(bottomLeft);
this.MovePaw(bottomRight);
}
}
20. POLYMORPHISM
Polymorphism allows treating objects of a derived class as objects of
its base class.
Polymorphism can bear strong resemblance to abstraction, but it is
mostly related to overriding methods in derived classes, in order to
change their original behavior inherited from the base class.
21. Abstract Classes
What happens if we want to specify that the
class Felidae is incomplete and only its successors can have
instances?
This is accomplished by putting the keyword abstract before the name
of the class and indicates that the class is not ready to be
instantiated.
Abstract classes, as well as interfaces, cannot be instantiated.
22. public abstract class Felidae
{
protected void Hide()
{
}
protected void Run()
{
}
public abstract bool CatchPrey(object prey);
}
public class Lion : Felidae, IReproducible<Lion>
{
protected void Ambush()
{
}
public override bool CatchPrey(object prey)
{
base.Hide();
this.Ambush();
base.Run();
// …
return false;
}
}