The document discusses object-oriented programming concepts like classes, objects, methods, properties, inheritance, and polymorphism. It provides examples of different OOP concepts in C# like class definitions, object creation, method overloading, and inheritance hierarchies. The key topics covered include defining classes with data members and methods, creating objects from classes, using inheritance to extend classes, and implementing polymorphism through method overloading and overriding.
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Simplilearn
Abstraction is one of the keys to achieving the Object-Oriented Programming approach to design, develop, and deploy software. This technique is really important and many developed intend to have a strong grip on it. This video will give you an idea about the best practices and suggestions that could help you to use abstract classes in Java.
About Simplilearn Java certification training course:
If you’re looking to master web application development for virtually any computing platform, this Java Certification Training course is for you. This all-in-one Java training will give you a firm foundation in Java, the most commonly used programming language in software development.
This advanced Java Certification Training course is designed to guide you through the concepts of Java from introductory techniques to advanced programming skills. The course will provide you with the knowledge of Core Java 8, operators, arrays, loops, methods, and constructors while giving you hands-on experience in JDBC and JUnit framework.
Java Certification Course Key Features:
1. 70 hours of blended training
2. Hands-on coding and implementation of two web-based projects
3. Includes Hibernate and Spring frameworks
4. 35 coding-related exercises on Core Java 8
5. Lifetime access to self-paced learning
6. Flexibility to choose classes
Eligibility:
Simplilearn’s Java Certification Training course is ideal for software developers, web designers, programming enthusiasts, engineering graduates, and students or professionals who wish to become Java developers.
Pre-requisites:
Prior knowledge of Core Java is a prerequisite to taking this advanced Java Certification training course. Our Core Java online self-paced course is available for free to become familiar with the basics of Java programming.
Learn more at: https://bit.ly/3b6SCvp
An abstract class is a class that is declared abstract —it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class.
Abstraction is a process by which concepts are derived from the usage and classification of literal ("real" or "concrete") concepts.
Abstraction is a concept that acts as a super-categorical noun for all subordinate concepts, and connects any related concepts as a group, field, or category.
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.
What are Abstract Classes in Java | EdurekaEdureka!
YouTube Link: https://youtu.be/5X0Y--92pMI
**Java, J2EE & SOA Certification Training - https://www.edureka.co/java-j2ee-training-course **
This Edureka PPT on Abstract Classes in Java will provide you with detailed knowledge about Abstract Classes in Java and along with it, This PPT will also cover some examples of Abstract Classes in Java, in order to provide you with a deep understanding about their functionality. This PPT will cover the following topics:
What are Abstract Classes in Java?
Why do we need an Abstract Classes in Java?
Rules for using Abstract Classes in Java
Ways to achieve Abstraction in Java
The Syntax for Abstract Classes
Practical Examples of Abstract Classes
Difference between Interface and Abstract Class
Complete Java Playlist: http://bit.ly/2XcYNH5
Complete Blog Series: http://bit.ly/2YoabkT
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
It is a specialized case of ‘Abstraction’, such that it is a mechanism to hide irrelevant details of one object from another, while exposing only the relevant details that the other object might need. E.g. a Manager object may only be concerned with professional skills and availability timings of an employee, not his personal life details.
This slide about presentation of Object Oriented Programing or OOP contains Fundamental of OOP
Encapsulation
Inheritance
Abstract Class
Association
Polymorphism
Interface
Exceptional Handling
and more.
This presentation will helpful for Android Beginner's to refresh the OOPS Concepts which is very basic things for Android Mobile Application Development.
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Simplilearn
Abstraction is one of the keys to achieving the Object-Oriented Programming approach to design, develop, and deploy software. This technique is really important and many developed intend to have a strong grip on it. This video will give you an idea about the best practices and suggestions that could help you to use abstract classes in Java.
About Simplilearn Java certification training course:
If you’re looking to master web application development for virtually any computing platform, this Java Certification Training course is for you. This all-in-one Java training will give you a firm foundation in Java, the most commonly used programming language in software development.
This advanced Java Certification Training course is designed to guide you through the concepts of Java from introductory techniques to advanced programming skills. The course will provide you with the knowledge of Core Java 8, operators, arrays, loops, methods, and constructors while giving you hands-on experience in JDBC and JUnit framework.
Java Certification Course Key Features:
1. 70 hours of blended training
2. Hands-on coding and implementation of two web-based projects
3. Includes Hibernate and Spring frameworks
4. 35 coding-related exercises on Core Java 8
5. Lifetime access to self-paced learning
6. Flexibility to choose classes
Eligibility:
Simplilearn’s Java Certification Training course is ideal for software developers, web designers, programming enthusiasts, engineering graduates, and students or professionals who wish to become Java developers.
Pre-requisites:
Prior knowledge of Core Java is a prerequisite to taking this advanced Java Certification training course. Our Core Java online self-paced course is available for free to become familiar with the basics of Java programming.
Learn more at: https://bit.ly/3b6SCvp
An abstract class is a class that is declared abstract —it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class.
Abstraction is a process by which concepts are derived from the usage and classification of literal ("real" or "concrete") concepts.
Abstraction is a concept that acts as a super-categorical noun for all subordinate concepts, and connects any related concepts as a group, field, or category.
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.
What are Abstract Classes in Java | EdurekaEdureka!
YouTube Link: https://youtu.be/5X0Y--92pMI
**Java, J2EE & SOA Certification Training - https://www.edureka.co/java-j2ee-training-course **
This Edureka PPT on Abstract Classes in Java will provide you with detailed knowledge about Abstract Classes in Java and along with it, This PPT will also cover some examples of Abstract Classes in Java, in order to provide you with a deep understanding about their functionality. This PPT will cover the following topics:
What are Abstract Classes in Java?
Why do we need an Abstract Classes in Java?
Rules for using Abstract Classes in Java
Ways to achieve Abstraction in Java
The Syntax for Abstract Classes
Practical Examples of Abstract Classes
Difference between Interface and Abstract Class
Complete Java Playlist: http://bit.ly/2XcYNH5
Complete Blog Series: http://bit.ly/2YoabkT
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
It is a specialized case of ‘Abstraction’, such that it is a mechanism to hide irrelevant details of one object from another, while exposing only the relevant details that the other object might need. E.g. a Manager object may only be concerned with professional skills and availability timings of an employee, not his personal life details.
This slide about presentation of Object Oriented Programing or OOP contains Fundamental of OOP
Encapsulation
Inheritance
Abstract Class
Association
Polymorphism
Interface
Exceptional Handling
and more.
This presentation will helpful for Android Beginner's to refresh the OOPS Concepts which is very basic things for Android Mobile Application Development.
What does OOP stand for?
When Object Oriented Programming(OOP) is taught so extensively, do computer programmers, specifically within games development, realise what it's possibly doing to productivity and performance? I explain my own view from experience in personal projects and professional work.
This talk was given to the Edinburgh meet of IGDA Scotland, on 2011/07/27.
echnology is the application of knowledge for achieving practical goals in a reproducible way. The word technology can also mean the products resulting from such efforts, including both tangible tools such as utensils or machines, and intangible ones such as software
echnology is the application of knowledge for achieving practical goals in a reproducible way. The word technology can also mean the products resulting from such efforts, including both tangible tools such as utensils or machines, and intangible ones such as software
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfJay Das
With the advent of artificial intelligence or AI tools, project management processes are undergoing a transformative shift. By using tools like ChatGPT, and Bard organizations can empower their leaders and managers to plan, execute, and monitor projects more effectively.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Total oop in c# dot net
1. PROPAGATING IN .NET
By Muhammad Naveed
MCS University of AJK, DIT
Instructor Moon Creations School of IT
1
2. OOP
Function +data
In modular programming functions and data is
separated.
i.e.
student
{
Student info
}
Courses
{
Course info.
}
210/13/2012Muhammad Naveed
3. OOP
So every thing is separated data and
operations .
Class is an instance of an object, which
defines state and behavior of an object.
Object can interacts with each other by
message passing.
310/13/2012Muhammad Naveed
4. Class
To house (among other things)
In class we provide one or more methods that are
designed to perform the class tasks.
For example: a bank account class might contain one or
more methods to deposit money, withdraw money and
balance inquiry.
Collection of similar objects, with different names
Class in an passive entity.
Class in template or blue print
Class is module or sketch.
Class has data members and functions on which class
performs its functionalities.
Data and functions are combined
410/13/2012Muhammad Naveed
5. Object
We have to build a object of class to actually
gets its fruits. C# called OOP
Object is an active entity.
Object has properties or methods/
attitudes/ functions/operations/data
members/fields
So objects has state and behaviors
Students is an object.
Employee is an object
510/13/2012Muhammad Naveed
6. Methods
Performing a task in an application requires
a method. The method describes the
mechanism that actually perform its task.
The method hides from its user the complex
tasks. Just as the accelerator pedal of a car
hides from the driver the complex
mechanism of making the car go faster.
610/13/2012Muhammad Naveed
7. Attributes
Every objects muse have some attributes or properties
like color, size, shape etc.
Attributes are specified by the class’ instance variables
Properties Get assessors and set assessors
Attributes are not necessarily accessible directly. The car
manufacturer does not want drivers to take apart the
car’s engine to observe the amount of gas in its tank.
Instead the driver can check the fuel gauge on the
dashboard.
So in c# we use get accessors for reading and set
accessors for storing values.
710/13/2012Muhammad Naveed
8. STATIC Methods
Sometimes a method performs a task that
does not depend on the contents of any
object. So can be called with out creating its
object this is called static method.
Syntax
ClassName. MethodName(arguments)
Always called with class name and method
name
810/13/2012Muhammad Naveed
10. Constructor
Constructor is used to initialize the object of
the class.
Behaves like Function
Constructor is just like function, but it is a
special type of function.
Same name like class
Class student
Public student( )
Defaults constructor has no argument or
parameters
1010/13/2012Muhammad Naveed
11. Properties Function
These are get and set functions
Not a fully function but behaves like
function.
Used to get and set values of private data
members of a class
1110/13/2012Muhammad Naveed
12. int n;
Console.WriteLine("Enter a number");
n = Convert.ToInt32(Console.ReadLine());
if (n > 0)
{
Console.WriteLine("The Number is +ve");
}
else
{
Console.WriteLine("The number is -ve");
}
Console.Read();
int n;
n = 1;
while (n <= 5)
{
Console.WriteLine("Kashmir");
n++;
}
Console.Read();
1210/13/2012Muhammad Naveed
16. Features of OOP
Inheritance
Polymorphism
Encapsulation
Abstraction
1610/13/2012Muhammad Naveed
17. STRUCTURED VS. OO PROGRAMMING
17
STRUCTURED PROGRAMMING:
10/13/2012Muhammad Naveed
18. Structured Programming
Using function
Function & program is divided into modules
Every module has its own data and function
which can be called by other modules.
1810/13/2012Muhammad Naveed
20. OBJECT ORIENTED PROGRAMMING
Objects have both data and methods
Objects of the same class have the same data elements
and methods
Objects send and receive messages to invoke actions
Key idea in object-oriented:
The real world can be accurately described as a collection of
objects that interact.
2010/13/2012Muhammad Naveed
21. Basic terminology
object
- usually a person, place or thing (a noun)
method
- an action performed by an object (a verb)
attribute
- description of objects in a class
class
- a category of similar objects (such as automobiles)
- does not hold any values of the object’s attributes
2110/13/2012Muhammad Naveed
22. Example for attributes and methods
Attributes:
manufacturer’s name
model name
year made
color
number of doors
size of engine
etc.
Methods:
Define data items
(specify
manufacturer’s name,
model, year, etc.)
Change a data item
(color, engine, etc.)
Display data items
Calculate cost
etc.
2210/13/2012Muhammad Naveed
23. WHY OOP?
Save development time (and cost) by reusing code
once an object class is created it can be used in other
applications
Easier debugging
classes can be tested independently
reused objects have already been tested
2310/13/2012Muhammad Naveed
24. DESIGN PRINCIPLES OF OOP
Four main design principles of Object-Oriented
Programming(OOP):
Encapsulation(information hiding)
Abstraction(hide unnecessary details )
Polymorphism(same thing behave differently)
Inheritance(derived class inherit from base class)
2410/13/2012Muhammad Naveed
25. ENCAPSULATION
Also known as data hiding
Only object’s methods can modify information in the
object.
Data and Function Encapsulated within a single
package ‘class’.
Analogy:
ATM machine can only update accounts of one
person or object only.
2510/13/2012Muhammad Naveed
26. Abstraction
Focus only on the important facts about the
problem at hand
to design, produce, and describe so that it can be
easily used without knowing the details of how it
works.
Analogy:
When you drive a car, you don’t have to know how
the gasoline and air are mixed and ignited.
Instead you only have to know how to use the
controls.
Draw map
2610/13/2012Muhammad Naveed
27. POLYMORPHISM
the same word or phrase can mean different things
in different contexts
Analogy:
In English, bank can mean side of a river or a place
to put money
move -
2710/13/2012Muhammad Naveed
28. Function Overloading
The operation of one function depends on the
argument passed to it.
Example: Fly(), Fly(low), Fly(150)
2810/13/2012Muhammad Naveed
29. INHERITANCE
Inheritance—a way of organizing classes
Term comes from inheritance of traits like eye color,
hair color, and so on.
Classes with properties in common can be grouped so
that their common properties are only defined once.
Superclass – inherit its attributes & methods to the
subclass(es).
Subclass – can inherit all its superclass attributes &
methods besides having its own unique attributes &
methods.
2910/13/2012Muhammad Naveed
30. AN INHERITANCE HIERARCHY
30
Vehicle
Automobile Motorcycle Bus
Sedan Sports Car School BusLuxury Bus
What properties does each vehicle inherit from the types
of vehicles above it in the diagram?
Superclass
Subclasses
10/13/2012Muhammad Naveed
32. Review: Introduction to Object
Orientation
What are the four basic principles of object
orientation? Provide a brief description of
each.
What is an Object and what is a Class? What is
the difference between them?
What is an Attribute?
What is an Operation?
What is inheritance?
What is polymorphism?
Describe the strengths of object orientation.
3210/13/2012Muhammad Naveed
33. Review: Introduction to Object
Orientation
State 2 differences between functional
programming and OOP.
What are the four basic principles of object
orientation? Provide a brief description of
each.
What is an Object and what is a Class? What is
the difference between them?
What is an Attribute?
What is an Operation?
Describe the strengths of object orientation.
3310/13/2012Muhammad Naveed
34. Polymorphism
Compile time polymorphism(Overloading)
Run time Polymorphism( Overriding )
3410/13/2012Muhammad Naveed
36. Compile Time
Polymorphism(Overloading)
Function Overloading
It means same thing behaves differently
Public void get()
Public void get(int r)
Public void get(int r, string n)
Public void get(int r, string n, string rem….)
So same function behaves differently by increasing
number of parameters or arguments i.e. no argument, one
argument or two or may be three or even more.
So this is how we can achieve Compile time polymorphism
that is overloading
Also function type or signature can be changed, so that
it can be define with same name but with different
parameters.
3610/13/2012Muhammad Naveed
38. Compile Time
Polymorphism(Overloading)
Operator Overloading
Some operators can also behaves differently
called operator overloading (polymorphism).
Operator can be redefined to achieve the
operator overloading.
3810/13/2012Muhammad Naveed
50. Lecture
Intro to GUI using C#
Windows Applications
Windows Forms
5010/13/2012Muhammad Naveed
51. Run Time Polymorphism
(Overriding)
We have learned about compile time
polymorphism which is overloading.
Function Overloading
Public void get(int n)
Operator Overloading
Public static room operaotr +(room rm1, room
rm2)
Constructor Overloading
Public student(string n,…)
5110/13/2012Muhammad Naveed
52. Run Time Polymorphism
(Overriding)
Now in this case we have to change the
signature or nos of parameters to get
function overloading. Which we have done.
But in some situations, we have to use same
function with the same name signature this
is called overriding. this situation can be
used in parent class relationship i.e.
Where we have to use virtual function, That
needs to be redefined again and again. It
gives the 1st definition of that function,
5210/13/2012Muhammad Naveed
53. Run Time Polymorphism
(Overriding)
Because same name with same signature
needs to be redefined using virtual keyword
in the parent class.
And to access this in the child class we have
to use override keyword.
5310/13/2012Muhammad Naveed
55. OOP: Inheritance
Inheritance a form of software reuse.
Lets you save much of your time in software
development.
The existing class from which a new class
inherits is called base class, and the new
class is called derived class
Each derived class can become the base
class for next extended class
And new data members can be added.
10/13/2012Muhammad Naveed 55
56. OOP: Inheritance
Base Class Derived Class
Student Graduate Student, Undergradulate
Shape Oval, Rectangle, elpse
Loan CarLoan, HomeLoan
BankAccount Currant, Saving etc
10/13/2012Muhammad Naveed 56
58. OOP: Inheritance
Protected Members
Commonly we used Public and Private
Public data members are accessible
whenever the application has a reference to
an object of that class or one of its derived
class.
Private data members are inherited from its
derived class, but are not accessible by
derived class and methods.
10/13/2012Muhammad Naveed 58
59. OOP: Inheritance
Protected :
Provides an intermediate level of
accessibility b/w public and private. These
can be accessible by members of that base
class and by members of its derived class
10/13/2012Muhammad Naveed 59
66. The above examples show polymorphism,
inheritance, constructor overloading and
function overloading, private and public
data members w.r.t access.
Reference Book
C# 2010 for programmers.
Chapter 11, OOP Programming: inheritance
page:320 etc
10/13/2012Muhammad Naveed 66
summery
67. Abstract Class and Methods
We can not create object of the Abstract
Class.
The purpose of the abstract class is
primarily to provide and appropriate base
class from which other classes can inherit
and thus share a common design.
Public abstract void show()//abstract
method
10/13/2012Muhammad Naveed 67
69. Payroll System Using
Polymorphism
A company pay in employees on a weekly basis.
The employees are of four types.
Salaried Employees: are paid a fixed weekly salary
regardless of the number of hours worked.
Hourly Employees: are paid by hour and receive
“time and a half” overtime pay for their sales.
Salaried commission employees: are paid a
percentage of their sales.
For the current pay period the company has decides
to reward salaried commission employees by adding
10% to their base salaries.
Company demands a C# application.
10/13/2012Muhammad Naveed 69
70. Solution
We use abstract class as employee for
general concept.
The other class that extends from employee
abstract class are: SalariedEmployee,
CommissionEmployee and
HourlyEmployee.
ClassBasePlusCommissioEmployee Which
extends from CommissionEmployee.
UML
10/13/2012Muhammad Naveed 70
72. Cases
Classes Earnigns ToString
Employee Abstract The abstract class for all
other classes as a
foundation first
name,last name, social
security number SSN
Salaried Employee weeklySalary Salaried
employee:employee
Weekly salary:
Hourly Employee If hours<=40
Wage=hours
Ifhours>40
40*wage+(hours-
40)+wage=1.5
Hourlty
employee:employee
Houtly wage :wage
Hours work:hours
Comission Employee commissionRate*grossS
ales
Inherit from employee
Gross sale:grassSales
Comission
rate:comissionRate
BasePlusComissionEmpl
oyee
comissionRate*grossSal
es+baseSalry
Base Salaried comsiion
employee:10/13/2012Muhammad Naveed 72