
/**
* Represents a proxy for Subject
*/
public class Proxy extends Subject {
/**
* Holds the subject instance.
*/
private Subject subject;
/** @see patterns.gof.proxy.Subject#sampleMethod() */
public int sampleMethod() {
return subject.sampleMethod();
}
}
/**
* Represents a real subject
*/
public class RealSubject extends Subject {
public int sampleMethod() {
/* something happens here */
return 0;
}
}
/**
* Represents a subject
*
* @role __Subject
*/
public abstract class Subject {
/**
* This is sample method to be called by proxy
*/
public abstract int sampleMethod();
}
Privacy Statement | Copyright Notice | Licenses
© 1999-2012 Waltercedric.com. Designed by Cédric Walter. Sitemap
Reproduction without explicit permission is prohibited. All Rights Reserved. All photos remain copyright © their rightful owners. No copyright infringement is intended.
Disclaimer: The editor(s) reserve the right to edit any comments that are found to be abusive, offensive, contain profanity, serves as spam, is largely self-promotional, or displaying attempts to harbour irrelevant text links for any purpose.