SlideShare ist ein Scribd-Unternehmen logo
1 von 39
OO Languages

                                   Chapter 9




Object-Oriented Software Systems Engineering – Chapter 9   Slide 1
Objectives

 In this chapter we will:
  Introduce some Object Oriented Programming
   Languages
  Compare some aspects of these languages




Object-Oriented Software Systems Engineering – Chapter 9   Slide 2
Major OOPL

  Four of the major Object Oriented Programming
    languages are:
 C++
 Smalltalk
 Eiffel
 Java




Object-Oriented Software Systems Engineering – Chapter 9   Slide 3
Smalltalk

  Smalltalk was for most purposes the first object-
    oriented language, although it was based on ideas
    first developed in a simulation language called
    Simula in the 1960s

  Smalltalk was designed to support a (then)
    radically new type of user interface - the graphical
    user interface




Object-Oriented Software Systems Engineering – Chapter 9   Slide 4
Smalltalk environment

  Then Smalltalk was synonymous with GUIs - now
    they are commonplace

  Smalltalk’s environment is graphical, based on
    windows and browsers, and is controlled by a
    pointing device




Object-Oriented Software Systems Engineering – Chapter 9   Slide 5
Environment...

  The development environment is an integral part
    of Smalltalk, and all aspects of it are available for
    inspection and change within a running Smalltalk
    system, conversely a Smalltalk system can be
    extended by writing new classes which are then
    available in the environment for immediate use, so
    it is possible to add your own code-writing or
    debugging tools, although these are already
    present in Smalltalk




Object-Oriented Software Systems Engineering – Chapter 9   Slide 6
...Environment

  Smalltalk has several classes of interactive code
    writing and debugging tools. They are:
       Class Hierarchy Browser
       Class Browser
       Workspace
       System Transcript
       Disk Browser
       Walkback; Debugger




Object-Oriented Software Systems Engineering – Chapter 9   Slide 7
Environment Classes

  System Transcript:
     reports events in the system as they occur
  Class Hierarchy Browser
     allows users to browse, edit, and add new classes to the
      running system
  Workspace
     allows users to edit and evaluate expressions and
      displays the results




Object-Oriented Software Systems Engineering – Chapter 9   Slide 8
Debugging

  Whenever an error occurs Smalltalk displays a
   window containing a “walkback” (=backtrace)
   which shows the messages that led to the error
  It is possible to resume or to start an interactive
   debugging tool to trace messages through the
   objects leading up to the error
  Objects can also initiate error recovery whenever
   a message they send is not understood by the
   receiver




Object-Oriented Software Systems Engineering – Chapter 9   Slide 9
Smalltalk Summary

  Designed for interactive and extensible use,
    therefore:
       environment is available for modification and extension
       language is semi-compiled then interpreted
       has dynamic binding and
       dynamic typing




Object-Oriented Software Systems Engineering – Chapter 9    Slide 10
Smalltalk Summary



  everything is an object
  conceptually consistent
  run-time error recovery
  well-integrated debugging facilities
  “clean” design to support quick learning
  automatic garbage collection for ease of use




Object-Oriented Software Systems Engineering – Chapter 9   Slide 11
C++


  C++ is not tightly integrated with its development
   environment and aspects of the environment are
   not usually available to the programmer
  Unlike Smalltalk it is compiled, and so is much
   less interactive, all changes and evaluations being
   made in the traditional edit-compile-execute cycle




Object-Oriented Software Systems Engineering – Chapter 9   Slide 12
C++


  C++ was designed as a production software
    language, so much of it is designed to be fast at
    the expense of simplicity




Object-Oriented Software Systems Engineering – Chapter 9   Slide 13
C++ Programming


  C++ is a hybrid of two languages, C and an object-
   oriented extension - so it can also accept existing
   C programs
  C++ has been used to “object-orientize” existing C
   programs, a major factor in its popularity
  But this means that it is harder to use than
   Smalltalk because the language is much more
   complex




Object-Oriented Software Systems Engineering – Chapter 9   Slide 14
C++ Error Handling

  C++ can handle run-time errors by writing
    exception handlers which trap and deal with the
    error

  They fulfill a role similar to that of the
    “doesNotUnderstand” message in Smalltalk,
    although in C++ an object can never fail to
    understand a message because C++ is statically
    typed




