Proceedings of the 20th Linear Accelerator Meeting in Japan (September 6—8,1995, Osaka, Japan)©-25

Application of an Object-Oriented Analysis for the PF LinacControl System Development
M ejuev L, A b e I. and N akahara K.
N ation al Laboratory for H igh Energy Physics (K E K ), O ho 1-1, Tsukuba, Ibaraki 305, Japan

Abstract
An O bject-O riented A nalysis f o r developing the P F Linac control system has been carriedout. W e used the Rumbaugh m ethod f o r m aking a logical m odel o f the Linac with its subsystems.
A generic system class which provides aggregation relations support， value control andoperations is defined. An operation concept which provides standard operations support isintroduced. A discussion concerning object-oriented decom position o f com plex system s is alsopresented.

1 . Introduction
Software developm ent for a m odern
accelerator control system requires highly
productive software engineering tools
w hich can significantly decrease thedevelopm ent and m aintenance costs. In linewith our group’s intention to use objectoriented technology for all phases o f
software developm ent, this paper describesa new design concept for creating a logicalm odel o f the accelerator in the analysis
phase. The R um baugh O M T m ethod wasintroduced using the ObjectM aker tool [1].
The Object M odeling Technique consistso f three m ain m odels: Object M odel,D ynam ic M odel and Functional M odel.
The Object M odel describes the real worldor problem dom ain in terms o f static
objects and the relationships between
objects. The D ynam ic M odel describes statetransitions and events which cause them.
The F unctional M odel describes m ethods
for the Object M odel or events for theD ynam ic M odel. The Object M odel is them ost im portant o f the three m odels. Thesystem should be built around the Object
M odelbecausethism odel
closelycorresponds to the problem dom ain. In thispaper we em phasize the Object M odel
developm ent.
W hile defining the Object M odel o f theLinac several ideas m ust be taken into

consideration. The Object M odel must beadequate to reflect the com plex structure o f
the accelerator, it must also hide internal
details concerning different subsystems
when necessary. A lso, we must create astandard
m ethodology
foroperating
heterogeneous
accelerator
subsystems.
Thus, w hile creating the object-oriented
m odel it has been decided to place allcom m on features o f an abstract accelerator
subsystem object at the top class o f thesystem hierarchy. Those com m on features
are considered to be: aggregation relations,values and operations.
Sm alltalk language provides a uniquepossibility to develop a dom ain m odel o f
the accelerator system separately, w ithout
paying any attention to the user interface
objects. W e can realize this by using its
M VC (m odel-view -controller) concept. In
the first stage, we can develop only a systemm odel, and then connect it to the view andcontroller representing the user interface.
The connection is possible ow ing to thegeneric Sm alltalk dependencies technique.
In our case, the m odel has a set o f views as
its dependents, so that views will be notified
about any m odel changes [2]. In this paper
we consider the first stage: system m odel
developm ent.

2. Design concept
In accordance with our approach, in theinitial stage all system classes must bepresented in R um baugh n otation using
ObjectM aker tool. In other words, at first
we create a dom ain m odel o f theaccelerator.
The m ain classes o f the Object M odel are
explained below .

A C on trolO bject is a generic systemobject. W e derive from this class all
im portant parts o f the Object M od el.
C ontrolO bject properties are :* supported operations* a set o f values* dependent components
Operationis an instance o f theO bjectO peration class (abstract class) withthe possibility to derive for exam ple control
operation class, test operation class and soon. Every action in the system isrepresented as a set o f operations. W hen
som e operation is applied to the object, wefirst check whether it is an available

operation; only in this case we can proceed.
Thus, an operation concept is created toguarantee that only acceptable operations
can be applied to a Control O bject instance.
A n Operation object contains an operation
nam e as well as a reference to a Sm alltalkm ethod which im plem ents the action. In
our m odel weare usingqualified
association to connect the operation to theobject. Q ualified association allows objects
to refer to operations by name.
This concept also provides the possibility
to show to the control system user a list o favailable operations for selected object. Theobject o f interest could be selected using agraphical representation o f an accelerator
system.
Value is a generic datum holder, an
instance o f the O bject Value class. Every
parameter m anaged by the system isrepresented as an O bject Value instance.
Value object features are:* Standard “setValue:” ， “getV alue” and“p ollin g” messages support for any
value type.

*The possibility exists to either control
the value by p ollin g or to create aprocess w hich can m anage that value. In
the case o f polling there is the possibility
to set a polling priority.
* Condition and action which is invoked if
the con d ition is valid. D uring thescanning process the con d ition is used
to determine whether it is necessary to
do anything or not. The condition
contains an expression which includes avalue m agnitude and is evaluated by thescanning process.
To express hierarchy relations we inherit
the C ontrolO bject class from the standard
L ist class in the Sm alltalk environm ent.
However, several operations, such as
copyingandcom paring
m ust
beoverridden. W e also found it convenient to
use Sm alltalk dependencies (m entionedabove) to provide notification o f a highlevel object about the state o f its
com ponents.
The A ccelerator is the m ain root object.
The A ccelerator
contains
a setofsubsystems, and description o f the spatial
distribution o f low -level objects. That
includes the data structure representing theaccelerating sections, and for each section
objects located there. A lso, as for any
instance o f the C ontrolO bject class we candefine values and operations; in this casethose w hich are im portant for the w holeaccelerator are used.
Subsystem :superclassrepresenting
accelerator subsystem s com m onality. It is
possible to m ake an inheritance for creating
an r f system, vacuum system and others. Asubsystem contains a set o f low -levelsubsystem objects. It can also contain a seto f global subsystem values and operations.
The S u bsystem O bject class is derived
from the C ontrolO bject class; also, however,the location o f this object in the accelerator
structure is added. A Subsystem Object
represents a very elementary object in thesystem. In the aggregation hierarchy it is apart o f either the Subsystem or A ccelerator
class instances.
A s m entioned above, system control isachieved by executing actions which areinstances o f the O bject Operation class.
A ction s can take control in tw o ways. Thefirst is when the scanning process calculates
the value condition; if it is valid proper
action is executed. The second one isexternal action originating from a control
system user w ho can directly execute any
actions for any system object.

3. Conclusion
The Object M odel described above isintended to be a dom ain m odel for thefuture control system. The Rum baughm ethod allows us to develop a standard
approach for representing an accelerator interms o f the Object M odel. Further, thism odel must be supplied with a userinterface and a core control program. For
this purpose Sm alltalk language (VisualW orks) is n ow under consideration. Suchfeatures as dynam ic type identification,
exception handling as well as the pure
object-oriented nature o f Sm alltalk will
stipulate this concept realization.

4. References[ 1 ] O bject-oriented m odeling and design;
James R um baugh [et al.] E nglew ood Cliffs,
N . J . : Prentice H a l l，c 1991
[2] A n Introduction to Object-Oriented
Programming and Smalltalk; Lewis J.
Pinson, Richard S. W iener University o f
C olorado at C olorado Springs, A ddisonW esley, c 1988