Object-oriented programming (OOP) is a paradigm that splits programs into objects that contain both data and functions. Classes define the attributes and behaviors of objects. Objects are instances of classes that encapsulate their state and behavior. Key concepts of OOP include inheritance, abstraction, polymorphism, and encapsulation.
This is a presentation I did for the Cedar Rapids .NET User Group (CRineta.org). It was intended to present object oriented concepts and their application in .NET and C#.
This Powerpoint presentation covers following topics of C Plus Plus:
Features of OOP
Classes in C++
Objects & Creating the Objects
Constructors & Destructors
Friend Functions & Classes
Static data members & functions
This is a presentation I did for the Cedar Rapids .NET User Group (CRineta.org). It was intended to present object oriented concepts and their application in .NET and C#.
This Powerpoint presentation covers following topics of C Plus Plus:
Features of OOP
Classes in C++
Objects & Creating the Objects
Constructors & Destructors
Friend Functions & Classes
Static data members & functions
Object oriented programming by timehubzone.com.
To understand the object-oriented features and how best to use them, it is helpful to understand the key concepts of object-oriented programming. This section is a brief introduction to object-oriented programming. It also compares these concepts with features of procedural programming used to accomplish the same goals
https://www.timehubzone.com/worldclock
The timehubzone.com is a web service that transforms, otherwise tricky, tasks like your assistant as you go and makes travel easy on tour, travel, international meeting into an intuitive, super-quick and painless experience.
https://www.timehubzone.com/holidays
To better understand the behavior of servlets, let’s take a look at the life cycle of servlets.
A servlet is basically a small Java program that runs within a Web server. It can receive requests from clients and return responses. The whole life cycle of a servlet breaks up into 3 phases:
• Initialization: A servlet is first loaded and initialized usually when it is requested by the corresponding clients. Some websites allow the users to load and initialize servlets when the server is started up so that the first request will get responded more quickly.
• Service: After initialization, the servlets serve clients on request, implementing the ap- plication logic of the web application they belong to.
• Destruction: When all pending requests are processed and the servlets have been idle for a specific amount of time, they may be destroyed by the server and release all the resources they occupy.
More specifically, the behavior of a servlet is described in javax.servlet.Servlet interface, in which the following methods are defined:
• public void init(ServletConfig config) throws ServletException
This method is called once when the servlet is loaded into the servlet engine, before the servlet is asked to process its first request.
The init method has a ServletConfig parameter. The servlet can read its initialization arguments through the ServletConfig object. How the initialization arguments are set is servlet engine dependent but they are usually defined in a configuration file.
A typical example of an initialization argument is a database identifier. A servlet can read this argument from the ServletConfig at initialization and then use it later to open a connection to the database during processing of a request:
private String databaseURL;
public void init(ServletConfig config) throws ServletException { super.init(config);
databaseURL = config.getInitParameter("database");
}
• public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException
This method is called to process a request. It can be called zero, one or many times until the servlet is unloaded.
Once a servlet is loaded, it remains in the server’s memory as a single object instance. Thereafter, the server invokes the servlet to handle a request using a simple, lightweight method invocation. Unlike with CGI, there’s no process to spawn or interpreter to invoke, so the servlet can begin handling the request almost immediately. Multiple, concurrent requests are handled by separate threads, so servlets are highly scalable.
Servlets are naturally enduring objects. Because a servlet stays in the server’s memory as a single object instance, it automatically maintains its state and can hold on to external resources, such as database connections, that may otherwise take several seconds to establish. The following servlet presents information about how many times it has been accessed:
To better understand the behavior of servlets, let’s take a lo
Object oriented programming by timehubzone.com.
To understand the object-oriented features and how best to use them, it is helpful to understand the key concepts of object-oriented programming. This section is a brief introduction to object-oriented programming. It also compares these concepts with features of procedural programming used to accomplish the same goals
https://www.timehubzone.com/worldclock
The timehubzone.com is a web service that transforms, otherwise tricky, tasks like your assistant as you go and makes travel easy on tour, travel, international meeting into an intuitive, super-quick and painless experience.
https://www.timehubzone.com/holidays
To better understand the behavior of servlets, let’s take a look at the life cycle of servlets.
A servlet is basically a small Java program that runs within a Web server. It can receive requests from clients and return responses. The whole life cycle of a servlet breaks up into 3 phases:
• Initialization: A servlet is first loaded and initialized usually when it is requested by the corresponding clients. Some websites allow the users to load and initialize servlets when the server is started up so that the first request will get responded more quickly.
• Service: After initialization, the servlets serve clients on request, implementing the ap- plication logic of the web application they belong to.
• Destruction: When all pending requests are processed and the servlets have been idle for a specific amount of time, they may be destroyed by the server and release all the resources they occupy.
More specifically, the behavior of a servlet is described in javax.servlet.Servlet interface, in which the following methods are defined:
• public void init(ServletConfig config) throws ServletException
This method is called once when the servlet is loaded into the servlet engine, before the servlet is asked to process its first request.
The init method has a ServletConfig parameter. The servlet can read its initialization arguments through the ServletConfig object. How the initialization arguments are set is servlet engine dependent but they are usually defined in a configuration file.
A typical example of an initialization argument is a database identifier. A servlet can read this argument from the ServletConfig at initialization and then use it later to open a connection to the database during processing of a request:
private String databaseURL;
public void init(ServletConfig config) throws ServletException { super.init(config);
databaseURL = config.getInitParameter("database");
}
• public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException
This method is called to process a request. It can be called zero, one or many times until the servlet is unloaded.
Once a servlet is loaded, it remains in the server’s memory as a single object instance. Thereafter, the server invokes the servlet to handle a request using a simple, lightweight method invocation. Unlike with CGI, there’s no process to spawn or interpreter to invoke, so the servlet can begin handling the request almost immediately. Multiple, concurrent requests are handled by separate threads, so servlets are highly scalable.
Servlets are naturally enduring objects. Because a servlet stays in the server’s memory as a single object instance, it automatically maintains its state and can hold on to external resources, such as database connections, that may otherwise take several seconds to establish. The following servlet presents information about how many times it has been accessed:
To better understand the behavior of servlets, let’s take a lo
Want to move your career forward? Looking to build your leadership skills while helping others learn, grow, and improve their skills? Seeking someone who can guide you in achieving these goals?
You can accomplish this through a mentoring partnership. Learn more about the PMISSC Mentoring Program, where you’ll discover the incredible benefits of becoming a mentor or mentee. This program is designed to foster professional growth, enhance skills, and build a strong network within the project management community. Whether you're looking to share your expertise or seeking guidance to advance your career, the PMI Mentoring Program offers valuable opportunities for personal and professional development.
Watch this to learn:
* Overview of the PMISSC Mentoring Program: Mission, vision, and objectives.
* Benefits for Volunteer Mentors: Professional development, networking, personal satisfaction, and recognition.
* Advantages for Mentees: Career advancement, skill development, networking, and confidence building.
* Program Structure and Expectations: Mentor-mentee matching process, program phases, and time commitment.
* Success Stories and Testimonials: Inspiring examples from past participants.
* How to Get Involved: Steps to participate and resources available for support throughout the program.
Learn how you can make a difference in the project management community and take the next step in your professional journey.
About Hector Del Castillo
Hector is VP of Professional Development at the PMI Silver Spring Chapter, and CEO of Bold PM. He's a mid-market growth product executive and changemaker. He works with mid-market product-driven software executives to solve their biggest growth problems. He scales product growth, optimizes ops and builds loyal customers. He has reduced customer churn 33%, and boosted sales 47% for clients. He makes a significant impact by building and launching world-changing AI-powered products. If you're looking for an engaging and inspiring speaker to spark creativity and innovation within your organization, set up an appointment to discuss your specific needs and identify a suitable topic to inspire your audience at your next corporate conference, symposium, executive summit, or planning retreat.
About PMI Silver Spring Chapter
We are a branch of the Project Management Institute. We offer a platform for project management professionals in Silver Spring, MD, and the DC/Baltimore metro area. Monthly meetings facilitate networking, knowledge sharing, and professional development. For event details, visit pmissc.org.
2. Object-Oriented Programming (OOP) is a
software development paradigm that
suggests developers to split a program in
building blocks known as objects.
The OOP paradigm allows developers to
define the object's data, functions, and its
relationship with other objects.
3. Code Reusability
Enables to model real world object
Easy Modification
Easy Maintenance
More Flexible
4. Defines an Abstract thing of a thing (i.e.
Object)
Explaining its Behavior
A user-defined data structure that groups
properties and methods.
Class doesn’t occupies memory.
Class is a definition
Abstract classes are classes that can have no
instances
5. A Single entity Which holds Data and Method.
It’s Structure.
Should be understandable by a non-
Programmer
DOG
(Class)
Color, Shape
(Characteristic)
Bark, Pee, Run
(Behaviors)
Members
Abstract characteristics
of a thing
Fields - _Color
Properties - Color
Fields - _Color
Properties - Color
6. Specify Class Name
Declare Data members
Declare Methods
Define the Processing
7. Program them in the following order:
Namespace: The namespace is a keyword that
defines a distinctive name or last name for the
class. A namespace categorizes and organizes the
library (assembly) where the class belongs and
avoids collisions with classes that share the same
name.
Class declaration: Line of code where the class
name and type are defined.
Fields: Set of variables declared in a class block.
8. Constants: Set of constants declared in a class
block.
Constructors: A method or group of methods
that contains code to initialize the class.
Properties: The set of descriptive data of an
object.
Events: Program responses that get fired
after a user or application action.
Methods: Set of functions of the class.
9. Destructor: A method that is called when the
class is destroyed.
In managed code, the Garbage Collector is in
charge of destroying objects; however, in some
cases developers need to take extra actions when
objects are being released, such as freeing
handles or de-allocating unmanaged objects.
In .NET, there is no concept of deterministic
destructors. The Garbage Collector will call the
Finalize() method at a non-deterministic time
while reclaiming memory for the application.
10.
11. Access keywords
Access keywords define the access to class
members from the same class and from other
classes. The most common access keywords are:
Public: Allows access to the class member from
any other class.
Private: Allows access to the class member only
in the same class.
Protected: Allows access to the class member
only within the same class and from inherited
classes.
12. Internal: Allows access to the class member
only in the same assembly.
Protected internal: Allows access to the class
member only within the same class, from
inherited classes, and other classes in the
same assembly. Static: Indicates that the
member can be called without first
instantiating the class.
13. A particular Instance of a Class
Objects are the building blocks of OOP
Represent real world things in an abstract way
Commonly defined as variables or data
structures that encapsulate behavior and data
in a programmed unit
The objects will all act as independent units in
their own right, and they will be responsible
for carrying out a certain process
14. Object identity:
Every object is unique and can be differentiated from
other objects. Each time and object is created
(instantiated) the object identity is defined.
Object behavior:
What the object can do. In OOP, methods work as
functions that define the set of actions that the object
can do.
Object state:
The data stored within the object at any given
moment. In OOP, fields, constants, and properties
define the state of an object.
16. Is like inheriting the abstract characteristics from
other class - It is a kind of hierarchy
Base Class will be inherited to derived class
is a way to form new classes using classes that
have already been defined
is-a relationships represent a hierarchy between
classes of objects
Use:
Reuse of Code – uses the attributes of the base class
Extensibility – Has it’s own Attributes
.Net Inheritance Concepts
March 15, 2004
Brian Berejik
Matt Jackson
Vinnie Alwani
18. Superclass: Parent class
Subclass: Child class
Base class: Parent class
Derived class: Child class
19. Is like inheriting from more than one base
class.
.Net do not allow. But using Multiple interface
inheritance this can be achieved.
20. Information Hiding
Visibility to the methods and not to the fields
E.g. A Report designer for a programmer
Packs the data and Method and protects from
external tampering
Exposing only the details that are relevant: the
public interface
Improves Security
21. Protected cName as string
Protected Function ChangeName(NewName)
Me.cName = NewName
End Function
22. As we cannot hide entire object we give access
to some specific part of data.
Conceptual boundaries of an object
Focuses on the essential characteristics of an
object
a named entity made up of selected attributes
and behavior specific to a particular usage of
the originating entity
Improves Security
For example see notes below
23. One entity existing in multiple forms
Behavior depends on the type of data
Same message to diff objects results in
different behavior
Linked to inheritance and assures that derived
class to override the implementation of
parents methods.
24. Class Employee
Function PayEmployee()
PayEmployee = Hours * HourlyRate
End Function
Class CommissionedEmployee
Inherits Employee
Overrides Function PayEmployee()
PayEmployee = BasePay + Commissions
End Function
25. Upcasting
Casting an object of any type to another type
which is above it in the inheritance hierarchy.
Downcasting
Casting an object of any type to another type
which is below it in the inheritance hierarchy.
Example
Sealed Class
When applied to a class, the sealed modifier prevents
other classes from inheriting from it.
26. static classes and static methods are used to create
data and functions that can be accessed without
creating an instance of the class.
class CompanyInfo {
public string GetCompanyName() { return "CompanyName"; }
public string GetComAddress() { return "ComAddress"; }
These methods do not need to be attached to a
specific instance of the class. Therefore, instead of
creating unnecessary instances of this class, you can
declare it as a static class, like this:
static class CompanyInfo {
public static string GetCompanyName() {return "CompanyName";}
public static string GetComAddress() {return "ComAddress";}