. Documenting Objects in MATHS MATHS predates the OO explosion of the middle 1990s. However it had already incorporated several ideas that have been absorbed into OOP/OOA/OOD. Inheritance for example was present in some of the very earliest notes prepared like this in the late 1960's. An object has both a state and a pattern of behavior. Both of these must be documented: . Static Aspects If you only look at the possible states that an object can have then you are looking at a static picture... and one that is easliy expressed by the record structures used in MATHS: .See http://www/dick/maths/intro_structures.html The static interrealtionships between objects is treated using the MATHS techniques that also apply to "data bases": .See http://www/dick/maths/math_13_Data_Bases.html . Behavior The behavior of objects is expresed in diffeernt ways by different methodologists. One technique is to list and define the operations that apply to objects of a given class. THis can be like an Abstract Data Type. Or it can be describing the changes that can occur to an implicit object .See http://www/dick/maths/intro_dynamics.html MATHS can use the Z (`Zed`) approach of describing change in a complex object as a Net (schema): POINT::=following, .Net x::real. y::real. .Close.Net For x0,y0:real, MOVE(x0,y0)::=following, .Net |- POINT. |- POINT'. |- x'=x+x0 and y'=y+y0. .Close.Net These 'nets' can also be abreviated and used in expressions like this: Net{x,y:real} Operations::Partly_Baked_Idea=following, .Net Another (as yet informal) convention could be to include .Key object-oriented operations inside a Network of variables and predicates. For example POINT::=following .Net x::real. y::real. For x0:real, setX(x0)::operation = (x'=x0). For y0:real, setY(y0)::operation = (y'=y0). For x0,y0:real, move(x0,y0)::operation = (x'=x+x0 and y'=y0+y). .Close.Net POINT p1: $POINT(x=1,y=1). p2:= p1.move(-1,-1). or p1.move(1,1). The above is a Partly_Baked_Idea. In particular, the existence of operations and constraints (invariants) introduces the need to prove that the constraints of the Net are preserved by all operations. .Hole .Close.Net . Dynamics Davaid Harel invented the Statechart as an improvement of the Finite State Machine and these have been put into the UML. These can be expressed in MATHS but Jackson Life History Program technique gives a cleaner structure to problems. It also means that the states are deduced from the problem rather than guessed. Here the possible lives of an object in the class are written as structured running program. Each real object is a thread executing the program. .See http://www/dick/maths/math_75_Programs.html The threads run for as long as the real object exists... when the program is not running the object must be saved in a persistent form. When the real object becomes active the saved stae is restored and the life-history is restarted. The communication between these (highly poarallel) objects is close to that in CSP. . Scenarios Scenarios can described in a simple structured form using: .See http://www/dick/maths/intro_ebnf.html . Inheritance If you have already written the documentation for something called N then N and w is the result of adding a condition or well formed formula to N as a constraint. You can add a whole set of features to a piece of documentation called N by N with{ new_features}. . Generics and Templates Any loosely bound terms in a piece of MATHS documentation is generic and can be replaced by a more tightly bound and so specific form.