CSC/ECE 517 Fall 2007/wiki3 3 as: Difference between revisions
Line 8: | Line 8: | ||
Separation of Responsibility has many similar terms or principles. All of them constitute similar ideas. These terms include Single Responsibility Principle, low coupling, Separation of Concerns and | Separation of Responsibility has many similar terms or principles. All of them constitute similar ideas. These terms include Single Responsibility Principle, low coupling, Separation of Concerns, modularity, Grasp pattern and 'Do one Thing' principle. | ||
Revision as of 00:56, 20 November 2007
Topic
Take the principle of Separation of Responsibility and catalog the information on it available on the Web. Find good descriptions and good, concise, understandable examples. Tell which you consider the best to present to a class.
Separation of Responsibility
Separation of Responsibility states that a given problem involves different kinds of concerns, which should be identified and separated to cope with complexity, and to achieve the required engineering quality factors such as robustness, adaptability, maintainability, and reusability. The principle can be applied in various ways and it is an ubiquitous software engineering principle.
Separation of Responsibility has many similar terms or principles. All of them constitute similar ideas. These terms include Single Responsibility Principle, low coupling, Separation of Concerns, modularity, Grasp pattern and 'Do one Thing' principle.
In object-oriented methods the separated concerns are modeled as objects and classes, which are generally derived from the entities in the requirement specification and use cases. In structural methods, concerns are represented as procedures. In aspect-oriented programming, the term concern is extended with the so-called crosscutting properties such as synchronization, memory management and persistency.
Principle
The clear distinction of functionality among
Description
This is similar to the GRASP patterns.
Examples
Below you can see many sites which include Separation of Responsibility example. We also present some information about the sites next to their links.
Javacoffeebreak This site contains an example using separation of responsibility for an easy GUI application. The example is easy to understand and there is a detailed explanation of the code and how the principle is used. This is a good site to see the separation of responsibility in GUI of Java.
http://designparadigm.wordpress.com/ This is a page that is written on Separation of Responsibility. There is proper explanation on what the principle is and there is also a very easy and understandable example. One can also find information about naming conventions (naming classes and methods) and their relationship with the principle.
Eclipse Documentation This documentation teaches how to draw shapes using the MVC pattern. The separated responsibility components included are called View / EditPart / IFigure. Although there is not much information about the principle, the example is described in detail. This is a good link for observing the principle in graphical modeling framework.
wikipedia This page describes aspect oriented programming (AOP) which is one of the most know applications of separation of concerns. AOP cares more on separating cross cutting concerns. The code given here is an example to weak separation of responsibility, the improved code is not given. So this site is good for only observing where you need to apply separating of concerns.
http://weblogs.java.net/blog/tchangu/archive/2006/02/a_simple_utilit_1.html An advance example about how the principle is used in logins and password encryption. You can see 4 different classes for different tasks including: creating a database, logging, checking the password from database and encryption.
http://msdn2.microsoft.com/en-us/library/ms838356.aspx A more advanced site about component base development for mobile devices. This site shows how the separation principle can be accomplished with multi tiering. It contains a more complex example but it is a good source to see how the principle is used in other areas and other ways.
Sun This page includes a description and analysis of a project. Even though there is no coding example, in this site you can see how separation of responsibility is achieved in the design process. The project also had the MVC pattern. Understanding the project completely is not needed to see the importance of separating of concerns in this example, so the long description if the project should not discourage you.
References
http://designparadigm.wordpress.com/
http://davidhayden.com/blog/dave/archive/2004/11/19/631.aspx