Comparative Programming Languages CM20253

Comparative Programming Languages CM20253

And two kinds of object: classes and non-classes We can make instances of classes, but not of non-classes Other kinds of OO dispense with one or both of these relationships Or one of these kinds of object: the classes Object Oriented Languages So there are two kinds of relationships between objects: instance and inherits We can make instances of classes, but not of non-classes Other kinds of OO dispense with one or both of these relationships Or one of these kinds of object: the classes Object Oriented Languages So there are two kinds of relationships between objects: instance and inherits And two kinds of object: classes and non-classes Other kinds of OO dispense with one or both of these relationships Or one of these kinds of object: the classes Object Oriented Languages So there are two kinds of relationships between objects: instance and inherits And two kinds of object: classes and non-classes We can make instances of classes, but not of non-classes Or one of these kinds of object: the classes Object Oriented Languages So there are two kinds of relationships between objects: instance and inherits And two kinds of object: classes and non-classes We can make instances of classes, but not of non-classes Other kinds of OO dispense with one or both of these relationships Object Oriented Languages So there are two kinds of relationships between objects: instance and inherits And two kinds of object: classes and non-classes We can make instances of classes, but not of non-classes Other kinds of OO dispense with one or both of these relationships Or one of these kinds of object: the classes Object Oriented Languages Exercise. For Java, C++, Common Lisp, EuLisp and any others determine their initial class hierarchy Exercise. In this picture, determine which are instance links and which are inheritance links! Object Oriented Languages Kinds of OO Language object oriented class centred object centred fixed protocol metaobject protocol prototypingdelegation traits C++ Java Smalltalk Lisp Javascript Self Rust Note: non-exclusive properties Object Oriented Languages Kinds of OO Language object oriented class centred object centred fixed protocol metaobject protocol prototypingdelegation traits C++ Java Smalltalk Lisp Javascript Self Rust Note: non-exclusive properties Exercise. In this picture, determine which are instance links and which are inheritance links! The basic idea is the use of encapsulation of state within an object And things like classes and inheritance are not a fundamental part of being object oriented Of course, these variants came about through lots of research and experimentation and have varying levels of success As always, it’s not a case of what is better, more what is better for the application in hand Object Oriented Languages There is a wide variety of things that like to be called OO And things like classes and inheritance are not a fundamental part of being object oriented Of course, these variants came about through lots of research and experimentation and have varying levels of success As always, it’s not a case of what is better, more what is better for the application in hand Object Oriented Languages There is a wide variety of things that like to be called OO The basic idea is the use of encapsulation of state within an object Of course, these variants came about through lots of research and experimentation and have varying levels of success As always, it’s not a case of what is better, more what is better for the application in hand Object Oriented Languages There is a wide variety of things that like to be called OO The basic idea is the use of encapsulation of state within an object And things like classes and inheritance are not a fundamental part of being object oriented As always, it’s not a case of what is better, more what is better for the application in hand Object Oriented Languages There is a wide variety of things that like to be called OO The basic idea is the use of encapsulation of state within an object And things like classes and inheritance are not a fundamental part of being object oriented Of course, these variants came about through lots of research and experimentation and have varying levels of success Object Oriented Languages There is a wide variety of things that like to be called OO The basic idea is the use of encapsulation of state within an object And things like classes and inheritance are not a fundamental part of being object oriented Of course, these variants came about through lots of research and experimentation and have varying levels of success As always, it’s not a case of what is better, more what is better for the application in hand Examples include C++, Java, Lisp, Smalltalk . Typified by • classes (first-class or not first-class) • instances of those classes • methods attached to classes or generic function objects, shared by instances • attributes/slots/values defined in classes, attached to instances (or classes) • single or multiple inheritance defined through the relationships between the classes Object Oriented Languages Class Centred Class Centred is by far the most well-known form of OO, and what many people think is all of OO Typified by • classes (first-class or not first-class) • instances of those classes • methods attached to classes or generic function objects, shared by instances • attributes/slots/values defined in classes, attached to instances (or classes) • single or multiple inheritance defined through the relationships between the classes Object Oriented Languages Class Centred Class Centred is by far the most well-known form of OO, and what many people think is all of OO Examples include C++, Java, Lisp, Smalltalk . • classes (first-class or not first-class) • instances of those classes • methods attached to classes or generic function objects, shared by instances • attributes/slots/values defined in classes, attached to instances (or classes) • single or multiple inheritance defined through the relationships between the classes Object Oriented Languages Class Centred Class Centred is by far the most well-known form of OO, and what many people think is all of OO Examples include C++, Java, Lisp, Smalltalk . Typified by • instances of those classes • methods attached to classes or generic function objects, shared by instances • attributes/slots/values defined in classes, attached to instances (or classes) • single or multiple inheritance defined through the relationships between the classes Object Oriented Languages Class Centred Class Centred is by far the most well-known form of OO, and what many people think is all of OO Examples include C++, Java, Lisp, Smalltalk . Typified by • classes (first-class or not first-class) • methods attached to classes or generic function objects, shared by instances • attributes/slots/values defined in classes, attached to instances (or classes) • single or multiple inheritance defined through the relationships between the classes Object Oriented Languages Class Centred Class Centred is by far the most well-known form of OO, and what many people think is all of OO Examples include C++, Java, Lisp, Smalltalk . Typified by • classes (first-class or not first-class) • instances of those classes • attributes/slots/values defined in classes, attached to instances (or classes) • single or multiple inheritance defined through the relationships between the classes Object Oriented Languages Class Centred Class Centred is by far the most well-known form of OO, and what many people think is all of OO Examples include C++, Java, Lisp, Smalltalk . Typified by • classes (first-class or not first-class) • instances of those classes • methods attached to classes or generic function objects, shared by instances • single or multiple inheritance defined through the relationships between the classes Object Oriented Languages Class Centred Class Centred is by far the most well-known form of OO, and what many people think is all of OO Examples include C++, Java, Lisp, Smalltalk . Typified by • classes (first-class or not first-class) • instances of those classes • methods attached to classes or generic function objects, shared by instances • attributes/slots/values defined in classes, attached to instances (or classes) Object Oriented Languages Class Centred Class Centred is by far the most well-known form of OO, and what many people think is all of OO Examples include C++, Java, Lisp, Smalltalk . Typified by • classes (first-class or not first-class) • instances of those classes • methods attached to classes or generic function objects, shared by instances • attributes/slots/values defined in classes, attached to instances (or classes) • single or multiple inheritance defined through the relationships between the classes • For data: attribute, state, slot, member, value, element, variant, structure • For code: method, behaviour, action, message Be aware of these variations! Object Oriented Languages Brief aside There is a lot of variation on terminology that reflects the many ways people think about OO • For code: method, behaviour, action, message Be aware of these variations! Object Oriented Languages Brief aside There is a lot of variation on terminology that reflects the many ways people think about OO • For data: attribute, state, slot, member, value, element, variant, structure Be aware of these variations! Object Oriented Languages Brief aside There is a lot of variation on terminology that reflects the many ways people think about OO • For data: attribute, state, slot, member, value, element, variant, structure • For code: method, behaviour, action, message Object Oriented Languages Brief aside There is a lot of variation on terminology that reflects the many ways people think about OO • For data: attribute, state, slot, member, value, element, variant, structure • For code: method, behaviour, action, message Be aware of these variations! The object receiver view of the world has a single object receiving a message, such as x.plus(y), and chooses a method depending on the type of a single object (x in this case) This is the familiar “object dot method name” syntax Object Oriented Languages Class Centred OO languages are occasionally further divided by how they do methods • object receiver: Java, C++,..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    50 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us