Object-Oriented Software Systems Engineering – Chapter 9   Slide 15
C++ Environment

  A typical C++ environment contains program
   editing, debugging (tracing and breakpointing)
   and library facilities
  Debugging tools depend on what the vendor can
   supply - there is no standard - but many good
   debugging and single-stepping tools are available
   (e.g. Borland C++)




Object-Oriented Software Systems Engineering – Chapter 9   Slide 16
C++ Environment


  Libraries are also non-standard, although many
    libraries conform closely to a de-facto standard




Object-Oriented Software Systems Engineering – Chapter 9   Slide 17
C++ Summary


  C++ was designed for production programming
    and to be compatible with C:
       compiled for speed of execution
       not very interactive
       strong static typing to catch programming errors before
        execution




Object-Oriented Software Systems Engineering – Chapter 9   Slide 18
C++ Summary continued


       choice of static / dynamic binding for speed => confusion
       debugging less well integrated, though often good
       special run-time error recovery mechanism = exceptions
       “dirty” design to support existing C code + OO
        extensions
       constructor and destructor functions to speed up object
        creation and deletion




Object-Oriented Software Systems Engineering – Chapter 9    Slide 19
Comparison


  C++:
     edit-compile-execute
     compiled (interpreters exist)
     language separate from environment
     many variations of environment from different vendors
     widely ported to different platforms




Object-Oriented Software Systems Engineering – Chapter 9   Slide 20
...Comparison


  Smalltalk:
     interactive
     interpreted (compilers exist)
     language integrated with environment
     only one vendor
     limited number of hardware platforms




Object-Oriented Software Systems Engineering – Chapter 9   Slide 21
...Comparison


  C++:
     statically typed
     static or dynamic binding (user chooses)
     environment is not part of programs
     standardised syntax and semantics
     constructor / destructor functions - no garbage collection




Object-Oriented Software Systems Engineering – Chapter 9   Slide 22
...Comparison


  Smalltalk:
     dynamically typed (“doesNotUnderstand” message)
     dynamic binding always
     environment can confuse - part of all programs
     standardisation not really a major problem yet (ParcPlace
      and Digitalk have produced different versions)
     automatic garbage collection




Object-Oriented Software Systems Engineering – Chapter 9   Slide 23
Strengths


  C++: Systems Engineering
     portable
     quick
     large libraries
     C compatible




Object-Oriented Software Systems Engineering – Chapter 9   Slide 24
...Strengths


  Smalltalk - Rapid Prototyping & Development
     interactive
     interpreted
     easy to understand
     easy to learn
     highly integrated




Object-Oriented Software Systems Engineering – Chapter 9   Slide 25
Eiffel

 Eiffel was designed by Bertrand Meyer as a systems
   engineering language
  It has a clean, efficient design with many features
   to ensure the correctness of code:
       pre-conditions
       post-conditions
       assertions
       invariants




Object-Oriented Software Systems Engineering – Chapter 9   Slide 26
...Eiffel

  Eiffel has automatic garbage collection which can
   be programmer-controlled
  It was designed to be compatible with C library
   code, but this feature is never emphasized
  Eiffel is a proprietary language and has never had
   a good programming environment
  Like C++ there is provision for exception handlers




Object-Oriented Software Systems Engineering – Chapter 9   Slide 27
...Eiffel


  Eiffel has failed to make a major impact because:
     compatibility with C syntax is low
     it’s proprietary
     there were to few good environments




Object-Oriented Software Systems Engineering – Chapter 9   Slide 28
Eiffel Summary


  Eiffel was designed as a clean systems
    engineering language, so:

       automatic garbage collection
       static typing
       dynamic binding (but compiler can optimize to static)




Object-Oriented Software Systems Engineering – Chapter 9    Slide 29
...Eiffel Summary


       checkable assertions
       documentation tools
       “new” design with no old compatibility features
       poor backward compatibility with C




