Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Retrieve Shared

Object Management

Intent

To obtain a reference to a shared object without holding explicit ownership of that object. Ubiquitous in object-oriented programming.

Motivation

Objects are conceptual entities, and any particular instance may encapsulate state or provide functionality that may be of interest to many other objects simultaneously. Consider a printer queue, for example. Many applications want to have access to the queue, but there is no reason for each application to have its own queue. In fact, this would certainly lead to eventual resource collisions as differing queues competed. Instead, a queue can be shared among many applications simultaneously. Requests from disparate objects can be handled in the order best suited by the queue. The queue is a shared resource, and must be available for whoever needs it.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial