<?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=Aamarna2</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=Aamarna2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Aamarna2"/>
	<updated>2026-10-01T03:41:22Z</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_2010/ch6_6f_ag&amp;diff=40865</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40865"/>
		<updated>2010-11-16T19:17:48Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. &lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SRP- The Single Responsibility Principle - A class should have one, and only one, reason to change.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; OCP- The Open Closed Principle - You should be able to extend a classes behavior, without modifying it.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; LSP- The Liskov Substitution Principle - Derived classes must be substitutable for their base classes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; DIP- The Dependency Inversion Principle- Depend on abstractions, not on concretions.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; ISP- The Interface Segregation Principle- Make fine grained interfaces that are client specific.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this chapter we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;CLIENTS SHOULD NOT BE FORCED TO DEPEND UPON INTERFACES THAT THEY DON'T USE.&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This principle provides guidelines to write our interfaces. When we write our interfaces we should take care to add only methods that should be there. If we add methods that should not be there the classes implementing the interface will have to implement those methods as well.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
&amp;lt;p&amp;gt;The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
#Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
#Interfaces containing methods that are not specific to a particular type of service are called polluted or fat interfaces. These must be avoided.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40864</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40864"/>
		<updated>2010-11-16T19:13:08Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. &lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;SRP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;The Single Responsibility Principle&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;A class should have one, and only one, reason to change.&amp;lt;/td&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;OCP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;The Open Closed Principle&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;You should be able to extend a classes behavior, without modifying it.&amp;lt;/td&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;LSP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;The Liskov Substitution Principle&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Derived classes must be substitutable for their base classes.&amp;lt;/td&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;DIP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;The Dependency Inversion Principle&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Depend on abstractions, not on concretions.&amp;lt;/td&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;ISP&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;The Interface Segregation Principle&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Make fine grained interfaces that are client specific.&amp;lt;/td&amp;gt;&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this chapter we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;CLIENTS SHOULD NOT BE FORCED TO DEPEND UPON INTERFACES THAT THEY DON'T USE.&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This principle provides guidelines to write our interfaces. When we write our interfaces we should take care to add only methods that should be there. If we add methods that should not be there the classes implementing the interface will have to implement those methods as well.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
&amp;lt;p&amp;gt;The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
#Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
#Interfaces containing methods that are not specific to a particular type of service are called polluted or fat interfaces. These must be avoided.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40863</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40863"/>
		<updated>2010-11-16T19:04:04Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;CLIENTS SHOULD NOT BE FORCED TO DEPEND UPON INTERFACES THAT THEY DON'T USE.&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This principle provides guidelines to write our interfaces. When we write our interfaces we should take care to add only methods that should be there. If we add methods that should not be there the classes implementing the interface will have to implement those methods as well.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
&amp;lt;p&amp;gt;The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
#Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
#Interfaces containing methods that are not specific to a particular type of service are called polluted or fat interfaces. These must be avoided.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40862</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40862"/>
		<updated>2010-11-16T19:03:48Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;b.	CLIENTS SHOULD NOT BE FORCED TO DEPEND UPON INTERFACES THAT THEY DON'T USE.&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This principle provides guidelines to write our interfaces. When we write our interfaces we should take care to add only methods that should be there. If we add methods that should not be there the classes implementing the interface will have to implement those methods as well.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
&amp;lt;p&amp;gt;The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
#Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
#Interfaces containing methods that are not specific to a particular type of service are called polluted or fat interfaces. These must be avoided.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40861</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40861"/>
		<updated>2010-11-16T19:02:40Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;Clients should not be forced to depend upon interfaces that they don't use.&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This principle provides guidelines to write our interfaces. When we write our interfaces we should take care to add only methods that should be there. If we add methods that should not be there the classes implementing the interface will have to implement those methods as well.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
&amp;lt;p&amp;gt;The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
#Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
#Interfaces containing methods that are not specific to a particular type of service are called polluted or fat interfaces. These must be avoided.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40860</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40860"/>
		<updated>2010-11-16T19:00:50Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;Clients should not be forced to depend upon interfaces that they don't use.&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This principle provides guidelines to write our interfaces. When we write our interfaces we should take care to add only methods that should be there. If we add methods that should not be there the classes implementing the interface will have to implement those methods as well.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
&amp;lt;p&amp;gt;The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
#Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
#Interfaces containing methods that are not specific to a particular type of service are called polluted or fat interfaces. These must be avoided.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40859</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40859"/>
		<updated>2010-11-16T18:59:20Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;Clients should not be forced to depend upon interfaces that they don't use.&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This principle provides guidelines to write our interfaces. When we write our interfaces we should take care to add only methods that should be there. If we add methods that should not be there the classes implementing the interface will have to implement those methods as well.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
#Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
#Interfaces containing methods that are not specific to a particular type of service are called polluted or fat interfaces. These must be avoided.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40858</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40858"/>
		<updated>2010-11-16T18:58:58Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;Clients should not be forced to depend upon interfaces that they don't use.&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;a.	 This principle provides guidelines to write our interfaces. When we write our interfaces we should take care to add only methods that should be there. If we add methods that should not be there the classes implementing the interface will have to implement those methods as well.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
#Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
#Interfaces containing methods that are not specific to a particular type of service are called polluted or fat interfaces. These must be avoided.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40857</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40857"/>
		<updated>2010-11-16T18:55:40Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
#Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
#Interfaces containing methods that are not specific to a particular type of service are called polluted or fat interfaces. These must be avoided.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40856</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40856"/>
		<updated>2010-11-16T18:53:11Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40855</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40855"/>
		<updated>2010-11-16T18:51:52Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40853</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40853"/>
		<updated>2010-11-16T18:50:19Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;table border=1&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;table border=1&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt; [[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40852</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40852"/>
		<updated>2010-11-16T18:49:35Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;table border=1&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;[[Image:Figure 1Class diagram for FullStudent (violates ISP).png]]&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&amp;lt;table border=1&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt; [[Image:Figure 2Class diagram for PartStudent (violates ISP).png ]]&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
[[Image:Figure 3Class diagram for FullStudent (conforms to ISP).png]]&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
[[Image:Figure 4Class diagram for PartStudent (conforms to ISP).png]]&lt;br /&gt;
&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40850</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40850"/>
		<updated>2010-11-16T18:39:48Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===#Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===#Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student at NCSU is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40849</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40849"/>
		<updated>2010-11-16T18:38:57Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
#Segregation through Delegation&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
#Segregation through multiple inheritance&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student at NCSU is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
    public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
        //do nothing since we didn't want this method in the first place!&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
    public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
 interface IAuditClass {&lt;br /&gt;
    public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
    public void auditClass()&lt;br /&gt;
    {&lt;br /&gt;
       //allow a student to audit an enrolled class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
    public void registerClass()&lt;br /&gt;
    {&lt;br /&gt;
        //allow a student to register for a particular class&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40848</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40848"/>
		<updated>2010-11-16T18:36:30Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
#Segregation through Delegation&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
#Segregation through multiple inheritance&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student at NCSU is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&lt;br /&gt;
interface IEnroll {&lt;br /&gt;
public void registerClass();&lt;br /&gt;
public void auditClass();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class FullStudent extends Student implements IEnroll {&lt;br /&gt;
public void registerClass()&lt;br /&gt;
{&lt;br /&gt;
//allow a student to register for a particular class&lt;br /&gt;
}&lt;br /&gt;
public void auditClass()&lt;br /&gt;
{&lt;br /&gt;
//allow a student to audit an enrolled class&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&lt;br /&gt;
class PartStudent extends Student implements IEnroll {&lt;br /&gt;
public void registerClass()&lt;br /&gt;
{&lt;br /&gt;
//allow a student to register for a particular class&lt;br /&gt;
}&lt;br /&gt;
public void auditClass()&lt;br /&gt;
{&lt;br /&gt;
//do nothing since we didn't want this method in the first place!&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
interface IRegisterClass {&lt;br /&gt;
public void registerClass();&lt;br /&gt;
}&lt;br /&gt;
interface IAuditClass {&lt;br /&gt;
public auditClass();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&lt;br /&gt;
class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
{	&lt;br /&gt;
public void registerClass()&lt;br /&gt;
{&lt;br /&gt;
//allow a student to register for a particular class&lt;br /&gt;
}&lt;br /&gt;
public void auditClass()&lt;br /&gt;
{&lt;br /&gt;
//allow a student to audit an enrolled class&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
{&lt;br /&gt;
public void registerClass()&lt;br /&gt;
{&lt;br /&gt;
//allow a student to register for a particular class&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40847</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40847"/>
		<updated>2010-11-16T18:34:42Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
#Segregation through Delegation&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
#Segregation through multiple inheritance&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student at NCSU is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&lt;br /&gt;
 interface IEnroll {&lt;br /&gt;
	public void registerClass();&lt;br /&gt;
	public void auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IEnroll {&lt;br /&gt;
	public void registerClass()&lt;br /&gt;
	{&lt;br /&gt;
		//allow a student to register for a particular class&lt;br /&gt;
	}&lt;br /&gt;
	public void auditClass()&lt;br /&gt;
	{&lt;br /&gt;
		//allow a student to audit an enrolled class&lt;br /&gt;
	}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&lt;br /&gt;
 class PartStudent extends Student implements IEnroll {&lt;br /&gt;
	public void registerClass()&lt;br /&gt;
	{&lt;br /&gt;
		//allow a student to register for a particular class&lt;br /&gt;
	}&lt;br /&gt;
	public void auditClass()&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing since we didn't want this method in the first place!&lt;br /&gt;
	}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
 interface IRegisterClass {&lt;br /&gt;
  public void registerClass();&lt;br /&gt;
 }&lt;br /&gt;
  interface IAuditClass {&lt;br /&gt;
  public auditClass();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&lt;br /&gt;
 class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
 {	&lt;br /&gt;
 public void registerClass()&lt;br /&gt;
 {&lt;br /&gt;
  //allow a student to register for a particular class&lt;br /&gt;
 }&lt;br /&gt;
 public void auditClass()&lt;br /&gt;
 {&lt;br /&gt;
 //allow a student to audit an enrolled class&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
 {&lt;br /&gt;
 public void registerClass()&lt;br /&gt;
 {&lt;br /&gt;
 //allow a student to register for a particular class&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40837</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40837"/>
		<updated>2010-11-16T18:28:25Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
#Segregation through Delegation&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
#Segregation through multiple inheritance&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
Consider an example of Course registration system which allows students to enroll in courses, similar to the one we have at NCSU.&lt;br /&gt;
Let us assume we have a student base class which other specialized student classes inherit from.&lt;br /&gt;
&lt;br /&gt;
A full time student at NCSU is allowed to register for a class. He can also choose to audit a particular class.&lt;br /&gt;
&lt;br /&gt;
Lets say we have an interface called IEnroll. &lt;br /&gt;
The IEnroll interface exposes two methods viz. registerClass() which should allow a student to register himself for a class, and auditClass() which allows a student to audit a class he has registered for.&lt;br /&gt;
The FullStudent class is used to represent full time students. It extends the Student class and implements this IEnroll interface.&lt;br /&gt;
&lt;br /&gt;
interface IEnroll {&lt;br /&gt;
	public void registerClass();&lt;br /&gt;
	public void auditClass();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class FullStudent extends Student implements IEnroll {&lt;br /&gt;
	public void registerClass()&lt;br /&gt;
	{&lt;br /&gt;
		//allow a student to register for a particular class&lt;br /&gt;
	}&lt;br /&gt;
	public void auditClass()&lt;br /&gt;
	{&lt;br /&gt;
		//allow a student to audit an enrolled class&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Now lets suppose, NCSU decided not to allow part time students to audit a class once they have registered.&lt;br /&gt;
The PartStudent class represents the part time students. It extends the Student class.&lt;br /&gt;
Now PartStudent class can either implement IEnroll to provide the registration facility. But in that case, PartStudent is forced to implement the auditClass method.&lt;br /&gt;
&lt;br /&gt;
class PartStudent extends Student implements IEnroll {&lt;br /&gt;
	public void registerClass()&lt;br /&gt;
	{&lt;br /&gt;
		//allow a student to register for a particular class&lt;br /&gt;
	}&lt;br /&gt;
	public void auditClass()&lt;br /&gt;
	{&lt;br /&gt;
		//do nothing since we didn't want this method in the first place!&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
The other option is to define a new interface with just registClass method and use it in PartStudent class. But this defeats the purpose of having a common interface.&lt;br /&gt;
&lt;br /&gt;
This is a good example of how our interface has become 'Fat' or 'Polluted'. It is exposing 2 different methods which its clients are forced to honor. This violates the ISP.&lt;br /&gt;
&lt;br /&gt;
Lets see how we can correct this.&lt;br /&gt;
&lt;br /&gt;
We separate out the 2 functions into different interfaces now,&lt;br /&gt;
&lt;br /&gt;
interface IRegisterClass {&lt;br /&gt;
	public void registerClass();&lt;br /&gt;
}&lt;br /&gt;
interface IAuditClass {&lt;br /&gt;
	public auditClass();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
This allows the FullStudent and PartStudent to be defined as following:&lt;br /&gt;
&lt;br /&gt;
class FullStudent extends Student implements IRegisterClass, IAuditClass&lt;br /&gt;
{	&lt;br /&gt;
	public void registerClass()&lt;br /&gt;
	{&lt;br /&gt;
		//allow a student to register for a particular class&lt;br /&gt;
	}&lt;br /&gt;
	public void auditClass()&lt;br /&gt;
	{&lt;br /&gt;
		//allow a student to audit an enrolled class&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class PartStudent extends Student implements IRegisterClass&lt;br /&gt;
{&lt;br /&gt;
	public void registerClass()&lt;br /&gt;
	{&lt;br /&gt;
		//allow a student to register for a particular class&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
This gives a clean and correct way in which the PartStudent class is not forced to depend on an interface it does not want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Figure_4Class_diagram_for_PartStudent_(conforms_to_ISP).png&amp;diff=40836</id>
		<title>File:Figure 4Class diagram for PartStudent (conforms to ISP).png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Figure_4Class_diagram_for_PartStudent_(conforms_to_ISP).png&amp;diff=40836"/>
		<updated>2010-11-16T18:24:48Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: Figure 4 Class diagram for PartStudent (conforms to ISP)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Figure 4 Class diagram for PartStudent (conforms to ISP)&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Figure_3Class_diagram_for_FullStudent_(conforms_to_ISP).png&amp;diff=40835</id>
		<title>File:Figure 3Class diagram for FullStudent (conforms to ISP).png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Figure_3Class_diagram_for_FullStudent_(conforms_to_ISP).png&amp;diff=40835"/>
		<updated>2010-11-16T18:24:24Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: Figure 3 Class diagram for FullStudent (conforms to ISP)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Figure 3 Class diagram for FullStudent (conforms to ISP)&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Figure_2Class_diagram_for_PartStudent_(violates_ISP).png&amp;diff=40834</id>
		<title>File:Figure 2Class diagram for PartStudent (violates ISP).png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Figure_2Class_diagram_for_PartStudent_(violates_ISP).png&amp;diff=40834"/>
		<updated>2010-11-16T18:23:55Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: Figure 2 Class diagram for PartStudent (violates ISP)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Figure 2 Class diagram for PartStudent (violates ISP)&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Figure_1Class_diagram_for_FullStudent_(violates_ISP).png&amp;diff=40833</id>
		<title>File:Figure 1Class diagram for FullStudent (violates ISP).png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Figure_1Class_diagram_for_FullStudent_(violates_ISP).png&amp;diff=40833"/>
		<updated>2010-11-16T18:23:24Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: Figure 1Class diagram for FullStudent (violates ISP)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Figure 1Class diagram for FullStudent (violates ISP)&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40831</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40831"/>
		<updated>2010-11-16T18:17:46Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
#Segregation through Delegation&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
#Segregation through multiple inheritance&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40830</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40830"/>
		<updated>2010-11-16T18:16:37Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
#[http://www.oodesign.com/design-principles.html Design principles]&lt;br /&gt;
#[http://java.sys-con.com/node/84633/print Three Sources of a Solid Object-Oriented Design]&lt;br /&gt;
#[http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Principles of OOD]&lt;br /&gt;
#[http://www.hanselminutes.com/default.aspx?showID=163 Hanselminutes episode on SOLID]&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40825</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40825"/>
		<updated>2010-11-16T18:02:11Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40824</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40824"/>
		<updated>2010-11-16T18:01:44Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com/resources/articles/isp.pdf The Interface Segregation Principle]&amp;lt;li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.objectmentor.com Design Principles and Design Patterns, Robert C Martin]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://ontwik.com/ruby/sandi-metz-solid-object-oriented-design/ 2009 Gotham Ruby Conference, presentation on SOLID Object Oriented Design by Sandi Metz, Duke University.]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40819</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40819"/>
		<updated>2010-11-16T17:56:30Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; &amp;lt;a href=&amp;quot;http://www.objectmentor.com/resources/articles/isp.pdf&amp;quot;&amp;gt;The Interface Segregation Principle&amp;lt;/a&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40817</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40817"/>
		<updated>2010-11-16T17:55:48Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;br /&gt;
&lt;br /&gt;
==External References==&lt;br /&gt;
*&amp;lt;a href=&amp;quot;http://www.objectmentor.com/resources/articles/isp.pdf&amp;quot;&amp;gt;The Interface Segregation Principle&amp;lt;/a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40816</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40816"/>
		<updated>2010-11-16T17:53:25Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
==Implications of the emphasis==&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
===Segregation through Delegation===&lt;br /&gt;
The object form of the ADAPTER Pattern can be used to delegate the responsibility of implementing the thin interface to the class that is the client of the interface.&lt;br /&gt;
===Segregation through multiple inheritance===&lt;br /&gt;
The methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40814</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40814"/>
		<updated>2010-11-16T17:45:57Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Implications of the emphasis:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
==Results of following ISP==&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
==How ISP can be implemented in the design==&lt;br /&gt;
Segregation through multiple inheritance: the methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40813</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40813"/>
		<updated>2010-11-16T17:44:27Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle] object-oriented software development. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the [http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]SOLID object oriented principles. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Implications of the emphasis:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The interfaces that are designed should not be fat, i.e the interface should not have too many methods which often do not get used together. &lt;br /&gt;
The idea here is to avoid loading all the methods into a single interface, instead segregate the methods in the interface such that all the methods that contribute towards offering a single type of service (or single type of clients) are grouped under one single interface.  Thereby dealing with a bulky interface that might be difficult to manage is avoided.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
The interface should be specific. The methods in the interface should be the ones that contribute towards offering only a specific type of service. For example, if there is an interface that offers methods that provide mathematical services to its clients, then the same interface should not contain methods that accomplish totally different types of tasks say, like a database functionality implementation.&lt;br /&gt;
The main reason behind such interfaces being discouraged is that if a class decides to (or has to) implement that interface, then, it has to provide an implementation even for those methods that it doesn’t intend to use. Even though such implementations may be empty methods, it is not convenient and also distorts the readability of the code.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Results of following ISP&lt;br /&gt;
Designing software by adopting ISP will yield many simple interfaces that are more specific in nature which in turn will make the classes more cohesive.&lt;br /&gt;
How ISP can be implemented in the design&lt;br /&gt;
Segregation through multiple inheritance: the methods that are to be included into the interfaces are grouped into interfaces such that all the methods in the interface are directed towards accomplishing a certain type of service. When a class has to use the methods in the interface, it has to implement the interface. When the class is required to implement methods from many interfaces, the class will have to inherit multiple light interfaces and also implement the methods in the interfaces.&lt;br /&gt;
&lt;br /&gt;
Conclusion&lt;br /&gt;
Fat Interfaces are the interfaces that are not specific to a single client. Fat interfaces lead to unintended couplings between clients that ought otherwise to be isolated. By making use of the ADAPTER pattern, through multiple inheritance (class form), fat interfaces can be segregated into abstract base classes that resolve the unwanted coupling between clients. Thus maintaining loose coupling and high cohesion, which is an essential attribute of good software design.&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40812</id>
		<title>CSC/ECE 517 Fall 2010/ch6 6f ag</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch6_6f_ag&amp;diff=40812"/>
		<updated>2010-11-16T17:39:30Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b style=&amp;quot;font-size:20pt&amp;quot;&amp;gt;Interface Segregation Principle&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Design phase is a very important phase in the entire process of object-oriented software development [http://en.wikipedia.org/wiki/Systems_Development_Life_Cycle]. The need for a good design of software is to accommodate change into the software, a definite attribute of any software. For the benefit of the developers of these software, certain principles are laid out which ensure that the outcome of development phase is an easily manageable software rather than a rigid and fragile software. The principles of object-oriented software development are listed differently in different sources. The most commonly accepted and recognized is the SOLID object oriented principles[http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29]. In this article we focus on Interface segregation principle (ISP).&lt;br /&gt;
&lt;br /&gt;
==Interface Segregation Principle==&lt;br /&gt;
Interface Segregation Principle emphasizes on&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;i&amp;gt;MANY CLIENT SPECIFIC INTERFACES ARE BETTER THAN ONE GENERAL PURPOSE INTERFACE&amp;lt;/i&amp;gt;&amp;lt;/li&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37303</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37303"/>
		<updated>2010-10-06T23:11:56Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, objects [http://en.wikipedia.org/wiki/Object_%28computer_science%29]to relational database [http://en.wikipedia.org/wiki/Relational_database_management_system] tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in Object Oriented Programming Systems [http://en.wikipedia.org/wiki/Object-oriented_programming]. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems e.g orders, customers,  must be accessible even if the system was temporarily shut down for a while. ORM [http://en.wikipedia.org/wiki/Object-relational_mapping] helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations (mainly CRUD[http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]) without having to write any SQL [http://en.wikipedia.org/wiki/SQL] statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
[[Image:Example1.png]]&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of “convention over configuration”[http://en.wikipedia.org/wiki/Convention_over_configuration]. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for two specific Object Oriented languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new Assignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
==Language support for ORM.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility of the object rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
#Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
#Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
#three List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
#Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
#Grails home page. http://grails.org/&lt;br /&gt;
#ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
#Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37301</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37301"/>
		<updated>2010-10-06T23:11:14Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, objects [http://en.wikipedia.org/wiki/Object_%28computer_science%29]to relational database [http://en.wikipedia.org/wiki/Relational_database_management_system] tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in Object Oriented Programming Systems [http://en.wikipedia.org/wiki/Object-oriented_programming]. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems e.g orders, customers,  must be accessible even if the system was temporarily shut down for a while. ORM [http://en.wikipedia.org/wiki/Object-relational_mapping] helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations (mainly CRUD[http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]) without having to write any SQL [http://en.wikipedia.org/wiki/SQL] statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
[[Image:Example1.png]]&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of “convention over configuration”[http://en.wikipedia.org/wiki/Convention_over_configuration]. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for two specific Object Oriented languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new Assignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
==Language support for ORM.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility of the object rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
#one Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
#two Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
#three List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Example1.png&amp;diff=37295</id>
		<title>File:Example1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Example1.png&amp;diff=37295"/>
		<updated>2010-10-06T23:07:46Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37293</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37293"/>
		<updated>2010-10-06T23:06:46Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, objects [http://en.wikipedia.org/wiki/Object_%28computer_science%29]to relational database [http://en.wikipedia.org/wiki/Relational_database_management_system] tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in Object Oriented Programming Systems [http://en.wikipedia.org/wiki/Object-oriented_programming]. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems e.g orders, customers,  must be accessible even if the system was temporarily shut down for a while. ORM [http://en.wikipedia.org/wiki/Object-relational_mapping] helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations (mainly CRUD[http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]) without having to write any SQL [http://en.wikipedia.org/wiki/SQL] statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
[[Image:Example1.png]]&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of “convention over configuration”[http://en.wikipedia.org/wiki/Convention_over_configuration]. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for two specific Object Oriented languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new Assignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
==Language support for ORM.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility of the object rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37292</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37292"/>
		<updated>2010-10-06T23:06:04Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, objects [http://en.wikipedia.org/wiki/Object_%28computer_science%29]to relational database [http://en.wikipedia.org/wiki/Relational_database_management_system] tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in Object Oriented Programming Systems [http://en.wikipedia.org/wiki/Object-oriented_programming]. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems e.g orders, customers,  must be accessible even if the system was temporarily shut down for a while. ORM [http://en.wikipedia.org/wiki/Object-relational_mapping] helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations (mainly CRUD[http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]) without having to write any SQL [http://en.wikipedia.org/wiki/SQL] statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
[[Image:Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of “convention over configuration”[http://en.wikipedia.org/wiki/Convention_over_configuration]. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for two specific Object Oriented languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new Assignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
==Language support for ORM.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility of the object rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37291</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=37291"/>
		<updated>2010-10-06T23:05:36Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, objects [http://en.wikipedia.org/wiki/Object_%28computer_science%29]to relational database [http://en.wikipedia.org/wiki/Relational_database_management_system] tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in Object Oriented Programming Systems [http://en.wikipedia.org/wiki/Object-oriented_programming]. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems e.g orders, customers,  must be accessible even if the system was temporarily shut down for a while. ORM [http://en.wikipedia.org/wiki/Object-relational_mapping] helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations (mainly CRUD[http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]) without having to write any SQL [http://en.wikipedia.org/wiki/SQL] statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of “convention over configuration”[http://en.wikipedia.org/wiki/Convention_over_configuration]. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for two specific Object Oriented languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new Assignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
==Language support for ORM.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility of the object rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36355</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36355"/>
		<updated>2010-09-30T03:42:09Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems e.g orders, customers,  must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for two specific Object Oriented languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new Assignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
==Language support for ORM.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility of the object rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36354</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36354"/>
		<updated>2010-09-30T03:30:03Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems e.g orders, customers,  must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for two specific Object Oriented languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new Assignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as findBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
[[Image:Image.png]]&lt;br /&gt;
&lt;br /&gt;
==Language support for ORM.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility of the object rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36353</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36353"/>
		<updated>2010-09-30T03:22:04Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems e.g orders, customers,  must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for the four OO languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new A&lt;br /&gt;
ssignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
[[Image:Image.png]]&lt;br /&gt;
&lt;br /&gt;
==Incorporating ORM into the language.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36352</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36352"/>
		<updated>2010-09-30T03:20:16Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: /* Introduction to Object Relational Mapping. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems e.g orders, customers,  must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for the four OO languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new A&lt;br /&gt;
ssignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
[[Image:Image.png]]&lt;br /&gt;
&lt;br /&gt;
==Incorporating ORM into the language.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
----&lt;br /&gt;
==External links==&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36329</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36329"/>
		<updated>2010-09-28T16:27:57Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems (orders, customers . . .) must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for the four OO languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new A&lt;br /&gt;
ssignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
[[Image:Image.png]]&lt;br /&gt;
&lt;br /&gt;
==Incorporating ORM into the language.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
----&lt;br /&gt;
==External links==&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36328</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36328"/>
		<updated>2010-09-28T16:26:31Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems (orders, customers . . .) must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for the four OO languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new A&lt;br /&gt;
ssignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
[[Image:Image.png]]&lt;br /&gt;
&lt;br /&gt;
==Incorporating ORM into the language.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
----&lt;br /&gt;
==External links==&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36327</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36327"/>
		<updated>2010-09-28T16:25:45Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems (orders, customers . . .) must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for the four OO languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new A&lt;br /&gt;
ssignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
[[Image:Image.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:https://docs.google.com/leaf?id=0B1TgH20TU3BGMjA2MmY4NzUtMGExYS00N2YyLTg1NjYtZGI4Y2FhOTQ4NGZk&amp;amp;hl=en&amp;amp;authkey=CJ263YQF]]&lt;br /&gt;
==Incorporating ORM into the language.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==References and Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
----&lt;br /&gt;
==External links==&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Image.png&amp;diff=36326</id>
		<title>File:Image.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Image.png&amp;diff=36326"/>
		<updated>2010-09-28T16:24:27Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36325</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36325"/>
		<updated>2010-09-28T16:20:48Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems (orders, customers . . .) must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for the four OO languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new A&lt;br /&gt;
ssignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
[[Image:https://docs.google.com/leaf?id=0B1TgH20TU3BGMjA2MmY4NzUtMGExYS00N2YyLTg1NjYtZGI4Y2FhOTQ4NGZk&amp;amp;hl=en&amp;amp;authkey=CJ263YQF]]&lt;br /&gt;
==Incorporating ORM into the language.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
----&lt;br /&gt;
==External links==&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36324</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36324"/>
		<updated>2010-09-28T16:17:50Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems (orders, customers . . .) must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for the four OO languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new A&lt;br /&gt;
ssignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
&lt;br /&gt;
[[Image:https://docs.google.com/a/ncsu.edu/leaf?id=0B1TgH20TU3BGMjA2MmY4NzUtMGExYS00N2YyLTg1NjYtZGI4Y2FhOTQ4NGZk&amp;amp;hl=en]]&lt;br /&gt;
==Incorporating ORM into the language.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
----&lt;br /&gt;
==External links==&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36323</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=36323"/>
		<updated>2010-09-28T16:14:23Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems (orders, customers . . .) must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for the four OO languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new A&lt;br /&gt;
ssignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
[[Image:https://docs.google.com/a/ncsu.edu/leaf?id=0B1TgH20TU3BGMjA2MmY4NzUtMGExYS00N2YyLTg1NjYtZGI4Y2FhOTQ4NGZk&amp;amp;hl=en]]&lt;br /&gt;
==Incorporating ORM into the language.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
----&lt;br /&gt;
==External links==&lt;br /&gt;
[1]Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
[2]Grails home page. http://grails.org/&lt;br /&gt;
[3]ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
[4]Active Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=35795</id>
		<title>CSC/ECE 517 Fall 2010/ch2 2a aa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2010/ch2_2a_aa&amp;diff=35795"/>
		<updated>2010-09-21T01:42:33Z</updated>

		<summary type="html">&lt;p&gt;Aamarna2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Language extensions for ORM]&lt;br /&gt;
&lt;br /&gt;
== Introduction to Object Relational Mapping. ==&lt;br /&gt;
Object Relational Mapping is a technique of mapping the solution entities of an object oriented system, [http://en.wikipedia.org/wiki/Object_%28computer_science%29]objects to [http://en.wikipedia.org/wiki/Relational_database_management_system] relational database tables. This technique came into existence as an answer to the problem of lack of persistence of objects across session in [http://en.wikipedia.org/wiki/Object-oriented_programming]Object Oriented Programming Systems. For instance in a software solution to manage the order and inventory systems of a company, the objects that are part of the systems (orders, customers . . .) must be accessible even if the system was temporarily shut down for a while. [http://en.wikipedia.org/wiki/Object-relational_mapping]ORM helps in achieving this very essential requirement by bringing the database into the picture, more specifically bringing the RDBMS into the picture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why ORM, why not another solution? ==&lt;br /&gt;
The answer to this is quite an obvious one. ORM brings to the table something(s) that another solution hasn’t done so far. These “something(s)” that ORM contributes are listed below:&lt;br /&gt;
#Alleviates the problem that hinders a transition from one database provider to another database vendor or even another database product.&lt;br /&gt;
#Enables to perform most of the database operations ([http://en.wikipedia.org/wiki/Create,_read,_update_and_delete]mainly CRUD) without having to write any [http://en.wikipedia.org/wiki/SQL]SQL statements, thereby permitting a shift from one SQL dialect to another. This also allows the software solutions to focus more on the actual problem being solved rather that performing supplementary functions extensively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Flavors of ORM solutions.==&lt;br /&gt;
The term ORM is a very generic name for the class of solutions. Typically, ORM support in object oriented languages comes in two flavors; one that comes in separate packages which can be imported into our application, the other is the variety that comes incorporated into a language. &lt;br /&gt;
When there is an option of choosing among the two flavors, the solution that come incorporated into the language is preferred. This choice may be quite an obvious one depending on the language that is being considered.&lt;br /&gt;
Though the difference between the two might not be that apparent in the outset, the reason for this predilection towards the language incorporate solution over the other has mainly to do with design paradigm of the modern day software development of [http://en.wikipedia.org/wiki/Convention_over_configuration]“convention over configuration”. This paradigm emphasizes on the development by convention rather than development by configuration. The fact that the solution involving external packages and libraries involve a lot of configuration files which play the instructing role. In the language incorporated solution, such a problem doesn’t arise as the involvement of configuration files in the entire system itself is scanty. In the following sections we will take a look at two of the preferred language incorporated solutions.&lt;br /&gt;
&lt;br /&gt;
==ORM implementation in specific languages.==&lt;br /&gt;
In this section, we will look at the language specific ORM examples illustrating the relation between creation of classes and tables, objects and rows, attributes and columns; and also examples for performing basic CRUD operations for the four OO languages.&lt;br /&gt;
===Groovy, Grails and GROM:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Classes, when created using the create-domain-class, also create the table of the same name as the class (not the plural).&lt;br /&gt;
For example, &lt;br /&gt;
 grails create-domain-class Assignment&lt;br /&gt;
running the above command would create an empty class named Assignment and also create a table named Assignment in the database. Attributes to this class may be added in a fashion similar to the one followed in java. The attributes that are created in-turn gets automatically mapped to the columns in the table “Assignment”.&lt;br /&gt;
&lt;br /&gt;
We may want to define the Assignment class as follows&lt;br /&gt;
 class Assignment {&lt;br /&gt;
    String title&lt;br /&gt;
    Date dueDate&lt;br /&gt;
    String weightage_on_final_grade&lt;br /&gt;
 }&lt;br /&gt;
Having objects defined within a class would facilitate in achieving association between classes.&lt;br /&gt;
&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This is done as illustrated below:&lt;br /&gt;
 def a = new Assignment (title:&amp;quot;WikiTextChapter&amp;quot;, dueDate:date, weightage_on_final_grade:3)&lt;br /&gt;
 a.save()&lt;br /&gt;
&lt;br /&gt;
The above statements would create a new A&lt;br /&gt;
ssignment object and also create a row in the Assignment table. The save method above may be considered analogous to a commit statement that may be used in SQL.&lt;br /&gt;
:Reading objects from the database. This can be done as in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
In the above statement, the parameter 1 passed to the get method is an identifier for the object. When an object is created in the database, an id is created transparently by the language specifics.&lt;br /&gt;
Apart from the get method, other ways of fetching objects from database would involve use of methods such as list(), finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. This is achieved by updating the necessary attribute of an object and saving or committing the changes back to the database. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a. weightage_on_final_grade =5&lt;br /&gt;
 a.save()&lt;br /&gt;
:Deleting objects. To perform a delete, we must first get an object and then call the delete method on that object. This is illustrated in the below example.&lt;br /&gt;
 def a = Assignment.get(1)&lt;br /&gt;
 a.delete()&lt;br /&gt;
&lt;br /&gt;
===PHP ActiveRecord:===&lt;br /&gt;
====Creating classes and tables:====&lt;br /&gt;
Tables corresponding to classes can be created by&lt;br /&gt;
 classes extending the ActiveRecord\Model class.&lt;br /&gt;
 class Assignment extends ActiveRecord\Model&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
====Basic CRUD:====&lt;br /&gt;
:Creating objects also creates rows. This can be done by as shown below.&lt;br /&gt;
 $a = new Assignment();&lt;br /&gt;
 $a-&amp;gt; title=’ WikiTextChapter’; &lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Reading objects from database. Objects can be read from the database as illustrated in the below example.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
::Apart from the get method, other ways of fetching objects from database would involve use of methods such as finfBy&amp;lt;attributeName&amp;gt;() few among the many other methods that is on offer.&lt;br /&gt;
:Updating objects. For this to be done, we need to find a record first and then change one of its attributes and finally commit the changes. This is illustrated below:&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;title = 'NewWikiTextChapter’';&lt;br /&gt;
 $a-&amp;gt;save();&lt;br /&gt;
:Deleting objects. For this to be done, we need to find a record first and then call the delete method on the object.&lt;br /&gt;
 $a = Assignment::find(1);&lt;br /&gt;
 $a-&amp;gt;delete();&lt;br /&gt;
:This is similar to ActiveRecord in Ruby, so we will not explicitly deal with ORM in Ruby.&lt;br /&gt;
[[Image:https://docs.google.com/a/ncsu.edu/leaf?id=0B1TgH20TU3BGMjA2MmY4NzUtMGExYS00N2YyLTg1NjYtZGI4Y2FhOTQ4NGZk&amp;amp;hl=en]]&lt;br /&gt;
==Incorporating ORM into the language.==&lt;br /&gt;
To incorporate ORM into a language, the usual approach, is to implement the ActiveRecord Design Pattern [http://en.wikipedia.org/wiki/Active_record_pattern]. This approach considers persistence as a responsibility rather than as a service. Following this approach, would hence expect the objects themselves implement methods to support database operations and like in the object oriented world the objects are expected to be able to manage themselves. Following the object oriented paradigm and adopting a modular approach the responsibility of implementing the methods facilitating the database operations are implemented by a class which is inherited by all other classes whose objects have to persist across sessions. The methods to support database operations include methods to create tables, create rows in the table when objects of a class are created; methods to read objects from the table; methods that facilitate updating the objects and finally methods to delete the objects. Apart from this basic CRUD functionality any extra functionality would always be welcome.&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
*Very informative and a nice place to start. http://www.slideshare.net/hominhchuc/grails-docs-presentation&lt;br /&gt;
*Insight into impedance mismatch. http://www.agiledata.org/essays/impedanceMismatch.html&lt;br /&gt;
*List of object-relational mapping software http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software&lt;br /&gt;
----&lt;br /&gt;
==External links==&lt;br /&gt;
*Active Record Design Pattern - Domain Driven Design and Domain Layer - Object Persistence. http://davidhayden.com/blog/dave/archive/2006/06/10/2984.aspx&lt;br /&gt;
*Grails home page. http://grails.org/&lt;br /&gt;
*ORM in php: php.active record  http://www.phpactiverecord.org/&lt;br /&gt;
*Actve Record Design Pattern http://en.wikipedia.org/wiki/Active_record_pattern&lt;/div&gt;</summary>
		<author><name>Aamarna2</name></author>
	</entry>
</feed>