Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Active class versus passive class

In UML specification superstructure 2.5(still Beta, page 203)

A Class may be designated by setting isActive to true as active (i.e., each of its instances is an active object). When isActive is false the Class is passive (i.e., each of its instances executes within the context of some other object).

  • I wonder if there is a simple example illustrates the differences in applying each one of them?
  • And elaborate this concept a bit?
like image 981
Carlos Avatar asked Jan 28 '13 15:01

Carlos


People also ask

What is passive classroom?

Passive learning is defined as “a method of learning or instruction where students receive information from the instructor and internalize it.” In basic terms, this means that a student will listen and read the material and reflect internally without further reflection back or reviewing.

What is an active class?

An Active Class indicates that, when instantiated, the Class controls its own execution. Rather than being invoked or activated by other objects, it can operate standalone and define its own thread of behavior.

What is the difference between active and passive reinforcement learning?

Both active and passive reinforcement learning are types of RL. In case of passive RL, the agent's policy is fixed which means that it is told what to do. In contrast to this, in active RL, an agent needs to decide what to do as there's no fixed policy that it can act on.

What is an example of passive learning?

Assigned readings. This is a classic example of passive learning. Students read and absorb the material on their own time and are responsible for studying the content.


1 Answers

By definition,

Active Objects In UML, active classes, and therefore active objects, exist in their own thread of operations and have their own address space. If execution, or code activity, is thought of in terms of flow, active objects can start or control that flow. Active objects, in other words, are sequential and do something: modify variables, change program behavior, and so on. In UML, active classes and objects are distinguished by having a thicker border than passive objects.

Passive objects in UML do not generally have the ability to modify or begin the flow of execution, because they must wait for another object to call them. Instead, passive objects are generally used to store information, and in many cases this information may be shared between multiple other objects. This may allow passive objects to be accessed concurrently, not sequentially. To make sure that the data contained inside has a high integrity, UML allows for passive objects to insist that they be accessed sequentially; if two threads attempt to call the same sequential passive object, that object can delay the second thread until the first has finished with it.

A helpful example could be found Here

like image 94
Muhammad Hani Avatar answered Nov 25 '22 10:11

Muhammad Hani