Home > Back-end >  Have questions about single responsibility
Have questions about single responsibility

Time:12-10

Single responsibility principle (SRP) : for a class, should be only one cause of its change,
This is the definition of a single responsibility, but there have been a lot of questions, such as mobile phone, can make a phone call, send text messages, see the video, it can cause the cause of the change, does not meet the single responsibility principle, in fact, a little more complicated point class is not only a duty, then the single responsibility principle when applicable? A search on the net, are scripted posted the definition of single responsibility and benefits, with mobile phone class, for example, if use single responsibility, how should design class,
  • Related