mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-13 22:16:03 +00:00
Comments for mediator example.
This commit is contained in:
1 parent
40e5444718
commit
13306023f0
3 files changed
+17
No files matched your search
@@ -1,5 +1,12 @@
|
|||||||
package com.iluwatar;
|
package com.iluwatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Mediator encapsulates how set of objects (PartyMember) interact.
|
||||||
|
* Instead of referring to each other directly they
|
||||||
|
* use the mediator (Party) interface.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class App
|
public class App
|
||||||
{
|
{
|
||||||
public static void main( String[] args )
|
public static void main( String[] args )
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
package com.iluwatar;
|
package com.iluwatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Mediator interface.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public interface Party {
|
public interface Party {
|
||||||
|
|
||||||
void addMember(PartyMember member);
|
void addMember(PartyMember member);
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
package com.iluwatar;
|
package com.iluwatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Interface for party members interacting with Party.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public interface PartyMember {
|
public interface PartyMember {
|
||||||
|
|
||||||
void joinedParty(Party party);
|
void joinedParty(Party party);
|
||||||
|
|||||||
Reference in new issue
Block a user