''''Consumer Pattern'''' - ''work in progress'' '''Description''' You have a group of objects that you would like to use in a certain way depending on what the object actually is. ---- '''Example''' public interface Product { } public class Good''''''Product implements Product {...} public class Hazardous''''''Product implements Product {...} public class Recalled''''''Product implements Product {...} ... public class Consume''''''Product { private final Consume''''''Product CONSUMER = new Consume''''''Product(); private Consume''''''Product() {} public getInstance() { return CONSUMER; } public boolean test(Product p) {} ''Uh, the above definition is an error in Java; if a function is declared to return a boolean, it should either be abstract or in fact return a boolean. I assume you meant something else, delete when fixed.'' public void use(Product p) {} public void tag(Product p, Tag t) {} ... } public class Application { Recalled''''''Product rp; rp = new Recalled''''''Product(); if (Consume''''''Product.test(rp)) { Consume''''''Product.use(rp); } else { Consume''''''Product.tag(rp, Tag.BAD); } ... } ---- '''Note''' Not sure if this Pattern is already defined. It is similar to VisitorPattern but not really sure... comments are welcome. ---- '''Comments''' I know that this page is a work in progress, but what is this pattern used for? Much of the Java code looks suspicious, and it appears that instantiating a ConsumeProduct retroactively instantiates another ConsumeProduct, and so on...a recursive class definition that never terminates is not a good thing. Perhaps you left out a "static" declaration; it almost appears you are trying for SingletonPattern, given that you have a method named getIntance()??? ----