Dahua Design Patterns--Single Responsibility Principle

    The principle of single responsibility is to separate the functions in a class, such as a mobile phone class, the functions of the mobile phone camera, video camera, music playback, etc., and abstract them into a class, each class has a single function. Then the phone classes just need to encapsulate their references. In this way, the coupling degree is solved, and the code of each function can be reused, highly flexible, and easy to maintain.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325658385&siteId=291194637