Object-Oriented Software Systems Engineering – Chapter 9   Slide 30
Java

  Java is the most trendy computer programming
   language ever
  Also the only programming language ever to make
   the front cover of Time magazine
  Likely to become the major WWW programming
   language
  Could achieve a critical mass for OOP in the as yet
   non converted industry




Object-Oriented Software Systems Engineering – Chapter 9   Slide 31
Background

  Java comes form the Oak project at Sun
    Microsystems to develop embedded applications
    and set top boxes for telecommunications
    services
  Java is a clean OO language designed for wide
    scale distribution
  Java compiles to ByteCodes which then
    interpreted by a Virtual Machine on a host
    computer (like Smalltalk 20 years ago)



Object-Oriented Software Systems Engineering – Chapter 9   Slide 32
Language features

  Syntax is based on C and C++
    “C++ without the guns, knives and clubs”: James Gosling
  However it has single inheritance, dynamic linking
   and is fully OO, more like Smalltalk than C++
  Strongly typed like C++ and Eiffel
  No (visible) pointers unlike C++ and like Smalltalk




Object-Oriented Software Systems Engineering – Chapter 9   Slide 33
Immediate Future

  Long range predictions are futile
  Java will have significant impact
  It is still fairly new
  Its popularity could cause problems if
   expectations can’t be met
  Object thinking is more important than language
  Look out for C# and .NET




Object-Oriented Software Systems Engineering – Chapter 9   Slide 34
Web

  universally employed
  first use of Web was relatively static, lacking
    component-based infrastructure
  could be standards-based infrastructure
  diverse object application models that conform to
    a core set of standards
  ActiveX components, Java and CORBA objects,
    Agents



Object-Oriented Software Systems Engineering – Chapter 9   Slide 35
Web object-based developments

  IIOP (Internet Inter-ORB Protocol) - a CORBA
   standard that defines network interfaces for OO
   applications over the Internet
  will serve as basis for Netscape ONE (Open
   Network Environment)
  will provide developers with an open standards-
   based framework for building interoperable
   Internet applications




Object-Oriented Software Systems Engineering – Chapter 9   Slide 36
Interoperability among diverse platforms

  Microsoft is member of OMG in name only so far
  never supported their standards
  Microsoft now shifting more towards Internet
  DCOM (distributed common object model) of
   Microsoft
  .NET coming




Object-Oriented Software Systems Engineering – Chapter 9   Slide 37
Benefits through Web

  support modularity, reusability and integration
  together objects plus infrastructure =
   improvements
  people are becoming object developers
  object marketplace has started up quickly
  financial services, telecommunications industries
   need: rapid deployment, reliability, modularity and
   flexibility of OT




Object-Oriented Software Systems Engineering – Chapter 9   Slide 38
Summary

 In this chapter we have:
  Introduced some Object Oriented Programming
   Languages
  Compared some aspects of these languages




Object-Oriented Software Systems Engineering – Chapter 9   Slide 39

Weitere ähnliche Inhalte

Was ist angesagt?

.Net Framwork Architecture And components
.Net Framwork Architecture And components.Net Framwork Architecture And components
.Net Framwork Architecture And componentssyedArr
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineAbdelrahman Hosny
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnetNethaji Naidu
 
Programming lesson1
Programming lesson1Programming lesson1
Programming lesson1camfollower
 
Dotnet framework
Dotnet frameworkDotnet framework
Dotnet frameworkNitu Pandey
 
C Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C ProgrammingC Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C ProgrammingTonex
 
High quality implementation for
High quality implementation forHigh quality implementation for
High quality implementation forijseajournal
 
Basic Programming Concept
Basic Programming ConceptBasic Programming Concept
Basic Programming ConceptCma Mohd
 
Programming language
Programming languageProgramming language
Programming languageMakku-Sama
 
Overview of .Net Framework 4.5
Overview of .Net Framework 4.5Overview of .Net Framework 4.5
Overview of .Net Framework 4.5Bhushan Mulmule
 
Chapter 5-programming
Chapter 5-programmingChapter 5-programming
Chapter 5-programmingAten Kecik
 
A New Paradigm In Linux Debug From Viosoft
A New Paradigm In Linux Debug From ViosoftA New Paradigm In Linux Debug From Viosoft
A New Paradigm In Linux Debug From Viosoftguestc28df4
 
