<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GAGAMA</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GAGAMA"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/GAGAMA"/>
	<updated>2026-06-13T20:21:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8746</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8746"/>
		<updated>2007-11-17T17:29:01Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Separation of Responsibility. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
        if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
        ... //Check if a customer was already registered with that name&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
        ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead, it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call ''bindValidateAndSave'' is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called  ''validateCustomer'', ''bindCustomer'' (bind and add new shoppingCart),and ''saveCustomer'' respectively.[http://designparadigm.wordpress.com/] The code after using Separation of Responsibility is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void bindValidateAndSave(Map requestParameters) {&lt;br /&gt;
        customer = validateCustomer(requestParameters);&lt;br /&gt;
        bindCustomer(customer);&lt;br /&gt;
        saveCustomer(customer);	&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Customer validateCustomer(Map requestParameters) {&lt;br /&gt;
       Customer customer = new Customer();&lt;br /&gt;
       customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
       if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
        ...&lt;br /&gt;
}&lt;br /&gt;
public void bindCustomer(Customer customer) {&lt;br /&gt;
       customer.setShoppingCart(new ShoppingCart());&lt;br /&gt;
}&lt;br /&gt;
public void saveCustomer(Customer customer) {&lt;br /&gt;
       customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;br /&gt;
&lt;br /&gt;
[4] [http://designparadigm.wordpress.com/ Java by experience]&lt;br /&gt;
&lt;br /&gt;
[5] http://www.zzrose.com/tech/pmr_sweEffectiveObjectResponsibility.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8745</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8745"/>
		<updated>2007-11-17T17:27:43Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Separation of Responsibility. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
        if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
        ... //Check if a customer was already registered with that name&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
        ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead, it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call ''bindValidateAndSave'' is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called  ''validateCustomer'', ''bindCustomer'' (bind and add new shoppingCart),and ''saveCustomer'' respectively.[http://designparadigm.wordpress.com/] The code after using Separation of Responsibility is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void bindValidateAndSave(Map requestParameters) {&lt;br /&gt;
        customer = validateCustomer(requestParameters);&lt;br /&gt;
        bindCustomer(customer);&lt;br /&gt;
        saveCustomer(customer);	&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public Customer validateCustomer(Map requestParameters) {&lt;br /&gt;
       Customer customer = new Customer();&lt;br /&gt;
       customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
       if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
        ...&lt;br /&gt;
}&lt;br /&gt;
public void bindCustomer(Customer customer) {&lt;br /&gt;
       customer.setShoppingCart(new ShoppingCart());&lt;br /&gt;
}&lt;br /&gt;
public void saveCustomer(Customer customer) {&lt;br /&gt;
       customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;br /&gt;
&lt;br /&gt;
[4] [http://designparadigm.wordpress.com/ Java by experience]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8743</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8743"/>
		<updated>2007-11-17T17:26:34Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Separation of Responsibility. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
        ...&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
        ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead, it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call ''bindValidateAndSave'' is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called  ''validateCustomer'', ''bindCustomer'' (bind and add new shoppingCart),and ''saveCustomer'' respectively.[http://designparadigm.wordpress.com/] The code after using Separation of Responsibility is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void bindValidateAndSave(Map requestParameters) {&lt;br /&gt;
        customer = validateCustomer(requestParameters);&lt;br /&gt;
        bindCustomer(customer);&lt;br /&gt;
        saveCustomer(customer);	&lt;br /&gt;
}&lt;br /&gt;
public Customer validateCustomer(Map requestParameters) {&lt;br /&gt;
       Customer customer = new Customer();&lt;br /&gt;
       customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
       if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
        ...&lt;br /&gt;
}&lt;br /&gt;
public void bindCustomer(Customer customer) {&lt;br /&gt;
       customer.setShoppingCart(new ShoppingCart());&lt;br /&gt;
}&lt;br /&gt;
public void saveCustomer(Customer customer) {&lt;br /&gt;
       customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;br /&gt;
&lt;br /&gt;
[4] [http://designparadigm.wordpress.com/ Java by experience]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8740</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8740"/>
		<updated>2007-11-17T17:21:57Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Separation of Responsibility. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead, it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call ''bindValidateAndSave'' is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called  ''validateCustomer'', ''bindCustomer'' (bind and add new shoppingCart),and ''saveCustomer'' respectively.[http://designparadigm.wordpress.com/] The code after using Separation of Responsibility is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void bindValidateAndSave(Map requestParameters) {&lt;br /&gt;
	if (!validateCustomer(requestParameters))&lt;br /&gt;
                return;&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        &lt;br /&gt;
}&lt;br /&gt;
public Customer validateCustomer(Map requestParameters) {&lt;br /&gt;
       Customer customer = new Customer();&lt;br /&gt;
       customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
       if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return 0;&lt;br /&gt;
	}&lt;br /&gt;
        return 1;&lt;br /&gt;
}&lt;br /&gt;
public void bindCustomer(Customer customer) {&lt;br /&gt;
       customer.setShoppingCart(new ShoppingCart());&lt;br /&gt;
}&lt;br /&gt;
public void saveCustomer(Customer customer) {&lt;br /&gt;
       customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;br /&gt;
&lt;br /&gt;
[4] [http://designparadigm.wordpress.com/ Java by experience]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8739</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8739"/>
		<updated>2007-11-17T17:02:48Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Separation of Responsibility. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead, it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call ''bindValidateAndSave'' is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called  ''validateCustomer'', ''bindCustomer'' (bind and add new shoppingCart),and ''saveCustomer'' respectively.[http://designparadigm.wordpress.com/] The code after using Separation of Responsibility is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;br /&gt;
&lt;br /&gt;
[4] [http://designparadigm.wordpress.com/ Java by experience]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8737</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8737"/>
		<updated>2007-11-17T17:02:12Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Separation of Responsibility. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead, it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call ''bindValidateAndSave'' is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called  ''validateCustomer'', ''bindCustomer'' (bind and add new shoppingCart),and ''saveCustomer'' respectively.[http://designparadigm.wordpress.com/]&lt;br /&gt;
&lt;br /&gt;
The code after using Separation of Responsibility is shown below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;br /&gt;
&lt;br /&gt;
[4] [http://designparadigm.wordpress.com/ Java by experience]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8735</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8735"/>
		<updated>2007-11-17T16:59:20Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call bindValidateAndSave is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called  validateCustomer, bindCustomer (bind and add new shoppingCart),and saveCustomer respectively.&lt;br /&gt;
&lt;br /&gt;
With the last method (saveCustomer) I get the WHY? question a lot, since the extracted method is actually only 1 line of code long. Although it might not improve readability for programmers, it’s a paradigm shift in how the method is addressed. In our example, if the saveNewCustomer calls customerService.save() it’s responsible that the save method is actually called right. Instead if we let it delegate to a newly extracted method (saveCustomer) it isn’t responsible for the explicit saving. Instead now it defines the algorithm. In this case bind, validate, save. The implementation is just the save method. [http://designparadigm.wordpress.com/]&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;br /&gt;
&lt;br /&gt;
[4] [http://designparadigm.wordpress.com/ Java by experience]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8733</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8733"/>
		<updated>2007-11-17T16:54:34Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call bindValidateAndSave is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called bindCustomer (bind and add new shoppingCart), validateCustomer and saveCustomer.&lt;br /&gt;
&lt;br /&gt;
With the last method (saveCustomer) I get the WHY? question a lot, since the extracted method is actually only 1 line of code long. Although it might not improve readability for programmers, it’s a paradigm shift in how the method is addressed. In our example, if the saveNewCustomer calls customerService.save() it’s responsible that the save method is actually called right. Instead if we let it delegate to a newly extracted method (saveCustomer) it isn’t responsible for the explicit saving. Instead now it defines the algorithm. In this case bind, validate, save. The implementation is just the save method. [http://designparadigm.wordpress.com/]&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;br /&gt;
&lt;br /&gt;
[4] [http://designparadigm.wordpress.com/ Java by experience]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8732</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8732"/>
		<updated>2007-11-17T16:54:00Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call bindValidateAndSave is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called bindCustomer (bind and add new shoppingCart), validateCustomer and saveCustomer.&lt;br /&gt;
&lt;br /&gt;
With the last method (saveCustomer) I get the WHY? question a lot, since the extracted method is actually only 1 line of code long. Although it might not improve readability for programmers, it’s a paradigm shift in how the method is addressed. In our example, if the saveNewCustomer calls customerService.save() it’s responsible that the save method is actually called right. Instead if we let it delegate to a newly extracted method (saveCustomer) it isn’t responsible for the explicit saving. Instead now it defines the algorithm. In this case bind, validate, save. The implementation is just the save method. [http://designparadigm.wordpress.com/]&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8730</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8730"/>
		<updated>2007-11-17T16:52:50Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	&lt;br /&gt;
        customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call bindValidateAndSave is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called bindCustomer (bind and add new shoppingCart), validateCustomer and saveCustomer.&lt;br /&gt;
&lt;br /&gt;
With the last method (saveCustomer) I get the WHY? question a lot, since the extracted method is actually only 1 line of code long. Although it might not improve readability for programmers, it’s a paradigm shift in how the method is addressed. In our example, if the saveNewCustomer calls customerService.save() it’s responsible that the save method is actually called right. Instead if we let it delegate to a newly extracted method (saveCustomer) it isn’t responsible for the explicit saving. Instead now it defines the algorithm. In this case bind, validate, save. The implementation is just the save method.&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8725</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8725"/>
		<updated>2007-11-17T16:49:57Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above method name is save. So I expect that the code only does some saving. Instead it creates a new customer, checks if it’s valid (no double names) and then saves it. So the method is actually performing 3 things.&lt;br /&gt;
&lt;br /&gt;
This method should be refactored into 4 methods. The first method, which I would call bindValidateAndSave is the algorithm method. It tells what to do, not how it’s done. Its responsibility is to provide the algorithm. The 3 other methods would be called bindCustomer (bind and add new shoppingCart), validateCustomer and saveCustomer.&lt;br /&gt;
&lt;br /&gt;
With the last method (saveCustomer) I get the WHY? question a lot, since the extracted method is actually only 1 line of code long. Although it might not improve readability for programmers, it’s a paradigm shift in how the method is addressed. In our example, if the saveNewCustomer calls customerService.save() it’s responsible that the save method is actually called right. Instead if we let it delegate to a newly extracted method (saveCustomer) it isn’t responsible for the explicit saving. Instead now it defines the algorithm. In this case bind, validate, save. The implementation is just the save method.&lt;br /&gt;
&lt;br /&gt;
Working in this fashion takes some getting used to, but in the end I truly believe this produces stabler and more maintainable code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8724</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8724"/>
		<updated>2007-11-17T16:48:28Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); &lt;br /&gt;
            //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8722</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8722"/>
		<updated>2007-11-17T16:48:05Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;); //Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8721</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8721"/>
		<updated>2007-11-17T16:47:51Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Example 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with another example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;);	//Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	customerService.save(customer);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8720</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8720"/>
		<updated>2007-11-17T16:47:11Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
Let’s look into the matter with an example. Consider following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public void createCustomer(Map requestParameters) {&lt;br /&gt;
	Customer customer = new Customer();&lt;br /&gt;
	customer.setName = requestParameters.get(&amp;quot;name&amp;quot;);	//Check if a customer was already registered with that name&lt;br /&gt;
	if (customerService.getCustomerByName(customer.getName()) != null) {&lt;br /&gt;
		System.out.println(&amp;quot;Customer already exists&amp;quot;);&lt;br /&gt;
		return;&lt;br /&gt;
	}&lt;br /&gt;
	customer.setShoppingCart(new ShoppingCart());	customerService.save(customer);}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 3===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8715</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8715"/>
		<updated>2007-11-17T16:34:39Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
=== Example 2===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8714</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8714"/>
		<updated>2007-11-17T16:33:44Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* An Example Not using SOR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report.&lt;br /&gt;
&lt;br /&gt;
=== Another E ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8713</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8713"/>
		<updated>2007-11-17T16:33:05Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
=== Another E ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8712</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8712"/>
		<updated>2007-11-17T16:30:38Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* An Example - NOT using SOR */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example Not using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
=== Another E ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8711</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8711"/>
		<updated>2007-11-17T16:30:17Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Defination of Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility (SOR)==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example - NOT using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
=== Another E ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8710</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8710"/>
		<updated>2007-11-17T16:29:58Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* An Example - NOT Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example - NOT using SOR===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
=== Another E ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8709</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8709"/>
		<updated>2007-11-17T16:27:49Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* An Example - NOT Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example - NOT Separation of Responsibility ===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an Single Responsibility Principle. The SOR principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
Obviously, we don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
=== Another E ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8708</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8708"/>
		<updated>2007-11-17T16:25:28Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Applications of Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
=== An Example - NOT Separation of Responsibility ===&lt;br /&gt;
I am thinking maybe it is better for us to first take a look at what is NOT an SOR principle. The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This class violates the SOR because it has three reasons to change: &lt;br /&gt;
*The business rules having to do with calculating pay. &lt;br /&gt;
*The database schema. &lt;br /&gt;
*The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
=== Another E ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8706</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8706"/>
		<updated>2007-11-17T16:17:57Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8705</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8705"/>
		<updated>2007-11-17T16:17:15Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8704</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8704"/>
		<updated>2007-11-17T16:17:07Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;br /&gt;
[3] http://www.codinghorror.com/blog/archives/000805.html&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8703</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8703"/>
		<updated>2007-11-17T16:16:43Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8702</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8702"/>
		<updated>2007-11-17T16:16:29Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us Programming Life and the Zen of Computers]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8701</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8701"/>
		<updated>2007-11-17T16:14:58Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8700</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8700"/>
		<updated>2007-11-17T16:13:07Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.[3]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8699</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8699"/>
		<updated>2007-11-17T16:12:23Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8698</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8698"/>
		<updated>2007-11-17T16:11:58Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8697</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8697"/>
		<updated>2007-11-17T16:11:05Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Application of Separation of */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applications of Separation of Responsibility ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8696</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8696"/>
		<updated>2007-11-17T16:10:43Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* A Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Application of Separation of ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8695</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8695"/>
		<updated>2007-11-17T16:09:53Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A Example ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8694</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8694"/>
		<updated>2007-11-17T16:09:16Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once(The Dry Principle)]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
== A Example ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8693</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8693"/>
		<updated>2007-11-17T16:08:12Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Encapsulation]]: Data are kept in only one place.&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment.&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
== A Example ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8692</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8692"/>
		<updated>2007-11-17T16:04:42Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment. .[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction.&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== A Example ==&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8691</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8691"/>
		<updated>2007-11-17T16:03:32Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment. .[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Once and Only Once]]: The separation of responsibility can help to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8690</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8690"/>
		<updated>2007-11-17T15:59:40Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment. .[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8689</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8689"/>
		<updated>2007-11-17T15:58:59Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment. .[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened and implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8688</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8688"/>
		<updated>2007-11-17T15:58:24Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment. .[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Decreases the coupling between two objests]]: One class do not need to know what happened implementation details in the other class (e.x.,what kind of object the pointer points to). [http://www.codinghorror.com/blog/archives/000805.html]&lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8687</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8687"/>
		<updated>2007-11-17T15:55:45Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment. .[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Decreases the coupling between two objests: One class do not need to know what happened implementation details in the other class (e.x.,what kind of object the pointer points to). &lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8686</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8686"/>
		<updated>2007-11-17T15:52:59Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment&lt;br /&gt;
 &lt;br /&gt;
*[[Scalability]]: The ease with which a system or component can adjust to changing load.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Decreases the coupling between two objests. &lt;br /&gt;
One class do not need to know the what happened in the other class and what kind of object the pointer points to. &lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc]&lt;br /&gt;
[2] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8685</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8685"/>
		<updated>2007-11-17T15:52:27Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Defination of Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.[http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc] &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment&lt;br /&gt;
 &lt;br /&gt;
*[[Scalability]]: The ease with which a system or component can adjust to changing load.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Decreases the coupling between two objests. &lt;br /&gt;
One class do not need to know the what happened in the other class and what kind of object the pointer points to. &lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8684</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8684"/>
		<updated>2007-11-17T15:51:58Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Defination of Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes.http://courses.ncsu.edu/csc517/common/lectures/notes/lec20.doc &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment&lt;br /&gt;
 &lt;br /&gt;
*[[Scalability]]: The ease with which a system or component can adjust to changing load.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Decreases the coupling between two objests. &lt;br /&gt;
One class do not need to know the what happened in the other class and what kind of object the pointer points to. &lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8683</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8683"/>
		<updated>2007-11-17T15:51:08Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes. &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: An object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: An object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: Ready to be used in more than one application or environment&lt;br /&gt;
 &lt;br /&gt;
*[[Scalability]]: The ease with which a system or component can adjust to changing load.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Decreases the coupling between two objests. &lt;br /&gt;
One class do not need to know the what happened in the other class and what kind of object the pointer points to. &lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8682</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8682"/>
		<updated>2007-11-17T15:46:32Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes. &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: A object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. &lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: A object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: The degree to which a software module or other work product can be used in more than one computing program or software system&lt;br /&gt;
&lt;br /&gt;
*Scalability: The ease with which a system or component can adjust to changing load.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Decreases the coupling between two objests. &lt;br /&gt;
One class do not need to know the what happened in the other class and what kind of object the pointer points to. &lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8681</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8681"/>
		<updated>2007-11-17T15:44:46Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes. &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: A object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: A object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: The degree to which a software module or other work product can be used in more than one computing program or software system.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Scalability: The ease with which a system or component can adjust to changing load.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Decreases the coupling between two objests. &lt;br /&gt;
One class do not need to know the what happened in the other class and what kind of object the pointer points to. &lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[1] [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8680</id>
		<title>CSC/ECE 517 Fall 2007/wiki3 3 qq</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2007/wiki3_3_qq&amp;diff=8680"/>
		<updated>2007-11-17T15:42:52Z</updated>

		<summary type="html">&lt;p&gt;GAGAMA: /* Why Separation of Responsibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Topic ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Defination of Separation of Responsibility ==&lt;br /&gt;
In Object-Oriented Design (OOD)&lt;br /&gt;
* One class should be responsible for knowing and maintaining a set of data, even if that data is used by many other classes. &lt;br /&gt;
* Different responsibilities should be divided among different objects. Ideally, each individual object has one single responsibility, which we call Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why Separation of Responsibility ==&lt;br /&gt;
&lt;br /&gt;
*[[Flexibility]]: A object with few responsibilities can be modified for use in applications or environments other than those for which it was specifically designed. [http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Maintainability]]: A object with few responsibilities can be easily modified to correct faults, improve performance, or other attributes, or adapt to a changed environment without affecting other functionality.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*[[Reusability]]: The degree to which a software module or other work product can be used in more than one computing program or software system.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Scalability: The ease with which a system or component can adjust to changing load.[http://64.233.169.104/search?q=cache:hv11-bOg9tAJ:www.hanselman.com/blog/PermaLink.aspx%3Fguid%3Da0a65e0c-5ef8-41e4-a566-1739b4428aa5+Separation+of+Responsibility+programming&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;cd=32&amp;amp;gl=us]&lt;br /&gt;
&lt;br /&gt;
*Decreases the coupling between two objests. &lt;br /&gt;
One class do not need to know the what happened in the other class and what kind of object the pointer points to. &lt;br /&gt;
&lt;br /&gt;
*Avoid code repetition&lt;br /&gt;
If you have more than one way to express the same thing, at some point the two or three different representations will most likely fall out of step with each other. Even if they don't, you're guaranteeing yourself the headache of maintaining them in parallel whenever a change occurs. And change will occur. Don't repeat yourself is important if you want flexible and maintainable software. &lt;br /&gt;
&lt;br /&gt;
*Once and Only Once &lt;br /&gt;
Each and every declaration of behavior should occur once, and only once. This is one of the main goals, if not the main goal, when refactoring code. The design goal is to eliminate duplicated declarations of behavior, typically by merging them or replacing multiple similar implementations with a unifying abstraction. &lt;br /&gt;
&lt;br /&gt;
=== A Example ===&lt;br /&gt;
Let's think about a example shown below:&lt;br /&gt;
Each ''node'' consists of data and a link (next) and the ''LinkedList'' implemented from Nodes.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class Node { &lt;br /&gt;
　　    Object data; &lt;br /&gt;
　　    Node next; //point to next node &lt;br /&gt;
　　    } &lt;br /&gt;
&lt;br /&gt;
    class Linklist implement Node{&lt;br /&gt;
        ...&lt;br /&gt;
        ...&lt;br /&gt;
       public Object currentNode() &lt;br /&gt;
　　　　{ &lt;br /&gt;
　　        Node temp=cursor(); &lt;br /&gt;
　　        return temp.data; &lt;br /&gt;
　　    }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, we make a object ''client''  responsible for traversing a list which and keeping track of where it is. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class client{&lt;br /&gt;
        Linklist a   &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Single Responsibility Principle says that a class should have one, and only one, reason to change. As an example, imagine the following class: &lt;br /&gt;
&lt;br /&gt;
class Employee&lt;br /&gt;
{&lt;br /&gt;
  public Money calculatePay()&lt;br /&gt;
  public void save()&lt;br /&gt;
  public String reportHours()&lt;br /&gt;
}&lt;br /&gt;
This class violates the SRP because it has three reasons to change: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The business rules having to do with calculating pay. &lt;br /&gt;
The database schema. &lt;br /&gt;
The format of the string that reports hours. &lt;br /&gt;
We don't want a single class to be impacted by these three completely different forces. We don't want to modify the Employee class every time the accounts decide to change the format of the hourly report&lt;/div&gt;</summary>
		<author><name>GAGAMA</name></author>
	</entry>
</feed>