SOFTWARE VERIFICATION RESEARCH CENTRE DEPARTMENT OF COMPUTER SCIENCE THE UNIVERSITY OF QUEENSLAND Queensland 4072 Australia TECHNICAL REPORT No. 95-33 Comparing two user-interface architectures : MVC and PAC Andrew Hussey and David Carrington Dec 1995 Phone : +61 7 3365 1003 Fax : +61 7 3365 1533 Note : Most SVRC technical reports are available via anonymous ftp , from ftp.cs.uq.edu.au in the directory / pub/SVRC/techreports . Comparing two user-interface architectures : MVC and PAC Andrew Hussey and David Carrington Department of Computer Science The University of Queensland Brisbane , Qld , 4072 , Australia email : fahussey,davecg@cs.uq.edu.au Abstract The Model-View-Controller -LRB- MVC -RRB- and Presentation-Abstraction-Control -LRB- PAC -RRB- models are objectoriented architectural models for Graphical User Interfaces -LRB- GUI 's -RRB- . Such models view a humancomputer interface as composed of several interacting objects . In this paper we describe the characteristics of the MVC and PAC architectures and compare their suitability as program architectures . The MVC and PAC architectures are modelled using the Object-Z specification language and the models are applied in a case study . 1 Introduction Interactive systems are often complex . With complexity comes the need for structure to enhance maintainability of the system . The structure of such an interactive system is provided by its architecture . Architectures split a system into components with defined roles and intercomponent interfaces . Properties are \ hard-wired '' into component and interface descriptions so that they are inherent in systems based on the architecture -LSB- 4 -RSB- . Re-usable architectures give designers a \ head-start '' in development by helping them avoid design errors . Architectures and methods for the implementation of interactive systems have been the focus of much recent research -LSB- 14 -RSB- . In this paper we demonstrate that formal models can assist in explaining userinterface architectures . Most architectures for interactive systems divide interactive system implementation into three domains : input and output definition , application and dialogue sequence which correspond to the lexical , semantic and syntactic levels in a linguistic interaction -LSB- 22 -RSB- . Interactive systems are unlike other computer programs because of their role in communicating with a user . The communicative aspect of interactive systems provides a basis for further structuring the system as a network of interactors , each dealing with different subsets of the human-computer dialogue . An interactor is a complete information processing system -LSB- 7 -RSB- . Interactors accept stimuli , undergo state transformations and respond by sending stimuli to other interactors -LSB- 1 -RSB- . Conditions restrict communication between interactors by defining when interactors communicate , who controls the dialogue and what information is passed . The interactor model is an example of the \ observer '' pattern identified by Johnson -LSB- 15 -RSB- . In the case of interactors , the observer pattern directs a separation of application data from user-interface concerns by nominating a subject -LRB- the application state -RRB- and an observer -LRB- the interface -RRB- . The interactor model also applies the \ composite '' pattern in which related objects are grouped together -LSB- 15 -RSB- because interactors may be decomposed into several communicating sub-components . Interactors provide a \ bridge between human-factors concerns on the one hand and the practice of modern systematic software development on the other '' -LSB- 9 -RSB- because interactors are architectural -LSB- 13 -RSB- . An interactor has a presentation aspect which reflects the internal state of the application -LSB- 9 -RSB- , and which mediates between the underlying application and the user -LSB- 10 -RSB- . Object-oriented architectural models view an interactive system as composed of interacting objects . Interactors are readily modelled as objects because interactors are real-world entities -LSB- 3 , p. 6 -RSB- and are defined by their state and operations upon that state . A description of a GUI , based on interactors , parallels the presentation of the interface . So , an interactorbased description is frequently easier to understand than a non-interactor description . The distribution of information inherent in object-oriented approaches better matches the cognitive organisation of human knowledge -LSB- 7 -RSB- . In addition , such distribution allows independent modification of interactors , distribution of the application and multiple dialogue threads -LRB- although , at an implementation level , an interactor need not be defined by a separate process -LSB- 8 -RSB- -RRB- . Interactors may also be decomposed into constituent objects and multiple interactors may be combined to produce larger objects -LSB- 7 -RSB- . Two architectural models which adopt an interactor-based view are the Model-ViewController -LRB- MVC -RRB- and Presentation-Abstraction-Control -LRB- PAC -RRB- models . Both models apply an object-oriented approach to the decomposition of an interactor into constituent components . We present a case study of a clock interactor , modelled using the MVC and PAC architectures and the Object-Z specification language 1 . Object-Z -LSB- 11 -RSB- is an object-oriented extension of the Z notation -LSB- 24 -RSB- -LRB- see Appendix A -RRB- . The clock consists of synchronised analogue and digital components . The description has formed the basis for implementations using Smalltalk and Tcl/Tk . Our purpose is to illustrate applying Object-Z as a notation for describing object-oriented user-interface architectures such as MVC and PAC . The description we present here incorporates considerable design detail because our purpose is to explain these architectural models . A specification of the system would not normally contain architectural details . Furthermore the models presented here are unsuitable for structuring a specification because of the level of complexity they introduce . However specification languages such as Object-Z may be applied in the description of models such as MVC and PAC . Our purpose in applying formal methods to such descriptions is to take advantage of the increased clarity that formal methods produce . In addition , by providing formal models of the MVC and PAC architectures for a familiar case study , we hope to illuminate the differences between the two architectures . Section 2 describes the MVC model . In Section 4 we specify the classes required for modelling time . A specification of a clock interactor is developed in Section 5 using the MVC architecture . Likewise , Section 3 describes the PAC model and a corresponding specification of the same interactor is developed in Section 6 . 1The specifications comprising the case study have been checked using the wizard type checker developed by the Software Verification Research Centre at the University of Queensland . 2 MVC The MVC model divides an interactor into three components : model , view and controller . In the MVC model , the model component is the abstraction of the interface object , the view depicts the model -LRB- i.e. , the user 's perception of the abstraction -RRB- and the controller deals with input associated with that interface object -LSB- 16 -RSB- . Each of the model , view and controller components are objects . A model is an object \ which implements some application-domainspecific functionality and/or state '' -LSB- 23 -RSB- . The interface of a model includes methods that allow access to those aspects of the state which are rendered visible to the user through the view . Views are registered as dependents of a model -LSB- 21 , p. 207 -RSB- . The model broadcasts a message to all dependents when it changes . The message may be parameterised by the aspect of the model which is altered . Views which display the altered aspect query the model to determine required perceptual and behavioural changes -LSB- 12 , p. 4 -RSB- . If the change message is parameterless , the views simply re-display whenever the model is altered . A view which receives a parameterised update should re-display only when the aspect it depicts is altered . Alterations to the model which affect the controller may be passed to the controller by the associated view -LSB- 17 , p. 96 -RSB- or the controller may be registered as a dependent of the model . The controller needs to be informed of changes to the model because the way the controller processes input may alter according to the state of the model . In addition , the controller may access the view because this allows alteration of the view where the model is not changed -LRB- e.g. a change to the way in which the view depicts the model such as an alteration to the display resolution -RRB- . The relationships between the components in the MVC model are depicted in Figure 1 . Controller View Model C V M C V M Figure 1 : An example MVC interactor The model usually is responsible for creating its own view and controller when it is initialised . Note that in this sense the view and controller could be depicted as components within the model . However other discussions of MVC -LRB- including the ParcPlace User Manual -LSB- 21 -RSB- -RRB- do not do so . To maintain consistency with those materials and because the model need not always create the controller and the view , we follow the established convention for depicting the MVC model . The primary system model may also create \ satellite '' interactors , such as buttons , which have their own models but which invoke methods of the primary model -LRB- see Figure 1 -RRB- . In addition the model may also create further view-controller pairs in response to input from the user . These view-controller pairs should be associated with the creating model . The dotted line indicates that the sub-interactor 's model may be either the application model -LRB- i.e. , the model component of the parent interactor -RRB- or an independent model . It is possible for an interactor to have no effective controller . In this case the controller is still present but is unresponsive to user actions . Since views correspond to windows , window nesting leads to the notion of sub-view and super-view -LSB- 23 -RSB- . Hence views may be organised in a hierarchy -LSB- 19 , p. 196 -RSB- . The appearance of a system is structured by organising views within objects whose behaviour is analogous to that of a picture frame -LSB- 21 , p. 238 -RSB- . These structural objects do not form part of the MVC architecture and are merely a mechanism for ensuring on-screen proximity of related views . The primary function of the controller is to manage mouse/keyboard event bindings -LRB- e.g. to create pop-up menus -RRB- . If an input event requires modification of application-specific data , the controller notifies the model accordingly -LSB- 23 -RSB- . If an input event -LRB- mouse , keyboard etc. -RRB- requires modification of application-specific data , the controller notifies the model accordingly -LSB- 23 -RSB- . Sub-interactors of a controller are view-controller pairs whose model may be the application model -LRB- see Figure 1 -RRB- . Such view-controller pairs include pop-up menus and dialogue boxes -LSB- 16 -RSB- . Figure 1 shows an MVC interactor whose controller creates a subinteractor . Interactors may be related . Alterations to the model of one interactor may require that alterations be effected to the model of another interactor . At an abstract level , the relationship between interactors may be expressed as a mathematical relationship between models . This relationship may be explicit in each model . Taking this approach , each related interactor requires a separate model and message passing between models is needed . Alternatively , relationships between interactors may be implicit from a shared model -LSB- 21 , p. 205 -RSB- . So , each model may have many view/controller pairs -LSB- 16 -RSB- . This obviates the need for message passing and so is usually the better approach . Figure 2 depicts a system in which a model is shared by two clock interactors . Examples of systems which have a shared model structure include a text window and associated scrollbar and a combined clock which presents both digital and analogue displays . Composite Analogue View Controller Analogue Digital View Controller Digital Model Clock Figure 2 : Model sharing in MVC 3 PAC The PAC model divides an interactor into three components : presentation , abstraction and control . In the PAC model , the presentation component defines an interactor 's appearance and the input lexemes it accepts while the abstraction defines the minimal state represen - tation ; dialogue sequence -LRB- syntax -RRB- may be controlled by any one or more of the interactor 's components . The division of an interactor into lexical , syntactic and semantic components is derived from the language model . Abstraction Control Presentation A C P A C P 1 1 1 2 2 2 Figure 3 : An example PAC interactor Figure 3 illustrates an interactor composed of two sub-interactors . Message passing between interactors occurs through channels between control components in each interactor . The PAC model is recursive -LSB- 7 -RSB- . The presentation component of a PAC object may be composed of PAC objects -LRB- see Figure 3 -RRB- . \ By applying PAC recursively at every level of abstraction of the interface , everything in an interactive application is a PAC object '' -LSB- 5 -RSB- . The presentation of a PAC object is a function of the presentations of component objects -LSB- 7 -RSB- . The control component maintains knowledge about the presentation and abstraction components . Such contextual information includes formulae relating the abstraction to enclosing objects and auxiliary information associated with dialogue , such as history and help -LSB- 5 -RSB- . The control represents the boundary between interface -LRB- lexical -RRB- and application -LRB- semantic -RRB- concerns -LSB- 5 -RSB- . Control responsibilities encompass matters which do not fall clearly within either the interface or the application . Because interactors are not modelled as separate processes in PAC , full concurrency is not possible -LSB- 14 -RSB- . Coutaz regards the language model as not giving sufficient emphasis to the semantic relationship between separate threads of dialogue -LSB- 7 -RSB- . An additional role of the control is to synchronise alterations to the abstraction and presentation components according to actions occurring within the human-computer dialogue . The PAC model allows the maintenance of visual consistency between multiple interactors through a hierarchy of controls -LSB- 2 , p. 180 -RSB- . The control component of an interactor is charged with both communicating with other interactors and expressing dependencies between the abstraction and presentation components -LSB- 8 -RSB- . The PAC structure shown in Figure 3 corresponds to the composite clock depicted in Figure 4 . Sub-interactor 1 represents the analogue display and mode button and sub-interactor 2 represents the digital display . The digital and analogue displays of the composite clock are synchronised . In Figure 4 , the digital and analogue clocks are sub-interactors of the combined clock interactor . The composite control -LRB- C -RRB- ensures synchronisation of the analogue control -LRB- C1 -RRB- and the digital control -LRB- C2 -RRB- . For example , the user can manipulate the digital clock to enter a new time . When P2 is acted 13:15 PM Figure 4 : A composite clock upon to alter the digital presentation , a message to this effect is sent to C2 . C2 both updates the state A2 and notifies C of the update . C translates the update from P2 to the correct form for A -LRB- i.e. , 24 hour time - in this case no change is required -RRB- . C 's task is to transmit the appropriate update to C1 so that the analogue representation , P1 , is updated . C1 \ knows '' the formula relating the state A1 to A . This formula converts the 24 hour time recorded by A to the 12 hour time recorded by A1 . 4 Modelling Time A clock deals with times , so we begin by defining required schemas and types . LoHr ; LoMin ; HiHr ; HiMin : N LoHr = ^ HiHr = 23 LoMin = ^ HiMin = 59 Minute == LoMin : : HiMin Hour == LoHr : : HiHr On an analogue clock , time may be in either AM or PM mode . ModeType : : = AM j PM The function switch allows us to toggle between modes . switch : ModeType ! ModeType switch -LRB- AM -RRB- = PM switch -LRB- PM -RRB- = AM We define constants to restrict the allowable hour settings for an analogue clock . AnalogueHiHr ; AnalogueLoHr : N AnalogueHiHr = 12 AnalogueLoHr = 1 A Time object may accept input from the user and tick . Time min : Minute hr : Hour Update ? -LRB- min ; hr -RRB- hr ? : Hour min ? : Minute min0 = min ? hr = hr ? Tick ? -LRB- min ; hr -RRB- min0 = -LRB- min + 1 -RRB- mod -LRB- HiMin + 1 -RRB- min0 = LoMin -RRB- hr = -LRB- hr + 1 -RRB- mod -LRB- HiHr + 1 -RRB- min0 < > LoMin -RRB- hr = hr We define an AnalogueTime as a sub-class of Time in which Tick is redefined to restrict times to analogue values and updates are permitted for analogue inputs only . AnalogueTime Time redef -LSB- Tick -RSB- mode : ModeType hr < = AnalogueHiHr hr > = AnalogueLoHr INIT Set mode to correspond to current system time Update hr ? < = AnalogueHiHr hr ? > = AnalogueLoHr Tick ? -LRB- min ; hr ; mode -RRB- min0 = -LRB- min + 1 -RRB- mod -LRB- HiMin + 1 -RRB- min0 = LoMin -RRB- hr = -LRB- hr mod AnalogueHiHr -RRB- + 1 min0 < > LoMin -RRB- hr = hr -LRB- hr = AnalogueLoHr ^ min0 = LoMin -RRB- -RRB- mode0 = switch -LRB- mode -RRB- -LRB- hr < > AnalogueLoHr _ min0 < > LoMin -RRB- -RRB- mode0 = mode 5 MVC Specification 5.1 The MVC model An interactor consists of a model , view and controller . Alterations to an interactor proceed by the controller accepting an input . After an interactor is altered -LRB- i.e. accepts input -RRB- , all associated displays are refreshed . Views and controllers are unique to an interactor but models need not be . Interactor ? -LRB- AlterRefresh -RRB- m : #Model v : #View C c : #Controller C v : model = m ^ v : controller = fcg c : model = m ^ c : view = v v 2 m : dependents c 2 m : dependents Alter b = c : Update k m : Update Refresh b = m : Refresh k -LRB- ^ d : m : dependents ffl d : Refresh -RRB- AlterRefresh b = Alter o9 Refresh A model may have dependents which record the model with which they are associated . Dependent model : #Model Refresh Alters the dependent 's state in response to changes in the model The Refresh operation is identified but details of its function are deferred . View Dependent controller : P #Controller #controller < = 1 A view has an associated model and may have an associated controller . In the case of a view , Refresh displays an aspect of the model . Controller Dependent view : #View children : P #Interactor C Update Sub-class responsibility A controller has an associated model and view . Controllers may create child interactors such as dialogue boxes . Child interactors created by the controller usually have the same model as the controller so only a view-controller pair is actually created -LRB- see Figure 1 -RRB- . The Update operation is identified but its details are deferred . Update accepts an input from the user . Model dependents : P #Dependent dependents ? #Controller -LSB- #View Update Sub-class responsibility Refresh Sub-class responsibility A model may have dependents . Alterations to a model are propagated to all associated dependents . The Update and Refresh operations are identified but their details are deferred . An Update operation changes the model 's state and a Refresh sends those changes to the view for display . 5.2 Simple clock We define an MVC model of a clock as a specialisation of the general MVC model . ClockInteractor ? -LRB- AlterRefresh ; Tick -RRB- Interactor m 2 #ClockModel v 2 #ClockView c 2 #ClockController Tick b = m : Tick k -LRB- ^ d : m : dependents ffl d : Refresh -RRB- A clock may tick without any user input | in this sense a tick is a special type of update which the user does n't initiate . ClockView View Refresh vtime ? : Time Displays a representation of vtime ? The view for a clock represents a time . ClockController Controller Update utime ? : Time mtime ! : Time mtime ! = utime ? A clock controller may accept input and update the associated model . The update occurs only if the associated restrictions on valid input for minutes and hours are satisfied . The model presented is of an abstract clock hence the new time in an Update is supplied directly by the environment . For some clocks , time may not be directly supplied but determined from other user inputs -LRB- such as mouse position in the case of an analogue clock whose hands may be directly manipulated by the user -RRB- . ClockModel Model storedTime : Time C dependents ? #ClockController -LSB- #ClockView Update ? -LRB- storedTime -RRB- mtime ? : Time storedTime0 = mtime ? Refresh vtime ! : Time vtime ! = storedTime Tick b = storedTime : Tick o9 Refresh A clock model need only be aware of the current hour and minute . A tick operation increases the clock 's stored time . Informally we assert that a tick occurs once every minute . The model may also be updated -LRB- via the controller -RRB- , effecting a change to the current hour and minute . The attribute storedTime in a ClockModel is contained because no two clock models alter the same time attribute . 5.3 Composite clock We develop a description of a CompositeClock which illustrates model sharing . The structure of this specification is illustrated diagrammatically in Figure 5 . The notation used is BON -LRB- Business Object Notation -RRB- developed by Nerson -LSB- 20 -RSB- . The double width arrows indicate inheritance instantiation Key View DigitalView AnalogueView ModeView ClockView Composite ClockModel ClockModel Model Dependent Clock Analogue Controller Digital Controller Controller ModeController ClockController Interactor AnalogueClock DigitalClock CompositeClock ModeToggle Figure 5 : The MVC specification inheritance hierarchy a client relationship between classes . Only the principal client relationships are indicated , though others exist -LRB- e.g. , an instance of ModeView is an attribute of ModeToggle -RRB- . The composite clock consists of three interactors which share the one model . One interactor implements the analogue clock , the second the digital clock and the third the mode toggle button . CompositeClock analogue : AnalogueClock digital : DigitalClock mode : ModeToggle analogue : m = digital : m = mode : m AnalogueAlterRefresh b = analogue : AlterRefresh DigitalAlterRefresh b = digital : AlterRefresh ModeAlterRefresh b = mode : AlterRefresh Tick b = -LRB- analogue : Tick ^ digital : Tick -RRB- Note that this class would probably not appear in an implementation . Instead , the CompositeClockModel would create the views and controllers for the analogue and digital clocks and mode toggle as part of its own initialisation . CompositeClockModel ClockModel -LSB- DigitalUpdate = Update -RSB- AnalogueUpdate ? -LRB- storedTime -RRB- mtime ? : Time storedTime0 : min = mtime ? : min storedTime : hr > AnalogueHiHr -RRB- storedTime0 : hr = -LRB- mtime ? : hr mod AnalogueHiHr -RRB- + AnalogueHiHr storedTime : hr < = AnalogueHiHr -RRB- storedTime0 : hr = mtime ? : hr mod AnalogueHiHr ModeUpdate ? -LRB- storedTime -RRB- mmode ? : ModeType storedTime0 : min = storedTime : min mmode ? = PM -RRB- storedTime0 : hr = -LRB- storedTime : hr mod AnalogueHiHr -RRB- + AnalogueHiHr mmode ? = AM -RRB- storedTime0 : hr = storedTime : hr mod AnalogueHiHr A CompositeClockModel provides operations which accept input from , and update , analogue and digital displays and a mode toggle . The model does not store the mode explicitly . Instead the mode is implicit from the 24 hour time which is stored . 5.4 Analogue clock We define an analogue clock interactor using the MVC architecture . The analogue clock is to be part of a composite clock in which several views share the one model , hence the model for the analogue clock is a CompositeClockModel . AnalogueClock ? -LRB- AlterRefresh ; Tick -RRB- ClockInteractor redef -LSB- Alter -RSB- m 2 #CompositeClockModel v 2 #AnalogueView c 2 #AnalogueController Alter b = c : Update k m : AnalogueUpdate In the following specification we take advantage of the ability to share models when using the MVC architecture -LRB- see Figure 2 -RRB- . AnalogueView ClockView model 2 #CompositeClockModel 8 c : controller ffl c 2 #AnalogueController The view displayed is analogue . AnalogueController ClockController children = ? model 2 #CompositeClockModel view 2 #AnalogueView Update utime ? : hr < = AnalogueHiHr utime ? : hr > = AnalogueLoHr An analogue clock controller only accepts analogue times as input because an analogue display only represents a 12 hour range . The analogue clock uses direct-manipulation to input times -LRB- i.e. , the user manipulates the clock hands using the mouse -RRB- , hence the clock 's controller does not create any sub-interactors . 5.5 Digital clock The digital clock may be similarly described . DigitalClock ? -LRB- AlterRefresh ; Tick -RRB- ClockInteractor redef -LSB- Alter -RSB- m 2 CompositeClockModel v 2 DigitalView c 2 DigitalController Alter b = c : Update k m : DigitalUpdate DigitalView ClockView model 2 #CompositeClockModel 8 c : controller ffl c 2 #DigitalController The view displayed is digital . DigitalController ClockController children = ? model 2 #CompositeClockModel view 2 #DigitalView The digital clock uses direct-manipulation to input times , hence the clock 's controller does not create any sub-interactors . 5.6 Mode toggle We model the toggle button as a separate interactor rather than as part of an analogue clock view . The primary reason for modelling the toggle button in this way is that such a model allows the use of a button or label object from a code library . Modelling the toggle button as part of the analogue clock 's view would imply that the behaviour and appearance of the button was to be coded by the programmer without reusing code from such a library . Because reuse is desirable , we model the entire clock as composed of three interactors , each presenting a view on a composite model -LRB- see Figure 6 -RRB- . In particular , the toggle button presents a view of the model which is determined by whether the hour value of the stored time exceeds the highest valid analogue hour value . Analogue View Mode Mode View Composite Digital View Analogue Controller Digital Clock Model Controller Controller Figure 6 : Structure of our MVC clock ModeToggle ? -LRB- AlterRefresh -RRB- Interactor redef -LSB- Alter -RSB- m 2 CompositeClockModel v 2 ModeView c 2 ModeController Alter b = c : Update k m : ModeUpdate A mode toggle can alter the model 's mode . ModeView View model 2 #CompositeClockModel 8 c : controller ffl c 2 #ModeController Refresh vtime ? : Time Display a toggle button whose mode corresponds to the 24 hour time supplied . A mode toggle is an interactor which is able to display an AM/PM mode . ModeController Controller mode : ModeType model 2 #CompositeClockModel view 2 #ModeView Update ? -LRB- mode -RRB- mmode ! : ModeType mode0 = switch -LRB- mode -RRB- mmode ! = mode0 The mode can be toggled between AM and PM . 6 PAC Specification 6.1 The PAC model PAC interactors are arranged in a hierarchy . The interactors with which the control component may communicate are the sub-interactors of the presentation -LRB- i.e. , c : children = p : children -RRB- . An interactor may accept input which alters the interactor 's state . Any of the children of an interactor may be responsible for the input . The use of a shared state ensures that updates to the presentation component are implicitly communicated to the control component and abstraction component . We discuss this in more detail below . The new state is propagated to the parent interactors in the hierarchy and the interactor 's display is refreshed . Interactor ? -LRB- AlterRefresh -RRB- p : #Presentation C a : #Abstraction C c : #Control C c : children = p : children Alter b = p : Update o9 -LRB- c : UpLevel ^ c : BroadCast -RRB- Refresh b = p : Refresh AlterRefresh b = Alter o9 Refresh We define a PAC presentation component . The presentation is composed -LRB- in part -RRB- of subinteractors . Presentation children : P #Interactor C Update Sub-class responsibility Refresh Sub-class responsibility The Refresh and Update operations are identified but details of their function are deferred . Update accepts input from the user and Refresh displays an aspect of the abstraction to the user . Control parent : P #Interactor children : P #Interactor #parent < = 1 UpLevel Propagates an update to the parent interactor BroadCast Propagates an update to all child interactors A control component communicates with its parent interactor . The parent is defined as a set because there may be no parent -LRB- i.e. parent = ? -RRB- . Likewise , we restrict the size of parent to 1 because an interactor can have at most one parent . The UpLevel and BroadCast operations are identified ; however formalisation of their function is deferred . Abstraction An abstraction is common to all interactors but at this stage its details are not elaborated . 6.2 Simple clock In this description , we abstract from the actual message passing which occurs , modelling the transmission of times as a shared state . The state variables relating to time in the ClockControl and ClockPresentation reference the stored time in the ClockAbstraction . Clock ? -LRB- AlterRefresh ; Tick -RRB- Interactor p 2 #ClockPresentation a 2 #ClockAbstraction c 2 #ClockControl a : storedTime = p : time a : storedTime = c : time Tick b = a : Tick o9 p : Refresh A clock is an interactor which may Tick autonomously . ClockPresentation Presentation time : #Time children 2 #Clock Refresh Displays a clock presentation Update b = time : Update The clock 's presentation may be altered in an Update operation . This alteration must be reflected in changes to the abstract state . The presentation communicates the input to the control which both communicates the input to the abstraction and to the parent interactor -LRB- if any -RRB- . A Refresh requires communication of the state from the abstraction via the control to the presentation for display . ClockControl Control time : #Time children 2 #Clock parent 2 #Clock In the PAC model , the clock control transmits times between the presentation and the abstraction . As for the presentation component , we rely on shared state to model message passing . ClockAbstraction Abstraction storedTime : #Time C Tick b = storedTime : Tick The clock abstraction performs tick operations which update the time . The attribute storedTime is contained because the abstraction actually stores the time , whereas the control and presentation components reference the stored time . We define a hierarchy consisting of a moded analogue clock and a digital clock as subinteractors of a composite clock . Figure 7 depicts the classes of control component which communicate in the specification . The control component classes named in the diagram are described in detail below . Each control component forms a part of a similarly named interactor e.g. , a CompositeClock 's control component is of class CompositeControl . DigitalControl ModedAnalogueControl ToggleControl AnalogueControl CompositeControl Figure 7 : The control component hierarchy We define a subclass of Control which is able to communicate with other such control components in a hierarchy of interactors . HierarchicalControl ClockControl NotifyParent time ! : #Time parent < > ? time ! = time ReceiveChildTime ? -LRB- time -RRB- time ? : #Time Conversion is needed from the data format used by the child interactor to that used by this interactor . NotifyChild newtime ! : #Time newtime ! = time ReceiveParentTime ? -LRB- time -RRB- newtime ? : #Time Conversion is needed from the data format used by the parent interactor to that used by this interactor . BroadCast b = ^ ch : children ffl -LRB- -LRB- NotifyChild k ch : ReceiveParentTime -RRB- o9 ch : BroadCast -RRB- UpLevel b = -LRB- -LSB- par : #HierarchicalInteractor j par 2 parent -RSB- ffl -LRB- -LRB- NotifyParent k par : ReceiveChildTime -RRB- o9 par : BroadCast o9 par : UpLevel -RRB- -RRB- -LSB- -RSB- -LRB- -LSB- parent = ? -RSB- -RRB- The UpLevel operation instructs a parent interactor to receive an input from a child interactor , broadcast it to all children and propagate the input up the interactor hierarchy -LRB- if possible -RRB- . The Broadcast operation instructs a child to receive a time from the parent -LRB- instructing -RRB- interactor and broadcast it to all its children . We define an interactor whose control is of class HierarchicalControl . Such an interactor may form part of an interactor hierarchy . HierarchicalInteractor ? -LRB- AlterRefresh ; ReceiveChildTime ; ReceiveParentTime ; BroadCast ; UpLevel -RRB- Interactor c 2 #HierarchicalControl ReceiveChildTime b = c : ReceiveChildTime ReceiveParentTime b = c : ReceiveParentTime BroadCast b = c : BroadCast UpLevel b = c : UpLevel A HierarchicalInteractor does not inherit from Clock because the functions of a HierarchicalInteractor are completely performed by its child interactors . We do not provide a system level operation which synchronises clock ticks for each child . Approximate synchronisation is ensured because each clock starts at the current system time and ticks once every second thereafter . 6.3 Composite clock We develop a description of a CompositeClock which consists of a moded analogue clock and a digital clock . The structure of this specification is illustrated diagrammatically in Figure 8 . As for MVC , only the principal client relationships are indicated , though others exist -LRB- e.g. , an instance of ModedAnaloguePresentation is an attribute of ModedAnalogueClock -RRB- . CompositeClock HierarchicalInteractor p 2 #CompositePresentation a 2 #CompositeAbstraction c 2 #CompositeControl p : analogue : c : parent = self p : digital : c : parent = self instantiation inheritance Key Interactor Presentation Control Presentation Toggle Moded Analogue Presentation ClockPresentation Presentation Abstraction Clock Mode Toggle Clock Digital Clock Hierarchical Interactor Analogue Toggle Control Moded Analogue Clock Clock Control Hierarchical Control Digital Abstraction Analogue Abstraction Clock Abstraction Abstraction Digital Presentation Analogue Presentation Toggle Abstraction Moded Control Digital Control Control Analogue Control Analogue CompositeClock Composite Composite Composite Figure 8 : The PAC specification inheritance hierarchy Both the analogue and digital clocks are synchronised , but the analogue clock displays time using a 12 hour format as opposed to the digital clock 's 24 hour format . As was the case for a moded analogue clock , a composite clock 's operations are completely determined by its child interactors . CompositePresentation Presentation analogue : ModedAnalogueClock ; digital : DigitalClock analogue 2 children mode 2 children The child interactors of a composite clock 's presentation are an analogue and a digital clock . These interactors are sub-interactors of the presentation . CompositeControl HierarchicalControl ReceiveChildTime time0 = time ? A CompositeControl performs the same functions as a standard HierarchicalControl . CompositeAbstraction Abstraction Likewise , a CompositeAbstraction performs the same functions as a standard Abstraction . 6.4 Moded analogue clock A moded analogue clock consists of an analogue display and a toggle button which allows the mode -LRB- AM/PM -RRB- to be altered . ModedAnalogueClock ? -LRB- AlterRefresh ; ReceiveChildTime ; ReceiveMode ; ReceiveParentTime ; BroadCast ; UpLevel -RRB- HierarchicalInteractor c 2 #ModedAnalogueControl p 2 #ModedAnaloguePresentation p : analogue : c : parent = self p : mode : c : parent = self ReceiveMode b = c : ReceiveMode ModedAnaloguePresentation Presentation analogue : AnalogueClock mode : ModeToggle analogue 2 children mode 2 children A moded clock presentation encapsulates a mode toggle and an analogue clock . ModedAnalogueControl HierarchicalControl ReceiveMode ? -LRB- time -RRB- mode ? : ModeType time0 : min = time : min mode ? = PM -RRB- time0 : hr = -LRB- time : hr mod AnalogueHiHr -RRB- + AnalogueHiHr mode ? = AM -RRB- time0 : hr = time : hr mod AnalogueHiHr ReceiveChildTime time ? : mode = AM -RRB- time0 = time ? time ? : mode = PM -RRB- time0 : min = time ? : min ^ time0 : hr = -LRB- time ? : hr mod AnalogueHiHr -RRB- + AnalogueHiHr ReceiveParentTime time0 = newtime ? A moded analogue clock control communicates between a moded analogue clock and other clocks forming part of a composite clock interactor . 6.5 Analogue clock We define an analogue clock interactor using the PAC architecture . We use the analogue time class within the AnalogueAbstraction class because PAC does not use abstract state sharing -LRB- as does the MVC example -RRB- . In the MVC description , the analogue display was simply a view on the digital abstract state . For PAC , the analogue display depicts its own abstract state . The components of an analogue clock interactor may be defined . AnalogueClock ? -LRB- AlterRefresh ; Tick ; ReceiveParentTime ; BroadCast ; UpLevel -RRB- HierarchicalInteractor Clock p 2 #AnaloguePresentation a 2 #AnalogueAbstraction c 2 #AnalogueControl We do not provide the operation ReceiveChildTime on AnalogueClock because AnalogueClock has no child interactors . AnaloguePresentation ClockPresentation time 2 AnalogueTime On either an input to or an output from the presentation component , an alteration may be effected to the appearance of the interactor . The presentation displayed is of an analogue clock display . AnalogueControl HierarchicalControl children = ? time 2 AnalogueTime ReceiveParentTime time0 : min = newtime ? : min newtime ? : hr < > LoHr ^ newtime ? : hr < > AnalogueHiHr -RRB- time0 : hr = newtime ? : hr mod AnalogueHiHr newtime ? : hr = LoHr _ newtime ? : hr = AnalogueHiHr -RRB- time0 : hr = AnalogueHiHr newtime ? : hr > = AnalogueHiHr -RRB- time0 : mode = PM newtime ? : hr < AnalogueHiHr -RRB- time0 : mode = AM An AnalogueControl performs the same functions as a standard HierarchicalControl except that updates received from the parent control require conversion to an analogue format -LRB- we assume the parent uses digital format -RRB- . An analogue clock uses direct-manipulation to input times , hence the controller does not create any sub-interactors . AnalogueAbstraction ClockAbstraction storedTime 2 AnalogueTime 6.6 Toggle button We define a toggle button class . The toggle button and analogue display together form a moded analogue clock . ModeToggle ? -LRB- AlterRefresh -RRB- Interactor p 2 #TogglePresentation a 2 #ToggleAbstraction c 2 #ToggleControl a : mode = p : mode a : mode = c : mode AlterRefresh b = p : Update o9 p : Refresh o9 c : UpLevel ReceiveParentTime b = c : ReceiveParentTime As was the case for a clock interactor , we use a shared state to model message passing . Mode mode : ModeType Toggle ? -LRB- mode -RRB- mode0 = switch -LRB- mode -RRB- TogglePresentation Presentation mode : Mode Refresh Display mode Update b = mode : Toggle ToggleControl Control mode : Mode children = ? parent < > ? -RRB- parent 2 ModedAnalogueClock NotifyParent mode ! : ModeType parent < > ? mode ! = mode : mode ReceiveParentTime ? -LRB- mode -RRB- time ? : Time time ? : hr > = AnalogueHiHr -RRB- mode0 : mode = PM time ? : hr < AnalogueHiHr -RRB- mode0 : mode = AM UpLevel b = -LSB- par : ModedAnalogueClock j par 2 parent -RSB- ffl -LRB- NotifyParent k par : ReceiveMode -RRB- o9 par : BroadCast o9 par : UpLevel -LSB- -RSB- -LSB- parent = ? -RSB- The toggle control is designed to allow the toggle interactor to form part of a moded analogue clock . The operations of a toggle control allow communication with a ModedAnalogueControl . A toggle control does not create any sub-interactors . We do not detail the operation BroadCast because the mode toggle has no child interactors in our case study . ToggleAbstraction mode : Mode C The abstraction stores the mode of the toggle . 6.7 Digital clock A digital clock is like an analogue clock except that time is represented using a 24 hour format . DigitalClock ? -LRB- AlterRefresh ; Tick ; ReceiveParentTime ; BroadCast ; UpLevel -RRB- HierarchicalInteractor Clock p 2 #DigitalPresentation a 2 #DigitalAbstraction c 2 #DigitalControl The presentation displayed is of a digital clock display . DigitalPresentation ClockPresentation time 2 Time DigitalControl HierarchicalControl children = ? time 2 Time ReceiveParentTime time0 = newtime ? The digital control does not need to convert the time supplied by the parent combined clock because both use the same 24-hour time abstraction . DigitalAbstraction ClockAbstraction storedTime 2 Time The ClockAbstraction class is already specified using a 24 hour format , so no change to the abstraction is needed . 7 Conclusions The choice of Object-Z as a specification language allowed the capture of several key aspects of the MVC and PAC architectures . In particular , the containment construct permits the capture of uniqueness relationships between the states of objects of the same class . Object-Z clarifies message passing between components in each model . The Object-Z specification is simpler for explaining of system characteristics than corresponding implementations using Smalltalk -LRB- for MVC -RRB- and Tcl/Tk -LRB- for PAC -RRB- . The MVC and PAC models are both based on the division of an interactive system into application and interface . Separation of an application and its interface allows them to be developed separately and facilitates re-use -LSB- 17 , p. 92 -RSB- . The primary differences between the PAC and MVC models are : ffl the way in which synchronisation of related interactors is achieved , and ffl the location of input and output responsibilities . The PAC control component has no direct correspondent in the MVC model -LSB- 2 , p. 171 -RSB- . The model , view and control components in the MVC model must maintain their consistency with other interactors through message passing -LSB- 6 -RSB- . MVC does not indicate how communication occurs between interactors in an interactive system -LSB- 8 -RSB- . \ In MVC , the notion of control is diluted across three related objects whereas it is explicitly centralised in PAC '' -LSB- 6 -RSB- . Alternatively a model may be shared between several views and controllers . The PAC control hierarchy provides a useful mechanism for specifying relations between interactors because the hierarchy corresponds to the way interactors are displayed . Often however the relationships are relatively simple and the approach adopted in the MVC model is sufficient . For large systems , the structure introduced by the PAC model provides easier maintenance than that provided by the MVC model . Output behaviour in the MVC model is dealt with by the model component sending appropriate messages to the view . In PAC , input and output behaviour is combined in the presentation component . The MVC model regards output as relating primarily to the depiction of abstract system states whereas the PAC model regards output as encompassing both the creation of sub-objects involved in human-computer dialogues -LRB- pop-up menus , entry widgets etc. -RRB- and the depiction of abstract system states . The PAC presentation component is essentially the entire user interface as perceived by the user . In the MVC model , the user interface is composed of both the view and control components -LSB- 2 , p. 173 -RSB- . Separation of input and output is often impossible to achieve because input events are frequently \ strongly related to immediate output feedback '' -LSB- 6 -RSB- . In addition , separation results in increased message passing in systems for which most inputs alter the system state -LRB- e.g. direct manipulation systems -RRB- . \ Placing responsibility for input and output in the same object reduces the total number of objects and the communication overhead between them '' -LSB- 18 -RSB- . Additionally , separation of input and output concerns is difficult to achieve using existing toolkits such as Motif . The alternative view is that decoupling the controller and view , while inconvenient in some circumstances , generally enhances flexibility and reuse . Views -LRB- system appearance -RRB- and controllers -LRB- system behaviour -RRB- may be easily combined in numerous ways -LSB- 17 , p. 97 -RSB- . The distribution of input and output behaviour allows changes to be made to either input or output syntax without affecting the other -LSB- 12 , p. 5 -RSB- . In addition the separation of input and output , while not always advantageous for implementation , is conceptually useful for specification . The MVC model is superior to the PAC model in several additional respects . The MVC model is simpler than the PAC model and results in less complex specifications and implementations because relationships between interactors may be interpreted as different views of the one abstraction -LRB- i.e. model sharing -RRB- . The hierarchy of control components used in the PAC model leads to more complex specification and implementation than model sharing and is useful only for larger systems . The PAC model does not acknowledge the possibility of shared abstractions , however there is no reason to disallow such sharing . Shared abstractions would constitute a useful extension to the PAC model , providing additional flexibility . Finally , although higher level PAC interactors abstract from lower level interactors , some duplication of state information occurs between abstractions in the PAC model . In many cases , the choice of architecture is pragmatic -LSB- 15 -RSB- . A project which is to be implemented using Smalltalk will use MVC because Smalltalk provides many of the objects which are needed -LRB- e.g. Model-View-Controller triplets for commonly used interface constructs -RRB- Likewise , a developer who expects to implement using a toolkit such as Motif will probably choose PAC because of the difficulty of dividing input and output concerns using such toolkits . 8 Acknowledgments The authors wish to thank Jin Song Dong for helpful discussions on containment and polymorphism and Graeme Smith for his thorough critique of drafts of this paper . Thanks are also due to Wendy Johnston who assisted in the type checking of the specifications in this paper . Appendix A : Modelling using Object-Z The constituent parts of a class definition -LRB- e.g. an Interactor in the MVC model -RRB- are schemas . A schema is divided into two parts . The upper part defines the state of the schema . The lower part defines predicates which restrict the values which the state may take . The state schema is nameless and contains declarations and constraining invariants . The initialisation schema is labelled INIT and defines the initial state of instances of the class . The ? - list defines which state attributes are altered by the operation . Classes may inherit from other classes . For example , ClockView inherits from View . Inheritance results in a merger of state , INIT and operation schemas which have the same name . A class may be instantiated . For example , the declaration c : C defines a new instance c of type C -LRB- where C is a class -RRB- . Operations and attributes of class instances may be accessed . For example , the term c : att denotes the attribute att of c while the term c : Op denotes the operation Op applied to c. Attributes may be class instances . Operations on class instances may be combined using the standard Z schema calculus -LSB- 24 -RSB- . In addition , Object-Z provides a concurrency operator -LRB- k -RRB- which conjoins operation schemas -LRB- i.e. merges state and predicates -RRB- and identifies inputs -LRB- attributes whose names end in ? -RRB- with outputs -LRB- attributes whose names end in ! -RRB- . The containment operator , C , indicates that an object is contained within another object . A contained instance can appear in just one instance of a class but can be referenced from other classes . The polymorphic operator , # , indicates that the type of an attribute may be any class which inherits from the specified base class . Operations on such an attribute must be polymorphic , i.e. regardless of the actual class of the object , the operation must be able to proceed . References -LSB- 1 -RSB- G. D. Abowd . Agents : Communicating Interactive Processes . In D. Diaper , D. Gilmore , G. Cockton , and B. Shackel , editors , Human-Computer Interaction -LCB- INTERACT ' 90 , pages 143 -LCB- 147 . Elsevier Science Publishers B.V. , 1990 . -LSB- 2 -RSB- L. Bass and J. Coutaz . Developing software for the user interface . Addison-Wesley Publishing Company , 1991 . -LSB- 3 -RSB- E. V. Berard . Essays on Object-Oriented Software Engineering . Prentice Hall , 1993 . -LSB- 4 -RSB- G. Cockton . The Architectural Bases of Design Re-use . In D. A. Duce , M. R. Gomes , F. R. A. Hopgood , and J. R. Lee , editors , User Interface Management and Design : Proceedings of the Workshop on User Interface Management Systems and Environments , pages 15 -LCB- 34 . Springer-Verlag , 1990 . -LSB- 5 -RSB- J. Coutaz . PAC , an Object Oriented Model for Dialog Design . In H. I. Rullinger and R. Shackel , editors , Human-Computer Interaction - INTERACT ' 87 , pages 431 -LCB- 436 . Elsevier Science Publishers , 1987 . -LSB- 6 -RSB- J. Coutaz . The Construction of User Interfaces and the Object Paradigm . In J. Bezivin , J.-M . Hullott , P. Cointe , and H. Lieberman , editors , European Conference on Objectoriented Programming - ECOOP ' 87 , pages 128 -LCB- 130 . Springer-Verlag , 1987 . -LSB- 7 -RSB- J. Coutaz . Architectural Models for Interactive Software . In S. Cook , editor , European Conference on Object-oriented Programming - ECOOP ' 89 , pages 382 -LCB- 399 . Cambridge University Press , 1989 . -LSB- 8 -RSB- J. Coutaz , L. Nigay , and D. Salber . Agent-Based Architecture Modelling for Interactive Systems . Technical Report SM/WP53 , LGI-IMAG , Grenoble , April 1995 . ESPRIT BRA 7040 Amodeus-2 . -LSB- 9 -RSB- D. J. Duke and M. D. Harrison . Abstract Interaction Objects . Computer Graphics Forum Conference Issue , 12 -LRB- 3 -RRB- :25 -LCB- 36 , September 1993 . -LSB- 10 -RSB- D. J. Duke and M. D. Harrison . Event model of human-computer interaction . Software Engineering Journal , pages 3 -LCB- 11 , January 1995 . -LSB- 11 -RSB- R. Duke , P. King , G. Rose , and G. Smith . The Object-Z specification language . In Technology of Object-Oriented Languages and Systems : TOOLS . Prentice-Hall , 1991 . -LSB- 12 -RSB- E. Gamma , R. Helm , R. Johnson , and J. Vlissides . Design patterns : elements of reusable object-oriented software . Addison-Wesley , 1994 . -LSB- 13 -RSB- M. D. Harrison and D. J. Duke . A Review of Formalisms for Describing Interactive Behaviour . In R. N. Taylor and J. Coutaz , editors , ICSE Workshop on SE-HCI : Joint Research Issues : Sorrento , Italy , Lecture Notes in Computer Science , pages 49 -LCB- 75 . Springer-Verlag , 1994 . -LSB- 14 -RSB- P. Johnson , K. Drake , and S. Wilson . A Framework for Integrating UIMS and User Task Models in the Design of User Interfaces . In D. A. Duce , M. R. Gomes , F. R. A. Hopgood , and J. R. Lee , editors , User Interface Management and Design : Proceedings of the Workshop on User Interface Management Systems and Environments , pages 203 -LCB- 216 . Springer-Verlag , 1990 . -LSB- 15 -RSB- R. E. Johnson . Patterns and Frameworks . Report on Object Analysis and Design , 1 -LRB- 6 -RRB- :46 -LCB- 48 , March-April 1995 . -LSB- 16 -RSB- G. E. Krasner and S. T. Pope . A cookbook for using Model-View-Controller user interface paradigm in Smalltalk-80 . Journal of Object-oriented Programming , 1 -LRB- 3 -RRB- :26 -LCB- 49 , August/September 1988 . -LSB- 17 -RSB- S. Lewis . The art and science of Smalltalk : an introduction to object-oriented programming using VisualWorks . Prentice Hall , 1995 . -LSB- 18 -RSB- M. A. Linton , J. M. Vlissides , and P. R. Calder . Composing User Interfaces with InterViews . IEEE Computer , 22 -LRB- 2 -RRB- :8 -LCB- 24 , 1989 . -LSB- 19 -RSB- M. Marchesi . Object-Oriented Programming with SmallTalk/V . Prentice Hall , 1994 . -LSB- 20 -RSB- J. Nerson . Applying Object-Oriented Analysis and Design . Communications of the ACM , 35 -LRB- 9 -RRB- :63 -LCB- 74 , September 1992 . -LSB- 21 -RSB- ParcPlace . VisualWorks User 's Guide . ParcPlace Systems , Inc. , 1994 . -LSB- 22 -RSB- F. Shevlin and F. Neelamkavil . Designing the Next Generation of UIMS 's . In D. A. Duce , M. R. Gomes , F. R. A. Hopgood , and J. R. Lee , editors , User Interface Management and Design : Proceedings of the Workshop on User Interface Management Systems and Environments , pages 123 -LCB- 133 . Springer-Verlag , 1990 . -LSB- 23 -RSB- M. C. Skipper . Model-View Controller classes in Eiffel . In P. Schulthess , editor , Joint Modular Languages Conference Modula , Oberon & friends Germany , pages 235 -LCB- 248 . Germany Universitaetsverlag Ulm GmbH , September 1994 . -LSB- 24 -RSB- J. M. Spivey . The Z notation : a reference manual . Prentice-Hall , 2nd edition , 1992 .

O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O B O O O O O B O O O O O O O O O O B O O O O O O O O O O O O O O O O O B O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O B O O O O O O O O O O B O O O O O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O B O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O B O O O O O O O O O B O O O O O O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O B O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O B O O O O O O O B O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O B O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

human-computer interface
object-z
software architecture