SlideShare a Scribd company logo
Advanced Oops concept using
ASP.NET
By
Dr.R.Shenbagavalli
Index
A. Object Oriented Programming
1. Class
2.Constructor and Destructor
3.Inheritance
4.Overridden
5.Overloading
6.Polymorphism
7.Interfaces
8. Implementing Polymorphism using
Interfaces
B. Multithreaded Programming
1. Thread Synchronization
2. Events and Thread Synchronization
Polymorphism
• Different classes that have same properties
and methods
• Classes represent have similar operation and
characteristics
• Example
Vehicle - base class
each type of
vehicle derive from vehicle class
see eg in your book
• Class Truck inherits Vehicle
which contain procedure and function like
1.function start engine
2. stop engine
3.function accelerate
• Class minivan inherits vehicle
which also contain the same function and procedure in the same name
what truck has.
• Next create one object objvehicle through procedure (Dovehicleoperation)
to call all the function and procedure from both derived class(truck and
minivan)
• Create object for individual derived class
dim objtruck as new truck()
dim objminivan as new minivan()
• Execute individual derived class function and procedure by substituting
each derived class object in Dovehicleoperation procedure
Dovehicleoperation (objtruck)
Dovehicleoperation(objminivan)
From the previous example polymorphism is many form
like truck and minivan which has same name methods
and characteristics as base class
• Polymorphism provides following features:
• It allows you to invoke methods of derived class
through base class reference during runtime.
• It has the ability for classes to provide different
implementations of methods that are called through
the same name.
• Advantage of polymorphism:
• It helps programmers to reuse the code, classes,
methods written once, tested and implemented. They
may be reused in many ways. The single variable name
can be used to store variables of multiple data types
such as Int, Float, double, Long, etc).
Interfaces
• An interface is a specification for a set of class
members, properties, and methods but do
not provide any implementation.
An Interface is a reference type and it contains
only abstract members such as Events,
Methods, Properties etc. It contain only
declaration for its members and
implementation defined as separate entities
from classes.
• Create one interface imyclassinterface, which
contains procedure (myproc,yourproc) and
functions(anybodysproc)
• Create class cmyclass implements
imyclassinterface
The class contains the same procedure
and function what the interface has.but all the
class procedure and function should
implement through interface procedure
for eg
public sub myproc implements
imyclassinterface.myproc
• All the class procedure should implement
through interface procedure.
• Next Create object for both interface and
class. The class name for both of them are
same.
dim objmyclass as imyclassinterface
dim blnreturnvalue as boolean
objmyclass = new cmyclass()
Through the object we can call procedure and
functions within the class
• Objmyclass.myproc(1)
objmyclass.yourproc(“test”)
Blnretrnvalue =objmyclass.anybodyproc(1)
Here blnreturnvalue is a variable of type
imyclassinterface. So all the class procedure,
function and datatpe are called through the
implementation of an interface.
• We can also apply inheritance within an
interace
• Interface imyalternativeclassinterface inherits
imyclassinterface
One procedure (myaltsub) for derived interface
Create an object for derived interface with same
name objmyclass.
To call both interface procedure add both
interface within the class by
public class cmyclass implements
imyclassinterface, imyalternativeclassinterface
then objmyclass.myproc(1)
Objmyclass.myaltsub()……
Implementing Polymorphism using
Interfaces
• In an inheritance ,single class implements
different interfaces like
public class cmyclass implements
imyclassinterface, imyalternativeclassinterface
in the case of polymorphism two different
classes share an interface
Interface igameweapon which contain
property(numofrounds),function(fire) and
procedure(reload)
• Two classes
1. public class cmachinegun implements igameweapon
2. public class crocketlauncher implements igameweapon
Both class contains the same property,function and procedure what an
interface has.
• Next create object for interface through one procedure
reloadandattack .
• Next create object for both class .here the object name need not be
same as interface object.
dim objmachinegun as new cmachinegn()
dim objrocketlauncher as new crocketlauncher()
to call the procedure and function of each class through interface
object
• Reloadandattack(objmachinegun)
• Reloadandattack(objrocketlauncher)
Multithreaded programming
• Execution follows a single path called a thread.
• In a single threaded application the task like user
input, sorting the large datalist, sending the list to
some application are executed sequentially even
if they are independent task.
• A web server will not do a single threaded
application.it needs to handle thousands of
simultaneous request .
• The solution to maximize the hardware resources
to make the application multithreaded.In .net it is
called free-threaded.
• In .net the class object like
system.threading.thread will do threading function
For eg
take two thread
fnction(threadoneproc,threadtwoproc).each function print
out a message that identifies itself 200 times.
Next create object for each thread
dim thd1 as new system,threading.thread(Address of
threadoneproc)
dim thd2 as new system,threading.thread(Address of
threadtwoproc)
Execute both thread function by calling
thd1.start()
Thd2.start().here the start() function will execute both thread.
Thread synchronization
• In a free threaded application more than one
thread can occur simultaneously. One of the
problem with free threaded is able to
coordinate thread that operate on the same
set of data.coordinating thread is called
thread synchronization.
• Two methods are sed to synchronize threads
by using IsAlive()
• Two threads sort() and printlist()
• Create object for the class then create object
for both threads.
• Here isalive functionis used to check the first
thread is running or not .after completing
sort() ,the sorted list to be printed.
Events and thread Synchronization
• An event is a type of signal that we can attach with a class.
That signal can be activated when something happens
inside the class. The event then handled by the host.
• Event is a set of code defined within the class.
Eg public Event somethinghappened().
• Eg for raise event definition
RaiseEvent somethinghappened().
• Declaration of event within the class
dim withevents objmyclass as cmyclassthathasevents
event object classname
• In the eg program
two events has been defined
public event progress()
public event done()
And declared as
dim withevents objlist as cnumberlist
Event raise can be defined as
raiseevent progress can be written within the
sort program to check whether all 1500 numbers
have been sorted. If it is not ,again the loop will
be return back to progress
Raiseevent done() .this is another raise event will be
aised after the completion of sorting
• To execute event with synchronization
1. create object for thread to sort procedure either to
start the procedure or stop the procedure
thdsortthread.start()
thdsortthread.abort()
2. write procedre for both events with handles
public sub objlist_progress () handles objlist.progress
this procedure is to display how much % of sorting
has been completed.
public sub objlist_done() handles objlist.done()
this procedure is to take printout.since done means the
sorting is over
• Students please study this portion which I
have not covered in the class. Other portion I
have covered in the class itself. Go through the
entire syllabus. Study well . Stay at home
safely. Complete the record work . Do practice
your Lab exercises.
Wish you all the Best

