How to Allocate Objects to Tasks
Aggregating Passive Software Objects to ActiveTasks

A complex system will contain numerous objects, each of which has potential concurrency. An active task per object would create significant communication overhead, performance issues, and resource consumption. An optimal implementation will consist of a lesser number of Active tasks which control the remaining passive objects via aggregation or composition.

Identifying concurrent activity within your system, identifying the objects that should perform those activities, and optimally allocating those objects to operating system tasks is more engineering art than science, We propose here guidelines to aid you in this process...

1. Complete the Requirements Model
Don't put the cart before the horse! Before mapping objects to tasks, complete the Use Cases of your Requirements Model to assure that you are implementing a proper solution. Use Cases, clarified with Context, Sequence, Collaboration, and Modes Diagrams, will yield your candidate set of objects. Subsystem decomposition will partition the set of objects into manageable subsets.

2. Model the OS Services
Represent the tasking services of your underlying operating system with one or more software abstractions. These objects will be stereotyped as Active, Control, Concurrent objects. You will then use aggregate composition to allocate your passive, application-specific objects to these objects to implement the mapping from software objects to operating system tasks.

3. Service Your I/O Devices
External, input and output devices require active objects, tasks, to transmit information through their interfaces. Whether these devices generate interrupts or must be polled, you should allocate the related objects to either an asynchronous, sporadic task or a synchronous, periodic task.

4. Separate the User Interface
Mixing presentation and operation implementation increases complexity and makes redesign difficult; so, just as you typically want to encapsulate your User Interface into a separate subsystem, you should allocate the objects of your User Interface to tasks that are independent of the tasks that carry out system behavior. Within the User Interface subsystem, you'll want to assign a separate task to each independent session; these may be invoked by multiple users or by multiple applications on a user itnerface workstation.

5. Use Functional Cohesion
When your system has a collection of jobs and related objects that perform related functions, consider grouping these objects into a common task. You might not want to do this if the time constraints of the individual jobs are markedly different.

6. Use Temporal Cohesion
When your system has a collection of jobs which have the same periodicity, consider executing these jobs in the context of a common task. Doing so reinforces the temporal cohesion of your system. To avoid confusion, you might not want to aggregate such jobs if they lack functional cohesion.

7. Utilize Mutual Exclusion
When your system has a collection of jobs such that only one of the jobs can be performed due to the state of the system, then allocate these jobs to the same task. You might represent the jobs of this task as the state-specific method actions of a state-dependent Control object.

8. Use Control Cohesion
When your system has one or more state-dependent Control objects, assign each such Control object to its own task. Then, aggregrate into each Control task the passive objects that perform the state-dependent actions of the Control object. If the Control object has composite, concurrent states which perform continuous activities, you might want to allocate the objects that execute those operations to separate tasks to implement the concurrency.

9. Perform Periodic Algorithms
If your system has Algorithm objects representing computation jobs which it must perform periodically, use temporal and functional cohesion to allocate these objects to related Control objects with

10. Handle Sporadics
When your system must respond to events that might arrive infrequently or sporadically, assign the objects that handle such events to asynchronous, sporadic tasks. Use sequential cohesion to aggregate within the task the objects that participate in the causal sequence. However, you don't want to combine objects whose jobs are of different priorities or that can be independently activated by other events.

637 Witter Gulch Road
Evergreen, CO 80439

(800) 630-7938
info@predictableresponse.com

Summary

Complete your Requirements Modeling to determine your context and candidate objects. Assign concurrent tasks to handle your I/O devices and user interfaces. Use functional, temporal, and control cohesion to allocate your objects to active tasks. Use Control objects to represent the underlying operating system tasks and use aggregation and composition to allocate passive objects to these task objects.

Related Information
"Designing Concurrent, Distributed, and Real-Time Applications with UML"
"How to Model a Good Use Case"
"How to Identify Objects"
"Object" Defined
"Task" Defined
© 2003 Predictable Response Consulting, All Rights Reserved Modified: February 03 2003.