Chapter 10 Mediator. Summary prepared by Kirk Scott. Athena From Wikipedia, the free encyclopedia.
PowerPoint Slideshow about ' Chapter 10 Mediator' - isi
An Image/Link below is provided (as is) to download presentation
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
:"Athene", "Athina", and "Pallas Athena" all redirect here. For other uses, see Athena (disambiguation), Athene (disambiguation), Athina (disambiguation) and Pallas Athena (disambiguation)
In Greek religion and mythology, Athena or Athene (pron.: /əˈθiːnə/ or /əˈθiːniː/; Attic: Ἀθηνᾶ, Athēnā or Ἀθηναία, Athēnaia; Epic: Ἀθηναίη, Athēnaiē; Ionic: Ἀθήνη, Athēnē; Doric: Ἀθάνα, Athānā), also referred to as Pallas Athena/Athene (pron.: /ˈpæləs/; Παλλὰς Ἀθηνᾶ; Παλλὰς Ἀθήνη), is the goddess of wisdom, courage, inspiration, civilization, law and justice, just warfare, mathematics, strength, strategy, the arts, crafts, and skill. Minerva is the Roman goddessidentified with Athena.
Athena is also a shrewd companion of heroes and is the goddess of heroic endeavour. She is the virgin patroness of Athens. The Athenians founded the Parthenon on the Acropolis of her namesake city, Athens (Athena Parthenos), in her honour.
The intent of the Mediator pattern is to define an object that encapsulates how a set of objects interact; this promotes loose coupling, keeping the objects from referring to one another explicitly, and lets you vary their interactions independently.
On the other hand, this example illustrates mediation without including the observer part of MVC
Why observing is extraneous will be pointed out later
Overall in this example a controller serves as a mediator between the model and the viewrelationship between the data model and the graphical user interface representation of the state of the application has to be maintained
The mediator implements listening functionality
It stands between the GUI/client/view and the data model
It is responsible for maintaining the relationship
The Scenario controller serves as a mediator between the model and the view
The graphical user interface for the example is shown on the overhead following the next one
A factory has machines in it, and the machines at any given time have a set of tubs of materials that belong to them
The interaction of interest is the moving of tubs from one machine to another
“Assume that the objects begin as shown in Figure 10.4. Suppose that the object t represents tub T308 and that the object m represents the machine Fuser-2101. Complete the object diagram in Figure 10.5, showing the effects of the code that updates the tub’s location. What defect does this reveal?”
[Figures 10.4 and 10.5 are shown on the next overheads.]
“The problem that the developer’s code introduces is that StarPress2402 still thinks that it has tub T308. In a relational table, changing the machine attribute of a row automatically removes the tub from the prior machine. This automated removal does not occur when the relation is dispersed across a distributed object model. The proper modeling of the tub/machine relation requires special logic that you can remove to a separate mediator object.”
get Java API on the hash table get() and put() methods
public Vget(Object key)
Returns the value to which the specified key is mapped in this hashtable.
Specified by: get in interface Map<K,V>
Specified by: get in class Dictionary<K,V>
Parameters: key - a key in the hashtable.
Returns: the value to which the key is mapped in this hashtable; null if the key is not mapped to any value in this hashtable.
Throws:NullPointerException - if the key is null.
See Also: put(Object, Object)
put Java API on the hash table get() and put() methods
public Vput(K key, V value)
Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null. The value can be retrieved by calling the get method with a key that is equal to the original key.
Specified by: put in interface Map<K,V>
Specified by: put in class Dictionary<K,V>
Parameters: key - the hashtablekey.value - the value.
Returns: the previous value of the specified key in this hashtable, or null if it did not have one.
Throws:NullPointerException - if the key or value is null.