Recently, I have been studying some specific design patterns.CodeIt is found that there are quite a few places to use the design pattern in the android source code. Good systems must focus on good design, but on scalability and maintenance. This article introduces some simple design pattern types used in phoneservice:
1. Simple factory mode:
Note: I personally think this factory mode is slightly different from the standard factory mode. The standard is that there are clients to decide which instance to create. For example, if you want to use gsmphone, generally, use phone = phonefactory. makegsmphone (), so there is a possibility of improvement...
2. Proxy mode:
Note: In the proxy mode, the client does not need to know gsmphone and cmdaphone. It only needs to maintain a proxy object to complete Column Operations.
Other models will be updated continuously in the follow-up blog. If you say something wrong, please click it ~