1 The Design of Class Mechanism for MOBY. 2 Earlier Software designers have to choose between the following schemes for the development Earlier Software.

Slides:



Advertisements
Similar presentations
Stereotypes Stereotypes provide the capability to create a new kind of modeling element. –They can be used to classify or mark modeling elements. –A type.
Advertisements

Inheritance Inheritance Reserved word protected Reserved word super
Sadegh Aliakbary Sharif University of Technology Fall 2010.
UML – Class Diagrams.
1 Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 8.1 – 8.5.
1 Lecture 3 Inheritance. 2 A class that is inherited is called superclass The class that inherits is called subclass A subclass is a specialized version.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 Chapter 6 Inheritance, Interfaces, and Abstract Classes.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
CS 2511 Fall Features of Object Oriented Technology  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance.
CS 2511 Fall  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance  Polymorphism.
Chapter 10 Classes Continued
Abstract Data Types and Encapsulation Concepts
8.1 Classes & Inheritance Inheritance Objects are created to model ‘things’ Sometimes, ‘things’ may be different, but still have many attributes.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CC1007NI: Further Programming Week Dhruba Sen Module Leader (Islington College)
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Java Classes, Interfaces, and Types 1.
Chapter 6 Class Inheritance F Superclasses and Subclasses F Keywords: super F Overriding methods F The Object Class F Modifiers: protected, final and abstract.
OOPs Object oriented programming. Based on ADT principles  Representation of type and operations in a single unit  Available for other units to create.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
1 Object-Oriented Software Engineering CS Interfaces Interfaces are contracts Contracts between software groups Defines how software interacts with.
Object Oriented Programming: Java Edition By: Samuel Robinson.
Inheritance. Introduction Inheritance is one of the cornerstones of object-oriented programming because it allows the creation of hierarchical classifications.
CS212: Object Oriented Analysis and Design Lecture 15: Inheritance in C++ -II.
Inheritance in the Java programming language J. W. Rider.
Designing Classes Prelude © 2015 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures and Abstractions with Java, 4e Frank.
8. Inheritance “Is-a” Relationship. Topics Creating Subclasses Overriding Methods Class Hierarchies Abstract Class Inheritance and GUIs The Timer Class.
Lecture 10 Concepts of Programming Languages Arne Kutzner Hanyang University / Seoul Korea.
Introduction to Java Chapter 7 - Classes & Object-oriented Programming1 Chapter 7 Classes and Object-Oriented Programming.
OOPs Object oriented programming. Abstract data types  Representationof type and operations in a single unit  Available for other units to create variables.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 9 Java Fundamentals Objects/ClassesMethods Mon.
1 Chapter 11 © 1998 by Addison Wesley Longman, Inc The Concept of Abstraction - The concept of abstraction is fundamental in programming - Nearly.
1 CS Programming Languages Class 22 November 14, 2000.
1 Copyright © 1998 by Addison Wesley Longman, Inc. Chapter 10 Abstraction - The concept of abstraction is fundamental in programming - Nearly all programming.
Abstract Classes and Interfaces Week 17.  Computer simulations  Abstract methods  Abstract classes  Interfaces  Multiple inheritance Abstract Classes.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Inheritance Inheritance is the process of extending the functionality of a class by defining a new class that inherit,all the features of extending class.
Classes, Interfaces and Packages
Programming in java Packages Access Protection Importing packages Java program structure Interfaces Why interface Defining interface Accessing impln thru.
Access Specifier. Anything declared public can be accessed from anywhere. Anything declared private cannot be seen outside of its class. When a member.
4. The procedural extension Java c of Java I pslab 김윤경.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
C++ General Characteristics: - Mixed typing system - Constructors and destructors - Elaborate access controls to class entities.
CSC 243 – Java Programming, Spring, 2014 Week 4, Interfaces, Derived Classes, and Abstract Classes.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 10 Java Fundamentals Objects/ClassesMethods.
1 Inheritance One of the goals of object oriented programming is code reuse. Inheritance is one mechanism for accomplishing code reuse. It allows us to.
CSC 243 – Java Programming, Fall, 2008 Tuesday, September 30, end of week 5, Interfaces, Derived Classes, and Abstract Classes.
Lecture 6:Interfaces and Abstract Classes Michael Hsu CSULA.
Geoff Holmes and Bernhard Pfahringer COMP206-08S General Programming 2.
Modern Programming Tools And Techniques-I
Advanced Programming in Java
Advanced Programming in Java
Lecture 12 Inheritance.
Inheritance and Polymorphism
Inheritance "Question: What is the object oriented way of getting rich? Answer: Inheritance.“ “Inheritance is new code that reuses old code. Polymorphism.
Modern Programming Tools And Techniques-I Inheritance
Abstract Data Types and Encapsulation Concepts
CS240: Advanced Programming Concepts
Interface.
Packages and Interfaces
More Object-Oriented Programming
Java – Inheritance.
Java Programming, Second Edition
Advanced Programming in Java
AP Computer Science DYRT Quiz
Inheritance Lakshmish Ramaswamy.
11.1 The Concept of Abstraction
Chapter 11 Abstraction - The concept of abstraction is fundamental in
Presentation transcript:

1 The Design of Class Mechanism for MOBY

2 Earlier Software designers have to choose between the following schemes for the development Earlier Software designers have to choose between the following schemes for the development – Class rich languages like C++ or JAVA. –Module rich languages like Standard ML.

3 Paper describes the design of the class mechanism with a richer module system –C++ and JAVA has the rich class mechanisms but week module system –Standard ML has rich Module System but lack Class Mechanism –Moby provides both rich Class and Module Mechanism

4 Class in the class mechanism has two roles : Implementing Objects Supporting inheritance Based on the above roles class have two type of Clients: Object Client Class Client

5 MOBY : It is a ML-like language that supports Class bases mechanisms. MOBY has three mechanism to cover the features of class based languages. –Objects and Object Types. –Classes and Class Interfaces. –Modules and Module Signature.

6 Objects Object in MOBY are collection of fields and methods. Member of Objects: fields + Methods Operations on Objects: »Select a field »Update a field »Invoke a method

7 Object Type specifies which object members client may use. Object Types are nothing but are interfaces of JAVA. Object Type

8 Objtype Point{ meth getX : Uint->Int meth move:Int ->Point } Objtype CPoint extends Point with { meth getC : Uint->Color meth shade:Color ->CPoint }

9 Typing Typing in the MOBY is structural rather than Name Subtyping as in JAVA. Structural Subtyping has several variants: –Width Subtyping –Depth Subtyping –Full Subtyping

10 Modules n Modules in Moby are like ML-Style languages. n Signature Controls the Visibility of the definitions outside the Modules. n Modules may be nested. n Partial type revelation can be defined in signatures. type type-name <: type

11 Module PointTypes:{ objtype Point{ meth getX : Uint->Int meth getX : Uint->Int meth move : Int ->Point meth move : Int ->Point} Type CPoint <: Point }{ ………body of the PointTypes }

12 MOBY Class n Defines the implementation of object n It contains the declaration of: –fields –Method –Makers (which are constructors in C++ or JAVA)

13

14 Class interface n It is a signature of the class n It is not interfaces as in JAVA. n It defines both object and class view.

15

16 Visibility n Internal Class View n External Class View n Internal Object View n External Object View

17

18

19 Class based features are realized in MOBY: n Static Class Members MOBY relies on Module system to support global definition. n C++ private inheritance : In MOBY Object Type implemented by subclass is independent of the Object Type implemented by its super class.

20 n JAVA’s interfaces and C++’s multiple inheritance with abstract base classes: MOBY has the Structural sub typing relationship. n Final Classes: We can have this by hiding the class in a module and We can have this by hiding the class in a module and controlling the visibility of its methods. n C++ friends and JAVA’s package scope: MOBY uses the combination of modules and partial type revelation