La5 ict-topic-5-programming
La5 ict-topic-5-programmingLa5 ict-topic-5-programming
La5 ict-topic-5-programmingKak Yong
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programmingmshellman
 

Was ist angesagt? (20)

.Net Framwork Architecture And components
.Net Framwork Architecture And components.Net Framwork Architecture And components
.Net Framwork Architecture And components
 
A Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual MachineA Comparison of .NET Framework vs. Java Virtual Machine
A Comparison of .NET Framework vs. Java Virtual Machine
 
Intro1
Intro1Intro1
Intro1
 
Introduction to .net
Introduction to .netIntroduction to .net
Introduction to .net
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnet
 
ewili13_submission_14
ewili13_submission_14ewili13_submission_14
ewili13_submission_14
 
Programming lesson1
Programming lesson1Programming lesson1
Programming lesson1
 
Dotnet framework
Dotnet frameworkDotnet framework
Dotnet framework
 
res01
res01res01
res01
 
Prasad_CTP
Prasad_CTPPrasad_CTP
Prasad_CTP
 
C Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C ProgrammingC Programming and Coding Standards, Learn C Programming
C Programming and Coding Standards, Learn C Programming
 
High quality implementation for
High quality implementation forHigh quality implementation for
High quality implementation for
 
Basic Programming Concept
Basic Programming ConceptBasic Programming Concept
Basic Programming Concept
 
Programming language
Programming languageProgramming language
Programming language
 
Overview of .Net Framework 4.5
Overview of .Net Framework 4.5Overview of .Net Framework 4.5
Overview of .Net Framework 4.5
 
Chapter 5-programming
Chapter 5-programmingChapter 5-programming
Chapter 5-programming
 
A New Paradigm In Linux Debug From Viosoft
A New Paradigm In Linux Debug From ViosoftA New Paradigm In Linux Debug From Viosoft
A New Paradigm In Linux Debug From Viosoft
 
La5 ict-topic-5-programming
La5 ict-topic-5-programmingLa5 ict-topic-5-programming
La5 ict-topic-5-programming
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
 
Programming
ProgrammingProgramming
Programming
 

Andere mochten auch

. 4. class diagrams using uml
. 4. class diagrams using uml. 4. class diagrams using uml
. 4. class diagrams using umlAPU
 
01 introduction to_module
01 introduction to_module01 introduction to_module
01 introduction to_moduleAPU
 
. 01 introduction_to_module
. 01 introduction_to_module. 01 introduction_to_module
. 01 introduction_to_moduleAPU
 
09 abstract classesandinterfaces
09 abstract classesandinterfaces09 abstract classesandinterfaces
09 abstract classesandinterfacesAPU
 
. 9. oo languages
. 9. oo languages. 9. oo languages
. 9. oo languagesAPU
 
. 1. introduction to object orientation
. 1. introduction to object orientation. 1. introduction to object orientation
. 1. introduction to object orientationAPU
 
. 01 introduction_to_module
. 01 introduction_to_module. 01 introduction_to_module
. 01 introduction_to_moduleAPU
 
01 introduction to_module
01 introduction to_module01 introduction to_module
01 introduction to_moduleAPU
 
9. oo languages
9. oo languages9. oo languages
9. oo languagesAPU
 

Andere mochten auch (9)

. 4. class diagrams using uml
. 4. class diagrams using uml. 4. class diagrams using uml
. 4. class diagrams using uml
 
01 introduction to_module
01 introduction to_module01 introduction to_module
01 introduction to_module
 
. 01 introduction_to_module
. 01 introduction_to_module. 01 introduction_to_module
. 01 introduction_to_module
 
09 abstract classesandinterfaces
09 abstract classesandinterfaces09 abstract classesandinterfaces
09 abstract classesandinterfaces
 
. 9. oo languages
. 9. oo languages. 9. oo languages
. 9. oo languages
 
. 1. introduction to object orientation
. 1. introduction to object orientation. 1. introduction to object orientation
. 1. introduction to object orientation
 
. 01 introduction_to_module
. 01 introduction_to_module. 01 introduction_to_module
. 01 introduction_to_module
 
