coWiki 0.3.4
Current user:   guest   Change Preferences
   List directory   Similar   Print version 
Diff: Design
 Legend:   Removed   Changed   Added 
 Ownership:  rw-rw-r-- iezzip users
 Modified:  09 May 04, 16:55
 Modified by:  Philip Iezzi (iezzip)
Rev.:  1 (Old)
 Ownership:  rw-rw-r-- iezzip users
 Modified:  09 May 04, 17:36
 Modified by:  Philip Iezzi (iezzip)
Rev.:  2 (Current)

+ Sourdough %TITLE%
+ Sourdough %TITLE%

Sourdough is a factory driven framework using a flyweight pattern in its basic design. Like this, you are able to use Sourdough in an efficient way, even if you make just usage of a very small part of the framework.

When we talk about the *Flyweight Pattern*, we refer to the definition of the GOF (Gang-Of-Four):

/The Flyweight Pattern uses sharing to support large numbers of fine-grained objects efficiently. A flyweight is a shared object that can be used in multiple contexts simultaneously. The flyweight acts as an independent object in each context — it's indistinguishable from an instance of the object that's not shared. Flyweights cannot make assumptions about the context in which they operate./

Basically, there is a =FlyweightFactory= object that acts as a global manager. It manages the instantiation of each requested object. The =client= (in our case e.g. the web-application that is based on Sourdough) gets object instances through this global manager. The manager then decides wether it should return a /singleton/ of an object or a new object on each call. The following UML digram tries to simplify this:
<plugin Embed src="embed/uml/FlyweightFactory.png" width="629" height="340" alt="Flyweight Factory UML">
To get more specific, in Sourdough, there is a global object that manages everything. It's Sourdough's main class =(( which must be instantiated on the first usage. The =client= then accesses every single object through this global manager. It requests an object, the manager includes the necessary files, resolves existing dependencies, and finally returns the object to the client.

The following diagram shows a part of Sourdough's structure. =Sourdough= plays the global manager and on the right side you see some classes of various packages, their inheritance, and their dependencies.
<plugin Embed src="embed/uml/SourdoughFlyweight.png" width="580" height="603" alt="Sourdough Flyweight Factory UML">
For detailed class description, please refer to the (( documentation)).

Home | Documentation | Download | RSS 1.0 | GEO URL

Driven by coWiki 0.3.4 (Boron) web collaboration tool.