Hi Neeraj: please can you work further on a language for expressing patterns using APPCs. This is still pretty rough but contains a good start. -- Karl ------------- NullObject pattern expressed using a strategy: NullObject Pattern: Short description: If you are testing for absence of a target before sending it a message, consider using a special object to indicate absence. // in Demeter/Java syntax, except the caller transportation Container { void Something() from caller:Container to {Target,EmptyTarget} { // inlined visitor before Target (@ host.Continue(); @) before EmptyTarget (@ caller.NullDetected(); @) } } EmptyTarget is the special object. If a Container-object does not contain a Target-object, NullDetetced will be called. Assumes that Target and EmptyTarget are mutually exclusive and that several Target-objects may exist but at most one EmptyTarget-object. The simplest class graph would be: Container : Target | EmptyTarget. but infinitely many more are possible. In APPC syntax: APPC NULL_OBJECT Interface class valued variables C, T : IT // T has method Continue() Behavior C { // new method void Something() from caller:C to {T,EmptyTarget} { // inlined visitor before T (@ host.Continue(); @) before EmptyTarget (@ caller.NullDetected(); @) } } usage: NULL_OBJECT(Container,Target) The logging pattern from last night: APPC LOGGING_PATTERN Interface class valued variables A : Loggable // A is a class that fulfills the Loggable personality // tells what to log method valued variables A.[f1 ... fn] strategies from A to log:Logging Behavior modifies A.[f1 ... fn] A { void [f1 ... fn](...) {next(); log.register(what_to_log([f1 ... fn])); } } usage: LOGGING_PATTERN(Account; deposit(Amount), withdraw(Amount); what_to_log(deposit,Amount,"deposit") what_to_log(withdraw,Amount,"withdraw") -- Karl