Download presentation
Presentation is loading. Please wait.
1
A Survey of Object Orientation in Z
By Susan Stepney, Rosalind Barden and David Cooper Software Engineering Journal March, 1992 Presentation prepared by Khandoker Rahad
2
Motivation Formal specification and object orientation is very essential in software industry. In this paper object oriented structuring to Z is emphasized. Z is a popular formal specifications language. There are some problems with Z . It does not provide any support in building the state and operations into a class definition. It also does not specify inheritance. 1.Hall’s style 2. Schuman and pitt’s variant 3. Object Z
3
Continue Other approaches Z and HOOD, OOZE, whysall’s approach,z++,mooz. Z can be defined as object oriented systems because it has state and it’s operation can be defined with the changes of state. In this paper structuring aspects of object oriented approach is emphasized.
4
Example in Z A example is chosen here for three approaches. Different sorts of quadrilaterals are shown as a example. The hierarchy of classes is given below. Quadrilaterals Parallelogram Rhombus Rectangle Square
5
The edges of general four sided figure can be specified by a sequence of four vectors . The summation would be zero.
6
edge
8
Rectangle Square
9
For drawing package the position of the quadrilateral is needed
10
Disadvantages The style used here is to include all possible state variables for all objects in the class hierarchy whether it is relevant or not. A new sub class with new state variable the state associated with every object in the hierarchy would be changed. If someone adds new subclass then it needs to be update every operation When there will be more states and more operations this style would be clumsy. Every time when we will need new figure we have to add it in kind analysis.
11
Hall’s style Hall introduced some conventions for an object oriented specification style. It is theoretical base style. It does not extends Z.
12
Continue Hall discusses the way in which this approach contrast with the conventional approach of specification. He also ensures for support in inheritance in near future. In describing the state we can see the way in which the object oriented approach of giving self property is used and how the use of functions ensures the uniqueness of different objects. A figure is defined using an identifier(self notion)
13
Operation on figure Here we will see the methods for defining operations in terms of single objects and calculating their effects on the system. Operation on figure does not change the self component
14
Adding a new figure At the time of adding a new figure to the drawing system , it’s feature must be set at first. Again when a new figure object is added to the system, it must have an identifier which would be different from the existing one identifier.
15
Hall’s style There are five main features.
Convention for modeling object Use of object identities to refer object Convention to express state of a system in terms of objects Use of object identities to model object relationship Method of defining operations in terms of single object
16
Schuman and pitt’s variant
This notion is described as object-oriented. This approach is useful for specifying systems that consist of several Small states, operated on local operations and combine together to form the total system state. A state schema has three parts.
17
Continue Operation schemas also have three components input and output parameter declarations, the precondition predicate, post condition predicate. The name of an operation schema would be the name of the state schema followed by the operation name The corresponding state component declarations and state invariant predicate are implicitly included in operation schema.
18
Continue State schema Operation schema
19
Continue It can be inherit from the general Quadrilateral to obtain a parallelogram by adding relevant extra constraints. For example.
20
Advantage of schuman and pitt’s variant over Z
Better Support for object orientation. Schema naming convention for operation like state.operation binds operation to the relevant state. Everything else stays the same semantics for operations different from the plain Z.
21
Object-z Object-Z extendts Z by introducing class.
Classes which refers to state and operations can be inherited from other classes. In Z a class is defined as
22
Continue The inherited classes are the name of the super class and the subclass incorporate al the features of its superclass. The local constants can not be changed by any other operations.
23
The class quadrilateral
24
Class Parallelogram Class parallelogram inherits quadrilateral and the operation move and shear. There is also extra constraint on its edges.
25
Advantages of Object-Z
Class definition mechanism that directly bind together with relevant state. Inheritance mechanism Some conventions and new symbols to support defining new operations in terms of instance variables. The delta list giving an everything else stays the same style making operations definition concise.
26
Comparison of three approaches
Hall’s Style Schuman and Pitt’s variant Object-Z A style for using unchanged Z Better support for Object Orientation Fully object oriented Object identities are used Approximately class based It has classes and inheritance
27
THANK YOU!!!!!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.