01 introduction to_module
01 introduction to_module01 introduction to_module
01 introduction to_module
 
9. oo languages
9. oo languages9. oo languages
9. oo languages
 

Ähnlich wie 9.oo languages

Lecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net frameworkLecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net frameworkAbdullahNadeem78
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introductionnandhu8124
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra SolutionsQUONTRASOLUTIONS
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notesWE-IT TUTORIALS
 
Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics PresentationSudhakar Sharma
 
LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxAOmaAli
 
Dotnet ch1
Dotnet ch1Dotnet ch1
Dotnet ch1007laksh
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)John Smith
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Wes Yanaga
 
01. Introduction to Programming
01. Introduction to Programming01. Introduction to Programming
01. Introduction to ProgrammingIntro C# Book
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 

Ähnlich wie 9.oo languages (20)

Lecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net frameworkLecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net framework
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introduction
 
DOTNET
DOTNETDOTNET
DOTNET
 
introduction to .net
introduction to .netintroduction to .net
introduction to .net
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
Mca 504 dotnet_unit1
Mca 504 dotnet_unit1Mca 504 dotnet_unit1
Mca 504 dotnet_unit1
 
Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics Presentation
 
T2
T2T2
T2
 
C 1
C 1C 1
C 1
 
Asp.net new
Asp.net newAsp.net new
Asp.net new
 
Programming with c#
Programming with c#Programming with c#
Programming with c#
 
Programming in c#
Programming in c#Programming in c#
Programming in c#
 
LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptx
 
Dotnet ch1
Dotnet ch1Dotnet ch1
Dotnet ch1
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)
 
Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)Intro to c# (vs. objective c and java)
Intro to c# (vs. objective c and java)
 
The Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.NetThe Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.Net
 
01. Introduction to Programming
01. Introduction to Programming01. Introduction to Programming
01. Introduction to Programming
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 

Mehr von APU

8. design patterns
8. design patterns8. design patterns
8. design patternsAPU
 
7. sequence and collaboration diagrams
7. sequence and collaboration diagrams7. sequence and collaboration diagrams
7. sequence and collaboration diagramsAPU
 
6. activity diagrams
6. activity diagrams6. activity diagrams
6. activity diagramsAPU
 
5. state diagrams
5. state diagrams5. state diagrams
5. state diagramsAPU
 
4. class diagrams using uml
4. class diagrams using uml4. class diagrams using uml
4. class diagrams using umlAPU
 
3. use cases
3. use cases3. use cases
3. use casesAPU
 
08 aggregation and collection classes
08  aggregation and collection classes08  aggregation and collection classes
08 aggregation and collection classesAPU
 
. 8. design patterns
. 8. design patterns. 8. design patterns
. 8. design patternsAPU
 
. 5. state diagrams
. 5. state diagrams. 5. state diagrams
. 5. state diagramsAPU
 
. 2. introduction to uml
. 2. introduction to uml. 2. introduction to uml
. 2. introduction to umlAPU
 
14 file handling
14 file handling14 file handling
14 file handlingAPU
 
13 gui development
13 gui development13 gui development
13 gui developmentAPU
 
10 exceptionsin java
10 exceptionsin java10 exceptionsin java
10 exceptionsin javaAPU
 
02 introductionto java
02 introductionto java02 introductionto java
02 introductionto javaAPU
 
12 multi-threading
12 multi-threading12 multi-threading
12 multi-threadingAPU
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagramsAPU
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusingumlAPU
 
Design patterns structuralpatterns(thedecoratorpattern)
Design patterns structuralpatterns(thedecoratorpattern)Design patterns structuralpatterns(thedecoratorpattern)
Design patterns structuralpatterns(thedecoratorpattern)APU
 
Design patterns structuralpatterns(theadapterpattern)
Design patterns structuralpatterns(theadapterpattern)Design patterns structuralpatterns(theadapterpattern)
Design patterns structuralpatterns(theadapterpattern)APU
 

Mehr von APU (19)

8. design patterns
8. design patterns8. design patterns
8. design patterns
 