More Related Content

What's hot (19)

An introduction to constructor
An introduction to constructorAn introduction to constructor
An introduction to constructor
Niby Babu
 
Lesson3
Lesson3Lesson3
Lesson3
Arpan91
 
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Donny Wals
 
ConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTIONConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTION
Shweta Shah
 
Dynamic databinding
Dynamic databindingDynamic databinding
Dynamic databinding
Gagan Vishal Mishra
 
Mule java part-4
Mule java part-4Mule java part-4
Mule java part-4
Karnam Karthik
 
Mule java part-3
Mule java part-3Mule java part-3
Mule java part-3
Karnam Karthik
 
JavaScript Beyond jQuery
JavaScript Beyond jQueryJavaScript Beyond jQuery
JavaScript Beyond jQuery
Bobby Bryant
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
Nilesh Dalvi
 
ARTDM 170, Week 5: Intro To Flash
ARTDM 170, Week 5: Intro To FlashARTDM 170, Week 5: Intro To Flash
ARTDM 170, Week 5: Intro To Flash
Gilbert Guerrero
 
Android development training programme , Day 3
Android development training programme , Day 3Android development training programme , Day 3
Android development training programme , Day 3
DHIRAJ PRAVIN
 
Obj 3
Obj 3Obj 3
Obj 3
Fajar Baskoro
 
Objective-C: Good and Bad
Objective-C: Good and BadObjective-C: Good and Bad
Objective-C: Good and Bad
Anthony Shoumikhin
 
Chapter 1 Presentation
Chapter 1 PresentationChapter 1 Presentation
Chapter 1 Presentation
guest0d6229
 
Sep 15
Sep 15Sep 15
Sep 15
Zia Akbar
 
Sep 15
Sep 15Sep 15
Sep 15
dilipseervi
 
Method overloading
Method overloadingMethod overloading
Method overloading
Lovely Professional University
 
Object Lifetime In C C++
Object Lifetime In C C++Object Lifetime In C C++
Object Lifetime In C C++
ppd1961
 
Nodejs functions & modules
Nodejs functions & modulesNodejs functions & modules
Nodejs functions & modules
monikadeshmane
 
An introduction to constructor
An introduction to constructorAn introduction to constructor
An introduction to constructor
Niby Babu
 
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Using Combine, SwiftUI and callAsFunction to build an experimental localizati...
Donny Wals
 
ConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTIONConsTRUCTION AND DESTRUCTION
ConsTRUCTION AND DESTRUCTION
Shweta Shah
 
JavaScript Beyond jQuery
JavaScript Beyond jQueryJavaScript Beyond jQuery
JavaScript Beyond jQuery
Bobby Bryant
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
Nilesh Dalvi
 
ARTDM 170, Week 5: Intro To Flash
ARTDM 170, Week 5: Intro To FlashARTDM 170, Week 5: Intro To Flash
ARTDM 170, Week 5: Intro To Flash
Gilbert Guerrero
 
Android development training programme , Day 3
Android development training programme , Day 3Android development training programme , Day 3
Android development training programme , Day 3
DHIRAJ PRAVIN
 
Chapter 1 Presentation
Chapter 1 PresentationChapter 1 Presentation
Chapter 1 Presentation
guest0d6229
 
Object Lifetime In C C++
Object Lifetime In C C++Object Lifetime In C C++
Object Lifetime In C C++
ppd1961
 
Nodejs functions & modules
Nodejs functions & modulesNodejs functions & modules
Nodejs functions & modules
monikadeshmane
 

Similar to Advanced oops concept using asp (20)

Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
agorolabs
 
Jaga codinghshshshshehwuwiwijsjssnndnsjd
Jaga codinghshshshshehwuwiwijsjssnndnsjdJaga codinghshshshshehwuwiwijsjssnndnsjd
Jaga codinghshshshshehwuwiwijsjssnndnsjd
rajputtejaswa12
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
Connex
 
Advanced java jee material by KV Rao sir
Advanced java jee material by KV Rao sirAdvanced java jee material by KV Rao sir
Advanced java jee material by KV Rao sir
AVINASH KUMAR
 
[2015/2016] JavaScript
[2015/2016] JavaScript[2015/2016] JavaScript
[2015/2016] JavaScript
Ivano Malavolta
 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
Connex
 
object oriented programming language.pptx
object oriented programming language.pptxobject oriented programming language.pptx
object oriented programming language.pptx
syedabbas594247
 
JavaScript
JavaScriptJavaScript
JavaScript
Ivano Malavolta
 
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Soumen Santra
 
Polymorphism Using C++
Polymorphism Using C++Polymorphism Using C++
Polymorphism Using C++
PRINCE KUMAR
 
Java notes
Java notesJava notes
Java notes
Upasana Talukdar
 
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To  Classes, Objects, & StringsIntro To C++ - Class 05 - Introduction To  Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
Blue Elephant Consulting
 
object oriented programming unit one ppt
object oriented programming unit one pptobject oriented programming unit one ppt
object oriented programming unit one ppt
isiagnel2
 
Mod_5 of Java 5th module notes for ktu students
Mod_5 of Java 5th module notes for ktu studentsMod_5 of Java 5th module notes for ktu students
Mod_5 of Java 5th module notes for ktu students
heytherenewworld
 
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUEITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
VinishA23
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
Rakesh Madugula
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84
Mahmoud Samir Fayed
 
Vb.net iv
Vb.net ivVb.net iv
Vb.net iv
argusacademy
 
Java For beginners and CSIT and IT students
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT students
Partnered Health
 
Python oop class 1
Python oop   class 1Python oop   class 1
Python oop class 1
Aleksander Fabijan
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
agorolabs
 
Jaga codinghshshshshehwuwiwijsjssnndnsjd
Jaga codinghshshshshehwuwiwijsjssnndnsjdJaga codinghshshshshehwuwiwijsjssnndnsjd
Jaga codinghshshshshehwuwiwijsjssnndnsjd
rajputtejaswa12
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
Connex
 
Advanced java jee material by KV Rao sir
Advanced java jee material by KV Rao sirAdvanced java jee material by KV Rao sir
Advanced java jee material by KV Rao sir
AVINASH KUMAR
 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
Connex
 
object oriented programming language.pptx
object oriented programming language.pptxobject oriented programming language.pptx
object oriented programming language.pptx
syedabbas594247
 
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Soumen Santra
 
Polymorphism Using C++
Polymorphism Using C++Polymorphism Using C++
Polymorphism Using C++
PRINCE KUMAR
 
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To  Classes, Objects, & StringsIntro To C++ - Class 05 - Introduction To  Classes, Objects, & Strings
Intro To C++ - Class 05 - Introduction To Classes, Objects, & Strings
Blue Elephant Consulting
 
