What is OOP?
Object Oriented Programming (OOP) is a software development technique
where a developer will create an abstraction (in code) of a real world object
or concept. The belief is that if you can create a high enough fidelity model
between the real world objects and the objects in your code, writing
applications to automate the usage and automation of those objects will be
easier. This approach has been mostly successful and is the most common
software development paradigm that you will see in building Line of Business
(LOB) applications.
When developing applications using OOP, you will define Classes that model
real world objects. In your application these classes will be instantiated into
Objects. In the course of the applications lifetime your code will call methods
on these objects and potentially pass them to other methods as arguments. The
interaction between classes is controlled be each classes public API, otherwise
known as the collection of public methods and properties on the class. As we
move into code samples in further posts you will see classes being created and
methods on them being tested.
The terms “class” and “object” are NOT interchangeable. A Class is a
definition of what an object should look like. It’s the blueprint you create by
writing the C# or VB.NET that has the class’s member variable and methods. An
Object is an instantiation of a Class. When you declare a variable of type class
and either accept an instantiated object or you create an object using the
“new” keyword, you get an Object based on the Class that was used to create the
object.
OOP has three major tenets; Encapsulation, Inheritance and Polymorphism
No comments:
Post a Comment