Java design Pattern _ appearance mode

Source: Internet
Author: User


package com.wangbiao.design.facade;/** *  *  @Title:  client.java * @ package com.wangbiao.design.facade *  @Description: todo  *  @author   wangbiao    *  @date  2014-9-20  pm 03:56:08  *  @version   V1.0 */public class client {    public static void main (String[] args)  {        facade facade = new  facade ();         facade.methoda ();         facade.methodb ();    }}package com.wangbiao.design.facade;/**  *  *  @Title: facade.java *  @Package  com.wangbiao.design.facade *  @Description: design pattern-facade  *  @author  wangbiao    *   @date  2014-9-20  pm 03:54:02  *  @version  V1.0 */public class Facade {         private subsystemone one;    private  SubSystemTwo two;    private SubSystemThree three;     private subsystemfour four;        public facade ( )  {        //init         One = new subsystemone ();         two = new  subsystemtwo ();         three = new subsystemthree ();         four = new subsystemfour ();     }        public void methoda () {       &nBsp; // one,two,three        one.methodone ();         two.methodtwo ();         Three.methodthree ();     }        public void  methodb () {        // four,three         three.methodthree ();         four.methodfour ();     }    }class SubSystemOne{         public void methodone () {         System.out.println ("Subsystemone");     }    }class subsystemtwo{         public void methodtwo () {         system.out.println ("SubsyStemtwo ");    }    }class subsystemthree{         public void methodthree () {         System.out.println ("Subsystemthree");    }    }class  Subsystemfour{        public void methodfour () {         system.out.println ("Subsystemfour");    }     }


Java design Pattern _ appearance mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.