Page 318 - DCAP404 _Object Oriented Programming
P. 318

Unit 14: Advanced Concept in C++




          execution will temporarily stop at the breakpoint, before the instruction is executed. The execution  Notes
          may then be resumed, until the next breakpoint is encountered. Breakpoints are often used in
          conjunction with watch values, by observing the current watch value at each breakpoint as the
          program  executes.

          Stepping

          Stepping refers to the execution of one instruction at a time, typically by pressing a function key
          to execute each instruction. In Turbo C++, for example, stepping can be carried out by pressing
          either function keys F7 or F8. ( F8 steps over subordinate functions, whereas F7 steps through the
          functions.) By stepping through an entire program, you can determine which instructions produce
          erroneous results or generate error messages.

          Self Assessment

          Fill in the blanks:
          9.   ......................... objects are objects that are capable of controlling and scheduling the received
               before they are served by the object.
          10.  There are many alternative approaches for introducing concurrency and ......................... is
               an object-oriented language.
          11.  For concurrent object-oriented system ......................... .

          14.8 Concurrent Object-oriented Systems

          Concurrent objects are objects that exist and operate in the same environment simultaneously.

          Our most important goals of object-oriented software development is to construct a model of
          the real world. We do this because we want to build a conceptual model, or a description, of the
          real world. A closer look at the real world reveals that concurrent activities appear everywhere.
          Concurrent activities are those activities that take place simultaneously.
          The entities in the real world are often nested, and so are the objects in software systems. Each of
          these nested objects may encapsulate nested activities again, and  multiple interactions  may
          occur between these objects in parallel. For example, consider a bank with a number of clerks
          serving customers. Provided it is open, customers may enter the bank and wait in line until they
          can interact with one of the clerks at the counter. The clerks may in turn interact with other
          employees or departments of the bank in order to fulfill the requests of the customers. All these
          activities are happening at the same time and therefore are concurrent.

          According to the object-oriented  paradigm, each object is an autonomous agent, capable of
          handling  received requests. Active  objects are  objects that  are  capable  of controlling  and
          scheduling the received requests before they are served by the object.
          This observation leads to the following conclusions: to properly model real-world situations,
          concurrent activities must be modeled. Each object must be capable of dealing with multiple,
          concurrent requests. Requests may be serialized or trigger at the same time.
          As stated before, our primary motivation  for adopting concurrency lies  with the modeling
          issues that were just discussed. It should be remarked, however, that an object-oriented model
          lends itself much more for a  realisation on a distributed or parallel architecture, because objects
          are concurrent by nature. It is thus relatively easy to  identify tasks that can be executed in
          parallel.





                                           LOVELY PROFESSIONAL UNIVERSITY                                   311
   313   314   315   316   317   318   319   320   321   322   323