7. sequence and collaboration diagrams
7. sequence and collaboration diagrams7. sequence and collaboration diagrams
7. sequence and collaboration diagrams
 
6. activity diagrams
6. activity diagrams6. activity diagrams
6. activity diagrams
 
5. state diagrams
5. state diagrams5. state diagrams
5. state diagrams
 
4. class diagrams using uml
4. class diagrams using uml4. class diagrams using uml
4. class diagrams using uml
 
3. use cases
3. use cases3. use cases
3. use cases
 
08 aggregation and collection classes
08  aggregation and collection classes08  aggregation and collection classes
08 aggregation and collection classes
 
. 8. design patterns
. 8. design patterns. 8. design patterns
. 8. design patterns
 
. 5. state diagrams
. 5. state diagrams. 5. state diagrams
. 5. state diagrams
 
. 2. introduction to uml
. 2. introduction to uml. 2. introduction to uml
. 2. introduction to uml
 
14 file handling
14 file handling14 file handling
14 file handling
 
13 gui development
13 gui development13 gui development
13 gui development
 
10 exceptionsin java
10 exceptionsin java10 exceptionsin java
10 exceptionsin java
 
02 introductionto java
02 introductionto java02 introductionto java
02 introductionto java
 
12 multi-threading
12 multi-threading12 multi-threading
12 multi-threading
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagrams
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusinguml
 
Design patterns structuralpatterns(thedecoratorpattern)
Design patterns structuralpatterns(thedecoratorpattern)Design patterns structuralpatterns(thedecoratorpattern)
Design patterns structuralpatterns(thedecoratorpattern)
 
Design patterns structuralpatterns(theadapterpattern)
Design patterns structuralpatterns(theadapterpattern)Design patterns structuralpatterns(theadapterpattern)
Design patterns structuralpatterns(theadapterpattern)
 

