Java view mode (big talk design mode)

Source: Internet
Author: User

Design patterns, many people have been used, just do not know its name, generally a very nice system, modular do are very good, so if a new business, just need to assemble each module can meet the new business,

From the point of view of the program, is that we only need to open a class, and then constantly to adjust the module method, assembly on the OK, code reusability is relatively good, but for the new employees, they are not clear, the system has been modular,

At this time, the old staff to use the appearance of the model is particularly important, the general experience of the old staff will provide an interface for the new employees to call, the specific internal logic is used by the old staff to use the appearance mode to complete, in fact, the old staff code is very small.

Liar design mode-Class diagram

Let's take a cooking example and look at the actual Java code:

/**  *     */  Public class Subsystemone {    publicvoid  Buyrice () {        System.out.println ("Buy rice"  );    }}
/**  *     */  Public class Subsystemtwo {    publicvoid  Washfood () {        System.out.println (" Wash rice and wash vegetables ");}    }
 /**   * Subsystem class  */ public  class   Subsystemthree { public  void  Span style= "color: #000000;"    > Makefood () {System.out.println ( cooking "); }}
/**  *      */  Public class Test {    publicstaticvoid  main (string[] args) {        new  facade ();        Façade. Method ();    }}

The output is:

Buy rice and rice to wash vegetables and cook

Can see the process of cooking are all, we just need to put together these processes, is a cooking process, you can see how the system modularity, directly affect the subsequent development speed.

The above is the author of the appearance of the understanding of the model, hope to help learn the children's shoes!

Java view mode (big talk design 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.