object oriented programming unit one ppt
object oriented programming unit one pptobject oriented programming unit one ppt
object oriented programming unit one ppt
isiagnel2
 
Mod_5 of Java 5th module notes for ktu students
Mod_5 of Java 5th module notes for ktu studentsMod_5 of Java 5th module notes for ktu students
Mod_5 of Java 5th module notes for ktu students
heytherenewworld
 
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUEITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
VinishA23
 
Md02 - Getting Started part-2
Md02 - Getting Started part-2Md02 - Getting Started part-2
Md02 - Getting Started part-2
Rakesh Madugula
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84
Mahmoud Samir Fayed
 
Java For beginners and CSIT and IT students
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT students
Partnered Health
 

Recently uploaded (20)

UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Origin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theoriesOrigin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theories
PrachiSontakke5
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptxU3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
Mayuri Chavan
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE  BY sweety Tamanna Mahapatra MSc PediatricAPGAR SCORE  BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
SweetytamannaMohapat
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
PHYSIOLOGY MCQS By DR. NASIR MUSTAFA (PHYSIOLOGY)
PHYSIOLOGY MCQS By DR. NASIR MUSTAFA (PHYSIOLOGY)PHYSIOLOGY MCQS By DR. NASIR MUSTAFA (PHYSIOLOGY)
PHYSIOLOGY MCQS By DR. NASIR MUSTAFA (PHYSIOLOGY)
Dr. Nasir Mustafa
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Redesigning Education as a Cognitive Ecosystem: Practical Insights into Emerg...
Leonel Morgado
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Origin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theoriesOrigin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theories
PrachiSontakke5
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptxU3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
Mayuri Chavan
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE  BY sweety Tamanna Mahapatra MSc PediatricAPGAR SCORE  BY sweety Tamanna Mahapatra MSc Pediatric
APGAR SCORE BY sweety Tamanna Mahapatra MSc Pediatric
SweetytamannaMohapat
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
PHYSIOLOGY MCQS By DR. NASIR MUSTAFA (PHYSIOLOGY)
PHYSIOLOGY MCQS By DR. NASIR MUSTAFA (PHYSIOLOGY)PHYSIOLOGY MCQS By DR. NASIR MUSTAFA (PHYSIOLOGY)
PHYSIOLOGY MCQS By DR. NASIR MUSTAFA (PHYSIOLOGY)
Dr. Nasir Mustafa
 

