2. CONTROL STYLES
Control styles in software architecture design refer to different approaches
for managing the flow of control and communication between software
components/sub-systems.
There are two main types :
1. Centralized Control
2. Event Based Control
3. TYPES OF CONTROL STYLES:
CENTRALIZED CONTROL
▪ a single subsystem that is
responsible for controlling
the flow of execution.
▪ main program or control
program
▪ used in systems where it is
important to have a single
point of control.
EVENT BASED CONTROL
▪ each subsystem respond to
events that are generated by
other subsystems or by the
system's environment.
▪ event handler
▪ used in systems where it is
important to be able to
respond to events quickly.
4. COMPARISON OF CONTROL STYLES
Feature Centralized Control Event-based Control
Number of control points Single Multiple
Control flow Top-down Event-driven
Flexibility Less flexible More flexible
Scalability Less scalable More scalable
Complexity Simpler More complex
5. TYPES AND SUBTYPES
1. Centralized Control
a. Call-Return Model
b. Manager Model
2. Event Based Control
a. Broadcast Model
b. Interrupt-driven Model
6. CALL-RETURN MODEL
▪ In a call-return model, there is a single main program that controls the
execution of all other programs.
▪ It is a good choice for simple software systems where it is important to
have a single point of control and where flexibility is not a major concern.
▪ The call-return model is a simple and easy-to-understand control style.
▪ It is also a very efficient control style, because it does not require any
synchronization between programs.
8. CALL-RETURN MODEL
• The main program calls the Routine 1, which then calls Routine 1.1.
• Routine 1.1 returns to Routine 1, which then returns to the main
program.
• This process continues until all of the programs have finished
executing.
9. CALL-RETURN MODEL
Examples of call-return control style:
▪ Main program and subroutines
▪ Layered architecture
▪ Object-oriented programming
▪ Virtual machine
10. • Applicable to concurrent system
• Controls the starting, stopping and coordination of other
systems
• May also be applied for sequential systems
• Often used in “soft” real-time systems
THE MANAGER MODEL
12. THE MANAGER MODEL
• The central controller manages the execution
of a set of processes associated with sensors
and actuators
• Sometimes, referred as event loop model.
13. THE MANAGER MODEL
▪ Centralized coordination
▪ Task Distribution
▪ Decisions and Policies
▪ Communication Hub
▪ Resource Management
▪ Status Monitoring
Characteristics:
14. Manager Model
Advantages
▪ Centralized control
▪ Clear organization
▪ Resource allocation
▪ Consistency
Disadvantages
▪ Single point of failure
▪ Scalability
▪ Complexity
▪ Limited parallelism
▪ Dependency
15. EVENT-BASED MODEL
▪ This class of control styles is driven by externally generated events.
▪ The system waits for the event to occur and then responds to it.
▪ Types:
✔ Broadcast Model
✔ Interrupt-Driven Model
16. BROADCAST MODEL
▪ Event can be broadcasted to all sub-systems
▪ Sub-system programmed to handle it, responds to it.
17. BROADCAST MODEL
▪ Sub-systems also generate events.
▪ Point-to-Point communication
▪ Processing overhead is caused.
▪ Event and message handler maintains a register of sub-systems and
their events of interest.
▪ New sub-systems can be added by registering their events of
interest to the event handler.
20. INTERRUPT DRIVEN MODEL
▪ In this model, all conceivable interrupts are predefined along with their
corresponding interrupt handler.
▪ As soon as an interrupt of a particular type is detected, a hardware switch
passes the control to the interrupt handler of that particular type
of interrupt.
▪ The handler then passes the control to the process for that interrupt.
▪ For normal running conditions, it may be paired with some sort of
Centralized control mode.
21. INTERRUPT DRIVEN MODEL
▪ Compared to other models, it allows very rapid response to external
events.
▪ But the downside to the fast response is that the program is complex
and hard to validate.
▪ Once the hardware bottlenecks the number of interrupts that can be
handled, no further interrupts can be handled.