9.oo languages

  • 1. OO Languages Chapter 9 Object-Oriented Software Systems Engineering – Chapter 9 Slide 1
  • 2. Objectives In this chapter we will:  Introduce some Object Oriented Programming Languages  Compare some aspects of these languages Object-Oriented Software Systems Engineering – Chapter 9 Slide 2
  • 3. Major OOPL  Four of the major Object Oriented Programming languages are: C++ Smalltalk Eiffel Java Object-Oriented Software Systems Engineering – Chapter 9 Slide 3
  • 4. Smalltalk  Smalltalk was for most purposes the first object- oriented language, although it was based on ideas first developed in a simulation language called Simula in the 1960s  Smalltalk was designed to support a (then) radically new type of user interface - the graphical user interface Object-Oriented Software Systems Engineering – Chapter 9 Slide 4
  • 5. Smalltalk environment  Then Smalltalk was synonymous with GUIs - now they are commonplace  Smalltalk’s environment is graphical, based on windows and browsers, and is controlled by a pointing device Object-Oriented Software Systems Engineering – Chapter 9 Slide 5
  • 6. Environment...  The development environment is an integral part of Smalltalk, and all aspects of it are available for inspection and change within a running Smalltalk system, conversely a Smalltalk system can be extended by writing new classes which are then available in the environment for immediate use, so it is possible to add your own code-writing or debugging tools, although these are already present in Smalltalk Object-Oriented Software Systems Engineering – Chapter 9 Slide 6
  • 7. ...Environment  Smalltalk has several classes of interactive code writing and debugging tools. They are:  Class Hierarchy Browser  Class Browser  Workspace  System Transcript  Disk Browser  Walkback; Debugger Object-Oriented Software Systems Engineering – Chapter 9 Slide 7
  • 8. Environment Classes  System Transcript:  reports events in the system as they occur  Class Hierarchy Browser  allows users to browse, edit, and add new classes to the running system  Workspace  allows users to edit and evaluate expressions and displays the results Object-Oriented Software Systems Engineering – Chapter 9 Slide 8
  • 9. Debugging  Whenever an error occurs Smalltalk displays a window containing a “walkback” (=backtrace) which shows the messages that led to the error  It is possible to resume or to start an interactive debugging tool to trace messages through the objects leading up to the error  Objects can also initiate error recovery whenever a message they send is not understood by the receiver Object-Oriented Software Systems Engineering – Chapter 9 Slide 9
  • 10. Smalltalk Summary  Designed for interactive and extensible use, therefore:  environment is available for modification and extension  language is semi-compiled then interpreted  has dynamic binding and  dynamic typing Object-Oriented Software Systems Engineering – Chapter 9 Slide 10
  • 11. Smalltalk Summary  everything is an object  conceptually consistent  run-time error recovery  well-integrated debugging facilities  “clean” design to support quick learning  automatic garbage collection for ease of use Object-Oriented Software Systems Engineering – Chapter 9 Slide 11
  • 12. C++  C++ is not tightly integrated with its development environment and aspects of the environment are not usually available to the programmer  Unlike Smalltalk it is compiled, and so is much less interactive, all changes and evaluations being made in the traditional edit-compile-execute cycle Object-Oriented Software Systems Engineering – Chapter 9 Slide 12
  • 13. C++  C++ was designed as a production software language, so much of it is designed to be fast at the expense of simplicity Object-Oriented Software Systems Engineering – Chapter 9 Slide 13
  • 14. C++ Programming  C++ is a hybrid of two languages, C and an object- oriented extension - so it can also accept existing C programs  C++ has been used to “object-orientize” existing C programs, a major factor in its popularity  But this means that it is harder to use than Smalltalk because the language is much more complex Object-Oriented Software Systems Engineering – Chapter 9 Slide 14
  • 15. C++ Error Handling  C++ can handle run-time errors by writing exception handlers which trap and deal with the error  They fulfill a role similar to that of the “doesNotUnderstand” message in Smalltalk, although in C++ an object can never fail to understand a message because C++ is statically typed Object-Oriented Software Systems Engineering – Chapter 9 Slide 15
  • 16. C++ Environment  A typical C++ environment contains program editing, debugging (tracing and breakpointing) and library facilities  Debugging tools depend on what the vendor can supply - there is no standard - but many good debugging and single-stepping tools are available (e.g. Borland C++) Object-Oriented Software Systems Engineering – Chapter 9 Slide 16
  • 17. C++ Environment  Libraries are also non-standard, although many libraries conform closely to a de-facto standard Object-Oriented Software Systems Engineering – Chapter 9 Slide 17
  • 18. C++ Summary  C++ was designed for production programming and to be compatible with C:  compiled for speed of execution  not very interactive  strong static typing to catch programming errors before execution Object-Oriented Software Systems Engineering – Chapter 9 Slide 18
  • 19. C++ Summary continued  choice of static / dynamic binding for speed => confusion  debugging less well integrated, though often good  special run-time error recovery mechanism = exceptions  “dirty” design to support existing C code + OO extensions  constructor and destructor functions to speed up object creation and deletion Object-Oriented Software Systems Engineering – Chapter 9 Slide 19
  • 20. Comparison  C++:  edit-compile-execute  compiled (interpreters exist)  language separate from environment  many variations of environment from different vendors  widely ported to different platforms Object-Oriented Software Systems Engineering – Chapter 9 Slide 20
  • 21. ...Comparison  Smalltalk:  interactive  interpreted (compilers exist)  language integrated with environment  only one vendor  limited number of hardware platforms Object-Oriented Software Systems Engineering – Chapter 9 Slide 21
  • 22. ...Comparison  C++:  statically typed  static or dynamic binding (user chooses)  environment is not part of programs  standardised syntax and semantics  constructor / destructor functions - no garbage collection Object-Oriented Software Systems Engineering – Chapter 9 Slide 22
  • 23. ...Comparison  Smalltalk:  dynamically typed (“doesNotUnderstand” message)  dynamic binding always  environment can confuse - part of all programs  standardisation not really a major problem yet (ParcPlace and Digitalk have produced different versions)  automatic garbage collection Object-Oriented Software Systems Engineering – Chapter 9 Slide 23
  • 24. Strengths  C++: Systems Engineering  portable  quick  large libraries  C compatible Object-Oriented Software Systems Engineering – Chapter 9 Slide 24
  • 25. ...Strengths  Smalltalk - Rapid Prototyping & Development  interactive  interpreted  easy to understand  easy to learn  highly integrated Object-Oriented Software Systems Engineering – Chapter 9 Slide 25
  • 26. Eiffel Eiffel was designed by Bertrand Meyer as a systems engineering language  It has a clean, efficient design with many features to ensure the correctness of code:  pre-conditions  post-conditions  assertions  invariants Object-Oriented Software Systems Engineering – Chapter 9 Slide 26
  • 27. ...Eiffel  Eiffel has automatic garbage collection which can be programmer-controlled  It was designed to be compatible with C library code, but this feature is never emphasized  Eiffel is a proprietary language and has never had a good programming environment  Like C++ there is provision for exception handlers Object-Oriented Software Systems Engineering – Chapter 9 Slide 27
  • 28. ...Eiffel  Eiffel has failed to make a major impact because:  compatibility with C syntax is low  it’s proprietary  there were to few good environments Object-Oriented Software Systems Engineering – Chapter 9 Slide 28
  • 29. Eiffel Summary  Eiffel was designed as a clean systems engineering language, so:  automatic garbage collection  static typing  dynamic binding (but compiler can optimize to static) Object-Oriented Software Systems Engineering – Chapter 9 Slide 29
  • 30. ...Eiffel Summary  checkable assertions  documentation tools  “new” design with no old compatibility features  poor backward compatibility with C Object-Oriented Software Systems Engineering – Chapter 9 Slide 30
  • 31. Java  Java is the most trendy computer programming language ever  Also the only programming language ever to make the front cover of Time magazine  Likely to become the major WWW programming language  Could achieve a critical mass for OOP in the as yet non converted industry Object-Oriented Software Systems Engineering – Chapter 9 Slide 31
  • 32. Background  Java comes form the Oak project at Sun Microsystems to develop embedded applications and set top boxes for telecommunications services  Java is a clean OO language designed for wide scale distribution  Java compiles to ByteCodes which then interpreted by a Virtual Machine on a host computer (like Smalltalk 20 years ago) Object-Oriented Software Systems Engineering – Chapter 9 Slide 32
  • 33. Language features  Syntax is based on C and C++ “C++ without the guns, knives and clubs”: James Gosling  However it has single inheritance, dynamic linking and is fully OO, more like Smalltalk than C++  Strongly typed like C++ and Eiffel  No (visible) pointers unlike C++ and like Smalltalk Object-Oriented Software Systems Engineering – Chapter 9 Slide 33
  • 34. Immediate Future  Long range predictions are futile  Java will have significant impact  It is still fairly new  Its popularity could cause problems if expectations can’t be met  Object thinking is more important than language  Look out for C# and .NET Object-Oriented Software Systems Engineering – Chapter 9 Slide 34
  • 35. Web  universally employed  first use of Web was relatively static, lacking component-based infrastructure  could be standards-based infrastructure  diverse object application models that conform to a core set of standards  ActiveX components, Java and CORBA objects, Agents Object-Oriented Software Systems Engineering – Chapter 9 Slide 35
  • 36. Web object-based developments  IIOP (Internet Inter-ORB Protocol) - a CORBA standard that defines network interfaces for OO applications over the Internet  will serve as basis for Netscape ONE (Open Network Environment)  will provide developers with an open standards- based framework for building interoperable Internet applications Object-Oriented Software Systems Engineering – Chapter 9 Slide 36
  • 37. Interoperability among diverse platforms  Microsoft is member of OMG in name only so far  never supported their standards  Microsoft now shifting more towards Internet  DCOM (distributed common object model) of Microsoft  .NET coming Object-Oriented Software Systems Engineering – Chapter 9 Slide 37
  • 38. Benefits through Web  support modularity, reusability and integration  together objects plus infrastructure = improvements  people are becoming object developers  object marketplace has started up quickly  financial services, telecommunications industries need: rapid deployment, reliability, modularity and flexibility of OT Object-Oriented Software Systems Engineering – Chapter 9 Slide 38
  • 39. Summary In this chapter we have:  Introduced some Object Oriented Programming Languages  Compared some aspects of these languages Object-Oriented Software Systems Engineering – Chapter 9 Slide 39

Hinweis der Redaktion

  1. 1