![]() Now let’s reconsider our design, remembering that each class should have not more than one reason for change.įirst, the logic for actually handling the Starter’s ignition process should be moved to the Starter class and the Starter itself should contain a Start() method which will be invoked by the Engine’s Start() method. ![]() The key point here is that the Engine class has more than one responsibility and per the Single Responsibility Principle this is not good. If either of these things changed we would have to modify our Engine class to accommodate the change(s).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |