skip to main content
research-article
Open access

Graph transformations for object-oriented refinement

Published: 01 February 2009 Publication History

Abstract

An object-oriented program consists of a section of class declarations and a main method. The class declaration section represents the structure of an object-oriented program, that is the data, the classes and relations among them. The execution of the main method realizes the application by invoking methods of objects of the classes defined in the class declarations. Class declarations define the general properties of objects and how they collaborate with each other in realizing the application task programmed as the main method. Note that for one class declaration section, different main methods can be programmed for different applications, and this is an important feature of reuse in object-oriented programming. On the other hand, different class declaration sections may support the same applications, but these different class declaration sections can make significant difference with regards to understanding, reuse and maintainability of the applications. With a UML-like modeling language, the class declaration section of a program is represented as a class diagram, and the instances of the class diagram are represented by object diagrams, that form the state space of the program. In this paper, we define a class diagram and its object diagrams as directed labeled graphs, and investigate what changes in the class structure maintain the capability of providing functionalities (or services). We formalize such a structure change by the notion of structure refinement. A structure refinement is a transformation from one graph to another that preserves the capability of providing services, that is, the resulting class graph should be able to provide at least as many, and as good, services (in terms of functional refinement) as the original graph. We then develop a calculus of object-oriented refinement, as an extension to the classical theory of data refinement, in which the refinement rules are classified into four categories according to their natures and uses in object-oriented software design. The soundness of the calculus is proved and the completeness of the refinement rules of each category is established with regard to normal forms defined for object-oriented programs. These completeness results show the power of the simple refinement rules. The normal forms and the completeness results together capture the essence of polymorphism, dynamic method binding and object sharing by references in object-oriented computation.

References

References

[1]
Abadi M and Cardeli L A theory of objects 1996 Heidelberg Springer
[2]
America P and de Boer F Reasoning about dynamically evolving process structures Form Aspects Comput 1994 6 3 269-316
[3]
Abadi M and Leino R Bidoit M and Dauchet M A logic of object-oriented programs TAPSOFT ’97: theory and practice of software development, 7th international joint conference 1997 Heidelberg Springer 682-696
[4]
Baresi L, Heckel R, Thöne S, Varró D (2003) Modeling and validation of service-oriented architectures: Application vs. style. In: Proceedings of ESEC/FSE 03 European software engineering conference and ACM SIGSOFT symposium on the foundations of software engineering. ACM Press, pp 68–77
[5]
Baresi L, Heckel R, Thöne S, Varró D (2004) Style-based refinement of dynamic software architectures. In: WICSA ’04: Proceedings of the fourth working IEEE/IFIP conference on software architecture (WICSA’04). IEEE Computer Society, Washington DC, pp 155–164
[6]
Back R, Mikhajlova A, and von Wright J Class refinement as semantics of correct object substitutability Form Aspects Comput 2000 2 18-40
[7]
Booch G, Rumbaugh J, and Jacobson I The unified modelling language user guide 1999 Reading Addison-Wesley
[8]
Borba P, Sampaio A, and Cornelio M Cardelli L A refinement algebra for object-oriented programming Proceedings of ECOOP 2003, Lecture Notes in Computer Science 2743 2003 Heidelberg Springer 457-482
[9]
Back R and von Wright LJ Refinement calculus 1998 Heidelberg Springer
[10]
Cook S and Daniels J Designing object systems: object-oriented modelling with syntropy 1994 Englewood Cliffs Prentice-Hall
[11]
Chen Z, Hannousse AH, Van Hung D, Knoll I, Li X, Liu Y, Liu Z, Nan Q, Okika J, Ravn AP, Stolz V, Yang L, Zhan N (2007) Modelling with relational calculus of object and component systems-rCOS. In: The common component modeling example: comparing software component models. Springer, Heidelberg (To be published as a Chapter of a Volume of Lecture Notes in Computer Science)
[12]
Chen Y, Sanders J (2006) Compositional reasoning for pointer structures. In: Proceedings of 8th international conference on mathematics of program construction (MPC06), Lecture Notes in Computer Science, vol 4014. Springer, Heidelberg, pp 115–139
[13]
Corradini A, Montanari U, and Rossi F Graph processes Fundam Inf 1996 26 3,4 241-265
[14]
Cavalcanti A, Naumann D (1999) A weakest precondition semantics for an object-oriented language of refinement. In: World congress on formal methods (2), Lecture Notes in Computer Science, vol 1709. Springer, Heidelberg, pp 1439–1460
[15]
Coleman D et al. Object-oriented development: the FUSION method 1994 Englewood Cliffs Prentice-Hall
[16]
Dürr E, Dusink EM (1993) The role of VDM++ in the development of a real-time tracking and tracing system. In: Woodcock J, Larsen P (eds) Proceedings of FME’93, Lecture Notes in Computer Science, vol 670. Springer, Heidelberg
[17]
Rozenberg G (ed) (1997) Handbook of graph grammars and computing by graph transformation, vol 1, Foundations World Scientific
[18]
Ehrig H, Ehrig K, Prange U, and Taentzer G Fundamental theory for typed attributed graphs and graph transformation based on adhesive HLR categories Fundam Inf 2006 74 1 31-61
[19]
Engels G, Hausmann JH, Heckel R, Sauer S (2000) Dynamic meta modeling: a graphical approach to the operational semantics of behavioral diagrams in uml. In: Proceedings of UML 2000, The unified modeling language, Lecture Notes in Computer SCience, vol 1939. Springer, Heidelberg, pp 323–337
[20]
Gheyi R, Massoni T, and Borba P An abstract equivalence notation for object models Electron Note Theor Comput Sci 2004 130 3-21
[21]
Große-Rhode M, Parisi-Presicce F, Simeoni M (1998) Spatial and temporal refinement of typed graph transformation systems. In: Proceedings of mathematical foundations of computer science, Lecture Notes in Computer Science, vol 1450. Springer, Heidelberg, pp 553–561
[22]
Hoare CAR and He J Unifying theories of programming 1998 Englewood Cliffs Prentice-Hall
[23]
Hoare CAR, He J (1999) A trace model for pointers and objects. In: Proceedings of ECOOP’99, Lecture Notes in Computer Science, vol 1628. Springer, Heidelberg, pp 1–17
[24]
He J, Hoare CAR, Sanders JW (1986) Data refinement refined. In: Proceedings of ESOP 86, Lecture Notes in Computer Science, vol 213. Springer, Heidelberg, pp 187–196
[25]
He J, Li X, and Liu Z rCOS: A refinement calculus for object-oriented systems Theor Comput Sci 2006 365 1–2 109-142
[26]
Johnsen EB, Owe O (2004) Object-oriented specification and open distributed systems. In: From object-orientation to formal method, Lecture Notes in Computer Science, vol 2635. Springer, Heidelberg, pp 137–164
[27]
Kastenberg H, Kleppe A, Rensink A (2006) Defining object-oriented execution semantics using graph transformations. In: Proceedings of the 8th IFIP international conference on formal methods for open object-based distributed systems (FMOODS’06), Lecture Notes in Computer Science, vol 4037. Springer, Heidelberg, pp 186–201
[28]
Kruchten P The rational unified process: an introduction 2000 Reading Addison-Wesly
[29]
Larman C Applying UML and patterns 2001 Englewood Cliffs Prentice-Hall International
[30]
Rustan K and Leino M Recursive object types in a logic of object-oriented programming Nordic J Comput 1998 5 4 330-360
[31]
Liu Z, He J, Li X, Chen Y (2003) A relational model for formal requirements analysis in UML. In: Proceedings of ICFEM03, Lecture Notes in Computer Science, vol 2885. Springer, Heidelberg, pp 641–664
[32]
Liu X, Liu Z, and Zhao L Object-oriented structure refinement—a graph transformational approach Electron Notes Theor Comput Sci 2006 187 145-159
[33]
Morgan CC Programming from specifications 1994 Englewood Cliffs Prentice Hall
[34]
Mikhajlova A, Sekerinski E (1997) Class refinement and interface refinement in object-oriented programs. In: Proceedings of FME’97, Lecture Notes in Computer Science, vol 1313. Springer, Heidelberg, pp 82–101
[35]
Naumann D Olderog E-R Predicate transformer semantics of an Oberon-like language Proceedings of PROCOMET’94 1994 Amsterdam North-Holland 467-487
[36]
Poetzsch-Heffter A and Muller P Swierstra SD A programming logic for sequential Java Proceedings of programming languages and systems (ESOP’99), Lecture Notes in Computer Science, vol 1576 1999 Heidelberg Springer 162-176
[37]
Sekerinski E Kent SJH A type-theoretical basis for an object-oriented refinement calculus Formal methods and object technology 1996 Heidelberg Springer
[39]
Smith G The object-Z specification language 2000 Dordrecht Kluwer
[40]
Taentzer G, Rensink A (2005) Ensuring structural constraints in graph-based models with type inheritance. In: Cerioli M (ed) Fundamental approaches to software engineering (FASE), Edinburgh, UK, Lecture Notes in Computer Science, vol 3442. Springer, Heidelberg, pp 64–79
[41]
Wermelinger M and Fiadero JL A graph transformation approach to software architecture reconfiguration Sci Comput Program 2002 44 2 133-155
[42]
Zhao L, Zhao X, Long Q, Qiu Z (2006) A type system for the relational calculus of object systems. In: Proceedings of international conference on engineering complex computer systems. IEEE Computer Soceity, pp 189–198

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Formal Aspects of Computing
Formal Aspects of Computing  Volume 21, Issue 1-2
Feb 2009
221 pages
ISSN:0934-5043
EISSN:1433-299X
Issue’s Table of Contents

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 01 February 2009
Accepted: 20 December 2007
Received: 14 January 2007
Published in FAC Volume 21, Issue 1-2

Author Tags

  1. Class graph
  2. Object graph
  3. Graph transformation
  4. Normal form
  5. Object-orientation
  6. Structure refinement

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)29
  • Downloads (Last 6 weeks)6
Reflects downloads up to 14 Sep 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media