1 / 20

The Design of Class Mechanism for MOBY

The Design of Class Mechanism for MOBY. 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. Paper describes the design of the class mechanism with a richer module system

vidal
Download Presentation

The Design of Class Mechanism for MOBY

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Design of Class Mechanism for MOBY

  2. 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 Object Type specifies which object members client may use. Object Types are nothing but are interfaces of JAVA.

  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 • Modules in Moby are like ML-Style languages. • Signature Controls the Visibility of the definitions outside the Modules. • Modules may be nested . • Partial type revelation can be defined in signatures. type type-name <: type

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

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

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

  14. Visibility • Internal Class View • External Class View • Internal Object View • External Object View

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

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

More Related