CSC/ECE 517 Fall 2007/wiki3 4 rl: Difference between revisions
Line 42: | Line 42: | ||
[[Image:Pencil.jpg]]The example in this article shows what goes wrong if you have file data access objects and database data access objects attempting to use the same interface. Because the behaviors of these two objects are so different, they should not share an interface. | [[Image:Pencil.jpg]]The example in this article shows what goes wrong if you have file data access objects and database data access objects attempting to use the same interface. Because the behaviors of these two objects are so different, they should not share an interface. | ||
[[Image:Star.jpg]]This is the best resource for presenting the Interface Segregation Principle to a class. The description is clear and well-written and provides the right level of detail for covering the topic in an Object-Oriented Design course. The example is also the best that I have seen. It is very clear and easy to follow. | |||
=References= | =References= |
Revision as of 22:01, 13 November 2007
Assignment
Take the Interface Segregation principle and catalog the information on it available on the Web. We didn't cover it in class, but you can look it up on the Web or in the ACM DL. Find good descriptions and good, concise, understandable examples. Tell which you consider the best to present to a class.
Introduction
TODO: Write up intro, mention that there's not a lot of resources (nothing in ACM or IEEE) on this and lots of overlap between my description sites and example sites so doesn't make sense to break them out ... maybe put this in note to reviewer, be sure to pick a "best to present to class" from examples.
Interface Segregation Principle Resources on the Web
Following is a catalog of the best Interface Segregegation Principle resources on the Web. Those containing useful examples are marked with a and include a description of the example. (reword)
http://www.objectmentor.com/resources/articles/isp.pdf
This article, "The Interface Segregation Principle," is the seminal work on ISP. The author, Robert Martin, presents the disadvantages of what he calls "fat" or "polluted" interfaces. Such interfaces contain methods that apply to only a subset of the clients that use the interface. This results in an undesirable coupling between those clients that do require particular methods in the interface and those that do not. Martin summarizes the ISP as "Clients should not be forced to depend upon interfaces that they do not use." MAYBE USE ALL THIS IN THE INTRO AND PUT SOMETHING ELSE HERE
Martin provides a detailed example involving the user interface of an ATM machine. He shows a design that violates the ISP, and then tells the reader how to fix it. This example, written in C++, is worth reading but is also very involved and somewhat difficult to follow.
http://doodleproject.sourceforge.net/articles/2001/interfaceSegregationPrinciple.html
SOME TEXT HERE
http://www.everything2.com/index.pl?node_id=1259576
This page presents ISP in the context of the "Few Interfaces" and "Small Interfaces" rules of OO design. It discusses the benefits of these two rules, and shows how they relate to ISP.
http://www.oodesign.com/oo_principles/oo_principles/interface_sergregation_principle.html
Though not particularly well written, this page is unique in that it presents the ISP in the format of a design pattern. It is organized into Motivation, Intent, Example, and Conclusion.
If you can get past the egregious spelling, grammatical, and coding errors, you'll find the example on this page simple and straightforward. The author uses the concept of a Worker who both performs work and eats lunch, then shows how a Robot worker doesn't eat and shouldn't have to implement the eat method.
http://www.ddj.com/blog/architectblog/archives/2006/06/interface_segre.html
Blogger Arnon Rotem-Gal-Oz refers to ISP as a "poor man's Single Responsibility Principle," and considers it a special case of Separation of Concerns. He also points his readers to another source that discusses how to determine what client-specific interfaces to create for any given application.
http://www.nada.kth.se/~karlm/prutt05/lectures/prutt05_lec11.ppt#31
These lecture notes contain a clear and concise description of ISP, and also present the problem and two solutions as a general formula.
http://javaboutique.internet.com/tutorials/JavaOO/interface_segregation.html
This article states the ISP as "Many specific interfaces are better than a single general interface." It talks about ISP in the context of the Java programming language and provides some background information on interfaces and inheritance.
The example in this article shows what goes wrong if you have file data access objects and database data access objects attempting to use the same interface. Because the behaviors of these two objects are so different, they should not share an interface.
This is the best resource for presenting the Interface Segregation Principle to a class. The description is clear and well-written and provides the right level of detail for covering the topic in an Object-Oriented Design course. The example is also the best that I have seen. It is very clear and easy to follow.
References
- The Interface Segregation Principle
- DoodleProject - Interface Segregation Principle
- Everything2 - Interface Segregation Principle
- OOD Principles - Interface Segregation Principle
- If You Build It... Will They Come? Interface Segregation Principle
- Lecture Notes - ISP Interface Segregation Principle
- Java Boutique - Fine-tuning Abstraction: Interface Segregation Principle