Advanced oops concept using asp

  • 1. Advanced Oops concept using ASP.NET By Dr.R.Shenbagavalli
  • 2. Index A. Object Oriented Programming 1. Class 2.Constructor and Destructor 3.Inheritance 4.Overridden 5.Overloading 6.Polymorphism 7.Interfaces 8. Implementing Polymorphism using Interfaces B. Multithreaded Programming 1. Thread Synchronization 2. Events and Thread Synchronization
  • 3. Polymorphism • Different classes that have same properties and methods • Classes represent have similar operation and characteristics • Example Vehicle - base class each type of vehicle derive from vehicle class see eg in your book
  • 4. • Class Truck inherits Vehicle which contain procedure and function like 1.function start engine 2. stop engine 3.function accelerate • Class minivan inherits vehicle which also contain the same function and procedure in the same name what truck has. • Next create one object objvehicle through procedure (Dovehicleoperation) to call all the function and procedure from both derived class(truck and minivan) • Create object for individual derived class dim objtruck as new truck() dim objminivan as new minivan() • Execute individual derived class function and procedure by substituting each derived class object in Dovehicleoperation procedure Dovehicleoperation (objtruck) Dovehicleoperation(objminivan)
  • 5. From the previous example polymorphism is many form like truck and minivan which has same name methods and characteristics as base class • Polymorphism provides following features: • It allows you to invoke methods of derived class through base class reference during runtime. • It has the ability for classes to provide different implementations of methods that are called through the same name. • Advantage of polymorphism: • It helps programmers to reuse the code, classes, methods written once, tested and implemented. They may be reused in many ways. The single variable name can be used to store variables of multiple data types such as Int, Float, double, Long, etc).
  • 6. Interfaces • An interface is a specification for a set of class members, properties, and methods but do not provide any implementation. An Interface is a reference type and it contains only abstract members such as Events, Methods, Properties etc. It contain only declaration for its members and implementation defined as separate entities from classes.
  • 7. • Create one interface imyclassinterface, which contains procedure (myproc,yourproc) and functions(anybodysproc) • Create class cmyclass implements imyclassinterface The class contains the same procedure and function what the interface has.but all the class procedure and function should implement through interface procedure for eg public sub myproc implements imyclassinterface.myproc
  • 8. • All the class procedure should implement through interface procedure. • Next Create object for both interface and class. The class name for both of them are same. dim objmyclass as imyclassinterface dim blnreturnvalue as boolean objmyclass = new cmyclass() Through the object we can call procedure and functions within the class
  • 9. • Objmyclass.myproc(1) objmyclass.yourproc(“test”) Blnretrnvalue =objmyclass.anybodyproc(1) Here blnreturnvalue is a variable of type imyclassinterface. So all the class procedure, function and datatpe are called through the implementation of an interface. • We can also apply inheritance within an interace
  • 10. • Interface imyalternativeclassinterface inherits imyclassinterface One procedure (myaltsub) for derived interface Create an object for derived interface with same name objmyclass. To call both interface procedure add both interface within the class by public class cmyclass implements imyclassinterface, imyalternativeclassinterface then objmyclass.myproc(1) Objmyclass.myaltsub()……
  • 11. Implementing Polymorphism using Interfaces • In an inheritance ,single class implements different interfaces like public class cmyclass implements imyclassinterface, imyalternativeclassinterface in the case of polymorphism two different classes share an interface Interface igameweapon which contain property(numofrounds),function(fire) and procedure(reload)
  • 12. • Two classes 1. public class cmachinegun implements igameweapon 2. public class crocketlauncher implements igameweapon Both class contains the same property,function and procedure what an interface has. • Next create object for interface through one procedure reloadandattack . • Next create object for both class .here the object name need not be same as interface object. dim objmachinegun as new cmachinegn() dim objrocketlauncher as new crocketlauncher() to call the procedure and function of each class through interface object • Reloadandattack(objmachinegun) • Reloadandattack(objrocketlauncher)
  • 13. Multithreaded programming • Execution follows a single path called a thread. • In a single threaded application the task like user input, sorting the large datalist, sending the list to some application are executed sequentially even if they are independent task. • A web server will not do a single threaded application.it needs to handle thousands of simultaneous request . • The solution to maximize the hardware resources to make the application multithreaded.In .net it is called free-threaded.
  • 14. • In .net the class object like system.threading.thread will do threading function For eg take two thread fnction(threadoneproc,threadtwoproc).each function print out a message that identifies itself 200 times. Next create object for each thread dim thd1 as new system,threading.thread(Address of threadoneproc) dim thd2 as new system,threading.thread(Address of threadtwoproc) Execute both thread function by calling thd1.start() Thd2.start().here the start() function will execute both thread.
  • 15. Thread synchronization • In a free threaded application more than one thread can occur simultaneously. One of the problem with free threaded is able to coordinate thread that operate on the same set of data.coordinating thread is called thread synchronization. • Two methods are sed to synchronize threads by using IsAlive()
  • 16. • Two threads sort() and printlist() • Create object for the class then create object for both threads. • Here isalive functionis used to check the first thread is running or not .after completing sort() ,the sorted list to be printed.
  • 17. Events and thread Synchronization • An event is a type of signal that we can attach with a class. That signal can be activated when something happens inside the class. The event then handled by the host. • Event is a set of code defined within the class. Eg public Event somethinghappened(). • Eg for raise event definition RaiseEvent somethinghappened(). • Declaration of event within the class dim withevents objmyclass as cmyclassthathasevents event object classname
  • 18. • In the eg program two events has been defined public event progress() public event done() And declared as dim withevents objlist as cnumberlist Event raise can be defined as raiseevent progress can be written within the sort program to check whether all 1500 numbers have been sorted. If it is not ,again the loop will be return back to progress Raiseevent done() .this is another raise event will be aised after the completion of sorting
  • 19. • To execute event with synchronization 1. create object for thread to sort procedure either to start the procedure or stop the procedure thdsortthread.start() thdsortthread.abort() 2. write procedre for both events with handles public sub objlist_progress () handles objlist.progress this procedure is to display how much % of sorting has been completed. public sub objlist_done() handles objlist.done() this procedure is to take printout.since done means the sorting is over
  • 20. • Students please study this portion which I have not covered in the class. Other portion I have covered in the class itself. Go through the entire syllabus. Study well . Stay at home safely. Complete the record work . Do practice your Lab exercises. Wish you all the Best
  翻译: