OO-101 The SansGUI View


Object-orientation (OO), one of the effective methods in making computer models out of real world systems has created steep learning curves for beginners. The non-standardized terminologies used by different OO methods in different computer software complicate the learning process. Here in the very beginning, we introduce a set of Object-Oriented (OO) terminologies used in SansGUI by taking an example that should be very familiar to everyone, namely a house. Instead of using a top down approach, which breaks the house down into supporting system, electrical system, water system, etc., we will use a bottom-up method by looking into the organizations of the components of the house. All the terms are sequentially introduced; therefore, please follow the order as you read.

System

A system is an organization of things, or system elements, that perform certain functions or provide certain services. In our example, a house is a system that provides residents with a shelter and some other functions such as sanitation and entertainment.

Component

A Component is best understood as a physical, tangible element of a system, where our system is the house. They may be large items such as the roof, the foundation, walls, doors, drywall panels, bath tubs, kitchen sinks, and so on or they may be as small as things like hinges, nails, or screws.

Part

Each individual component has its identity. The bath tub in the master bathroom, the door to the kitchen, the door to the basement, the garage door, are examples of individual components. In SansGUI, we call these parts. Because they have a unique label and, possibly, some unique properties such as their locations, we can uniquely identify them.

Object

To simplify the model building process without the need to enter all data values into each and every part, SansGUI uses objects to represent a group of parts with similar properties. All bedroom doors in our sample house have similar properties, such as the widths are all 30 inches and the heights are all 80 inches; therefore, we can use a BedroomDoor object to store these common properties. Parts are then derived from these objects so that they inherit the common properties from the deriving object. From the BedroomDoor object, we can then derive the master bedroom door, children's bedroom door, and guest's room door; the specific instances are parts. When we change the width of the BedroomDoor object from 30 inches to 36 inches, all the derived parts will in turn have their widths changed to 36 inches. This greatly simplifies the data input process.

Part Override

There may be slight variations in certain doors, but not different enough to be worthy of creating yet another door object. For example, the master bedroom door is 48 inches wide but all other features are the same. SansGUI allows the object values to be overridden at the part level. That is, when a part overriding value (48 inches) is found, it will be used; otherwise, the deriving object's value (36 inches) will be used. This is yet another way in which the data input process has been improved.

Attribute-Value Pair and Variable

Each property of a component is represented by an attribute-value pair. An attribute defines the types of values a property can have. In our door example, the height of the door is an attribute with a matching numerical value measured in inches. In object-oriented terms, this is called an O-A-V triplet, for Object, Attribute and Value. Therefore, we can say the BedroomDoor (object) has a height (attribute) of 80 inches (value). A variable is merely the implementation of an attribute in a computer program. It is used to define the memory storage needed for the value. At times, we use the words attribute and variable interchangeably.

Class

In order to organize and in turn reduce the number of components needed to create a model of a house, we sort them out into groups of similar components. In object-orientation, the definitions of such groups are called classes. The studs, nails, doors, doorknobs, and hinges used to build a house can all be considered as classes of components. A class can have attributes such as shape, material, color, texture, or weight.

Function

We may also need to identify the usage and the "behavior" of a class, such as how a door is opened or closed. These behaviors of the class are represented by class functions, which are implemented as computer code. Other object-oriented systems may use the term method instead of function. The SansGUI simulation developers implement class functions in dynamic-linked libraries (DLLs) or in stand alone executable programs.

Subclass and Superclass

Some classes are more general and some are more specific. Suppose we create a class called Opening with width and height as its attributes. Classes Door and Window can be created under class Opening so that they inherit the width and height attributes from it, the parent. In this example, we call class Opening the superclass of classes Window and Door, and classes Window and Door are subclasses of class Opening. The classes Window and Door are sibling classes.

The Door class may have a number of hinges as an attribute while the Window class may have horizontal or vertical opening types. These attributes are added to the list of attributes which are inherited from the superclasses. Therefore, the attribute set of the subclass is always a superset of that of the superclass. With this feature, the default function found in the superclass can be called to act on the attributes/variables in the subclasses.

Link

A door panel is attached to the door frame with some hinges. We can model it so that the door panel is attached to the hinge and then the hinge is attached to the door frame. In SansGUI, we use links to physically connect parts together. Links are a little bit more "abstract" than parts in that they serve as the interface between parts. A link has two ends that are used to connect to two parts. We can model the attachment surfaces of house components as links in our house example. Just like parts, links are derived from link objects, which are defined in a link class. Different from parts, however, SansGUI allows only one link class in a simulation model for performance reasons. The attachment surface in our example may have attachment types in one of its attributes with nailed-on, screwed-on, or glued-on as possible values. In SansGUI, links are special components that carry information from one part to the other and their meanings are defined by the simulation developer.

Ports in Parts

A door may have several surface areas for attaching hinges. These areas are defined as ports in SansGUI. Ports can have attributes that specify the properties of interest. In the door and hinge example, the port attributes may be the offset, the side, and the size of a possible hinge mount point. Sometimes, the ports are predefined; other times, the ports are determined by a set of rules so that they are enumerated as each port is connected with a link. A 2"x4"x8' stud has two end ports for top and bottom attachments and multiple side ports for horizontal attachments.

Assembly

When we attach hinges, a door knob, and a lock set to the door, it is considered to be an assembly. An assembly is a container to store parts and links. One SansGUI Canvas View is used to create and maintain an assembly. A generic assembly is a part derived from the Generic object of the Assembly class and the part has an assembly in it. The word generic means that it does not have any class attributes.

Assembly Hierarchy

In the SansGUI modeling space, there is always a TOP generic assembly for simulation users to configure the model. The house is the TOP assembly in our house model. The roof, walls, floors, bathrooms, etc. are considered to be subassemblies. The door subassembly is mounted to the wall via the door frame. These form a tree of multi-level assemblies, or an assembly hierarchy.

Reference

Sometimes, the information we need may not be physical, such as the prices of different grades of carpet or the names of door panels created from various materials. These types of information can be kept in Reference objects within SansGUI. There can be a class attribute of Reference type that uses the name of the reference object to access the information stored in the reference object. For example, a Carpet Price Table class attribute can be introduced in the Floor class to access the prices of different grades of carpet and a separate Carpet Grade class attribute is used to indicate which grade is installed. Reference objects are created from reference classes and cannot be used to derive parts or links.

 



C:\FH_Suite\htmlgifs\home.gif SansGUI Object System Model Construction

SansGUI Modeling and Simulation Environment Version 1.2

Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.

http://protodesign-inc.com