Home  >  Article  >  Java  >  What are the advantages and disadvantages of java bridge mode

What are the advantages and disadvantages of java bridge mode

WBOY
WBOYforward
2023-05-20 20:34:04951browse

1. The advantages are abstraction and separation, and strong scalability. It complies with the principle of opening and closing and the principle of synthesis and reuse. Achieve transparent details to customers.

2. The disadvantage is that it increases the difficulty of system understanding and design.

Since the aggregation relationship is established at the abstraction layer, developers are required to design and program abstractions to correctly identify two independently changing dimensions in the system.

Example

public class Client {
    public static void main(String[] args) {
        OperatingSystemVersion os = new Mac(new AVIFile());
        os.play("战狼3");
        /**
         * 输出:Mac正在播放:avi视频文件:战狼3
         */
    }
}

The above is the detailed content of What are the advantages and disadvantages of java bridge mode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete