CSC/ECE 517 Fall 2007/wiki3 3 as

From Expertiza_Wiki
Revision as of 01:07, 20 November 2007 by Smalugu (talk | contribs) (→‎Examples)
Jump to navigation Jump to search

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 the concept of separation of responsibility for a GUI-based application. The example is easy to understand and comes with a detailed explanation of the code and how the principle is used. This is a good site to see the separation of responsibility applied Java.


http://designparadigm.wordpress.com/ This is a page on Separation of Responsibility. Proper explanation is provided on what the principle is along with a easy-to-understand example. Further information about naming conventions (naming classes and methods) and their relationship with the principle is also provided.


Eclipse Documentation This document 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 well-known 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 while the improved code is not given. Hence 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 This page provides a more advanced example on how to use the principle in logins and password encryption. The implementation of this example contains 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-based development for mobile devices. This site depicts how the separation-of-responsibility can be accomplished with multi-tiering. It gives a complex example, yet it is a good source to see how the principle is used in carious applications.


Sun This page includes a description and analysis of a project. Though it does not provide any code, you can see how separation of responsibility is achieved in the design process. The project also uses the MVC pattern. One need not understand the entire project in order to visualize how the separation of concerns helps in the design process.Hence the long description of the project should not discourage you.

References

Javacoffeebreak.

wikipedia

http://designparadigm.wordpress.com/

http://davidhayden.com/blog/dave/archive/2004/11/19/631.aspx