<?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=Sgade</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=Sgade"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sgade"/>
	<updated>2026-05-09T10:00:56Z</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_2011/ch4_4i_js&amp;diff=53740</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53740"/>
		<updated>2011-10-21T01:48:39Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This Wiki article surveys the various tools that were built to enable CRC card design on a computer. The tools cover both the tools that were developed for commercial purposes as  well as the ones that were designed for educational purposes to teach Object Oriented Design.&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations [http://en.wikipedia.org/wiki/Class-responsibility-collaboration_card (CRC)] is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies. &amp;lt;ref&amp;gt; [http://books.google.com/books/about/Using_CRC_Cards.html?id=baopCOstm_kC Using CRC Cards: An Informal Approach to Object-Oriented Development] &lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
1.	Discover Classes&lt;br /&gt;
2.	Determine Responsibilities of each class&lt;br /&gt;
3.	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|} &amp;lt;ref&amp;gt;[http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2007/wiki2_5_as CRC Card Layout] &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to add items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC &amp;lt;ref&amp;gt; [http://www.excelsoftware.com/quickcrcintro.html QuickCRC]&amp;lt;/ref&amp;gt; is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE&amp;lt;ref&amp;gt; &lt;br /&gt;
[http://www.cc.gatech.edu/ectropic/papers ECoDE] K. A. Gray, M. Guzdial, and S. Rugaber. Extending&lt;br /&gt;
CRC cards into a complete design process. Technical&lt;br /&gt;
report, College of Computing, Georgia Institute of&lt;br /&gt;
Technology, Atlanta, GA, 2002. &amp;lt;/ref&amp;gt;, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
[[File:designass-3.jpg|center|x400px|ECoDE]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant&amp;lt;ref&amp;gt;[http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.118.2233 CRC Design Assistant] A Tool to Support the CRC Design Method &amp;lt;/ref&amp;gt; is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
[[File:crcda.jpg|center|x300px|CRC Design Assistant]]&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML&amp;lt;ref&amp;gt; [http://www.visual-paradigm.com/product/vpuml/ Visual Paradigm] &amp;lt;/ref&amp;gt; is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC&amp;lt;ref&amp;gt;[http://www.easycrc.com EasyCRC] A. Raman, S. Tyszberowicz.  The EasyCRC Tool, &lt;br /&gt;
2nd international conference on Software Engineering &lt;br /&gt;
Advances (ICSEA), France, 2007&lt;br /&gt;
&amp;lt;/ref&amp;gt; combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:easyCRC2.png|x300px]]&lt;br /&gt;
|[[File:easyCRC1.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus&amp;lt;ref&amp;gt; [http://www.csd.uoc.gr/~papadako/files/MSc.pdf 3DCRC] VERY RAPID SOFTWARE-DESIGN PROTOTYPING WITH&lt;br /&gt;
INTERACTIVE 3D CRC CARDS &amp;lt;/ref&amp;gt; is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it. &amp;lt;ref&amp;gt; [http://merobase.com/ merobase] &amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler &amp;lt;ref&amp;gt; [http://www.freedownloadmanager.org/downloads/crc_card_software/ Software Ideas Modeler] &amp;lt;/ref&amp;gt; is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SM1.png|400x500px]]&lt;br /&gt;
|[[File:SM2.png|400x500px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
These are the tools currently available for CRC card design on a computer. Selection of any particular tool can be done by choosing the one which best satisfies our need. The only problem however with using tools for CRC card design is that it is not always best for more than two people to work on the same computer.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
# [http://en.wikipedia.org/wiki/Unified_Modeling_Language Unified Modeling Language]&lt;br /&gt;
# [http://en.wikipedia.org/wiki/Meta-modeling MetaModeling]&lt;br /&gt;
# [http://coweb.cc.gatech.edu/cs2340/6046 CRC and Scenario]&lt;br /&gt;
# [http://c2.com/doc/oopsla89/paper.html Object Oriented Thinking]&lt;br /&gt;
# [http://en.wikipedia.org/wiki/Requirements_analysis Requirement Analysis]&lt;br /&gt;
# [https://docs.google.com/viewer?a=v&amp;amp;q=cache:BAN8mwIK1coJ:citeseerx.ist.psu.edu/viewdoc/download%3Fdoi%3D10.1.1.114.7489%26rep%3Drep1%26type%3Dpdf+Software+Design+Using+CRC+Cards&amp;amp;hl=en&amp;amp;gl=us&amp;amp;pid=bl&amp;amp;srcid=ADGEESg5iujWm67Uhw4oJe2ir8J9b1T_tx491dhrl9igQigUOZLMLx5wYbMg5VtJvWu1mmK-9L2WyOuoWhSh_g3Tt63c50I7CdLTxLFFZXVZV7Ry1GZf722lTaBYDC5Ws7Msoj6RA6oG&amp;amp;sig=AHIEtbQLXT9TW9xUdpgapy_8KlO4tZ9Mww Software Design Using CRC Cards]&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53624</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53624"/>
		<updated>2011-10-21T01:11:42Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Creating CRC Cards */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This Wiki article surveys the various tools that were built to enable CRC card design on a computer. The tools cover both the tools that were developed for commercial purposes as  well as the ones that were designed for educational purposes to teach Object Oriented Design.&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations [http://en.wikipedia.org/wiki/Class-responsibility-collaboration_card (CRC)] is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies. &amp;lt;ref&amp;gt; [http://books.google.com/books/about/Using_CRC_Cards.html?id=baopCOstm_kC Using CRC Cards: An Informal Approach to Object-Oriented Development] &lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
1.	Discover Classes&lt;br /&gt;
2.	Determine Responsibilities of each class&lt;br /&gt;
3.	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|} &amp;lt;ref&amp;gt;[http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2007/wiki2_5_as CRC Card Layout] &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to add items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC &amp;lt;ref&amp;gt; [http://www.excelsoftware.com/quickcrcintro.html QuickCRC]&amp;lt;/ref&amp;gt; is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE&amp;lt;ref&amp;gt; [&lt;br /&gt;
http://www.cc.gatech.edu/ectropic/papers/ K. A. Gray, M. Guzdial, and S. Rugaber. Extending&lt;br /&gt;
CRC cards into a complete design process. Technical&lt;br /&gt;
report, College of Computing, Georgia Institute of&lt;br /&gt;
Technology, Atlanta, GA, 2002.] &amp;lt;/ref&amp;gt;, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
[[File:designass-3.jpg|center|x400px|ECoDE]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
[[File:crcda.jpg|center|x300px|CRC Design Assistant]]&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:easyCRC2.png|x300px]]&lt;br /&gt;
|[[File:easyCRC1.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SM1.png|400x500px]]&lt;br /&gt;
|[[File:SM2.png|400x500px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
These are the tools currently available for CRC card design on a computer. Selection of any particular tool can be done by choosing the one which best satisfies our need. The only problem however with using tools for CRC card design is that it is not always best for more than two people to work on the same computer.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53620</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53620"/>
		<updated>2011-10-21T01:10:31Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Creating CRC Cards */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This Wiki article surveys the various tools that were built to enable CRC card design on a computer. The tools cover both the tools that were developed for commercial purposes as  well as the ones that were designed for educational purposes to teach Object Oriented Design.&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations [http://en.wikipedia.org/wiki/Class-responsibility-collaboration_card (CRC)] is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies. &amp;lt;ref&amp;gt; [http://books.google.com/books/about/Using_CRC_Cards.html?id=baopCOstm_kC Using CRC Cards: An Informal Approach to Object-Oriented Development] &lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
1.	Discover Classes&lt;br /&gt;
2.	Determine Responsibilities of each class&lt;br /&gt;
3.	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|} &amp;lt;ref&amp;gt;[http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2007/wiki2_5_as CRC Card Layout] &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC &amp;lt;ref&amp;gt; [http://www.excelsoftware.com/quickcrcintro.html QuickCRC]&amp;lt;/ref&amp;gt; is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE&amp;lt;ref&amp;gt; [&lt;br /&gt;
http://www.cc.gatech.edu/ectropic/papers/ K. A. Gray, M. Guzdial, and S. Rugaber. Extending&lt;br /&gt;
CRC cards into a complete design process. Technical&lt;br /&gt;
report, College of Computing, Georgia Institute of&lt;br /&gt;
Technology, Atlanta, GA, 2002.] &amp;lt;/ref&amp;gt;, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
[[File:designass-3.jpg|center|x400px|ECoDE]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
[[File:crcda.jpg|center|x300px|CRC Design Assistant]]&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:easyCRC2.png|x300px]]&lt;br /&gt;
|[[File:easyCRC1.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SM1.png|400x500px]]&lt;br /&gt;
|[[File:SM2.png|400x500px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
These are the tools currently available for CRC card design on a computer. Selection of any particular tool can be done by choosing the one which best satisfies our need. The only problem however with using tools for CRC card design is that it is not always best for more than two people to work on the same computer.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53598</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53598"/>
		<updated>2011-10-21T00:58:03Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This Wiki article surveys the various tools that were built to enable CRC card design on a computer. The tools cover both the tools that were developed for commercial purposes as  well as the ones that were designed for educational purposes to teach Object Oriented Design.&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations [http://en.wikipedia.org/wiki/Class-responsibility-collaboration_card (CRC)] is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies. &amp;lt;ref&amp;gt; [http://books.google.com/books/about/Using_CRC_Cards.html?id=baopCOstm_kC Using CRC Cards: An Informal Approach to Object-Oriented Development] &lt;br /&gt;
&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|} &amp;lt;ref&amp;gt;[http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2007/wiki2_5_as CRC Card Layout] &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
[[File:designass-3.jpg|center|x400px|ECoDE]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
[[File:crcda.jpg|center|x300px|CRC Design Assistant]]&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:easyCRC2.png|x300px]]&lt;br /&gt;
|[[File:easyCRC1.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SM1.png|400x500px]]&lt;br /&gt;
|[[File:SM2.png|400x500px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
These are the tools currently available for CRC card design on a computer. Selection of any particular tool can be done by choosing the one which best satisfies our need. The only problem however with using tools for CRC card design is that it is not always best for more than two people to work on the same computer.&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53573</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53573"/>
		<updated>2011-10-21T00:46:09Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
This Wiki article surveys the various tools that were built to enable CRC card design on a computer. The tools cover both the tools that were developed for commercial purposes as  well as the ones that were designed for educational purposes to teach Object Oriented Design.&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations [http://en.wikipedia.org/wiki/Class-responsibility-collaboration_card (CRC)] is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
[[File:designass-3.jpg|center|x400px|ECoDE]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
[[File:crcda.jpg|center|x300px|CRC Design Assistant]]&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:easyCRC2.png|x300px]]&lt;br /&gt;
|[[File:easyCRC1.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SM1.png|400x500px]]&lt;br /&gt;
|[[File:SM2.png|400x500px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53536</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53536"/>
		<updated>2011-10-21T00:31:48Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* ECoDE (Ectropic Collaborative Design Environment) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
[[File:designass-3.jpg|center|x400px|ECoDE]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
[[File:crcda.jpg|center|x300px|CRC Design Assistant]]&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:easyCRC1.jpg|400x500px]]&lt;br /&gt;
|[[File:easyCRC2.jpg|400x500px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SM1.png|400x500px]]&lt;br /&gt;
|[[File:SM2.png|400x500px]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Designass-3.jpg&amp;diff=53533</id>
		<title>File:Designass-3.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Designass-3.jpg&amp;diff=53533"/>
		<updated>2011-10-21T00:31:28Z</updated>

		<summary type="html">&lt;p&gt;Sgade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53531</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53531"/>
		<updated>2011-10-21T00:31:14Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* ECoDE (Ectropic Collaborative Design Environment) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
[[File:designass-3.jpg|center|x300px|ECoDE]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
[[File:crcda.jpg|center|x300px|CRC Design Assistant]]&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SM1.png|400x500px]]&lt;br /&gt;
|[[File:SM2.png|400x500px]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53530</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53530"/>
		<updated>2011-10-21T00:30:32Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* ECoDE (Ectropic Collaborative Design Environment) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
[[File:designass-3.jpg|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
[[File:crcda.jpg|center|x300px|CRC Design Assistant]]&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SM1.png|400x500px]]&lt;br /&gt;
|[[File:SM2.png|400x500px]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Crcda.jpg&amp;diff=53515</id>
		<title>File:Crcda.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Crcda.jpg&amp;diff=53515"/>
		<updated>2011-10-21T00:26:43Z</updated>

		<summary type="html">&lt;p&gt;Sgade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53513</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53513"/>
		<updated>2011-10-21T00:26:27Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* CRC Design Assistant */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
[[File:crcda.jpg|center|x300px|CRC Design Assistant]]&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SM1.png|x300px]]&lt;br /&gt;
|[[File:SM2.png|x300px]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53501</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53501"/>
		<updated>2011-10-21T00:22:47Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Quick CRC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|x300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Quickcrc.jpg&amp;diff=53497</id>
		<title>File:Quickcrc.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Quickcrc.jpg&amp;diff=53497"/>
		<updated>2011-10-21T00:22:09Z</updated>

		<summary type="html">&lt;p&gt;Sgade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53494</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53494"/>
		<updated>2011-10-21T00:21:26Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Quick CRC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.jpg|center|300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it.&lt;br /&gt;
[[File:MeroBase.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Quickcrc.gif&amp;diff=53478</id>
		<title>File:Quickcrc.gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Quickcrc.gif&amp;diff=53478"/>
		<updated>2011-10-21T00:18:24Z</updated>

		<summary type="html">&lt;p&gt;Sgade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53475</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53475"/>
		<updated>2011-10-21T00:17:56Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Quick CRC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.gif|center|300px|Quick CRC Tool]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionality like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png|center|x300px]]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it. &lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53472</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53472"/>
		<updated>2011-10-21T00:17:07Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Quick CRC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== CRC CARDS ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
=== Creating CRC Cards ===&lt;br /&gt;
&lt;br /&gt;
CRC Cards help in getting the design right. CRC cards are generated as follows:&lt;br /&gt;
•	Discover Classes&lt;br /&gt;
•	Determine Responsibilities of each class&lt;br /&gt;
•	Describe relationship among each class.&lt;br /&gt;
&lt;br /&gt;
'''Discover Classes:'''The nouns in requirement document translate to classes. We enforce certain rules while choosing classes.  Identified Class is a singular noun or one that does not have functionality as some other class or is not simply a primitive type.&lt;br /&gt;
&lt;br /&gt;
'''Determine Responsibilities:'''  Responsibilities are the things that class knows or can do.  Verbs in requirements document translate to responsibilities.&lt;br /&gt;
&lt;br /&gt;
'''Describe Collaborators:''' Class might need other classes to fulfill certain responsibilities. Those classes can be identified as the collaborators for this class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:crccardlayout.jpg|x150px]]&lt;br /&gt;
|[[File:CRCCard.jpg|x150px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The above CRC card describes the class Shopping Cart. A shopping cart must be able to items and remove items form it so they become responsibilities of that class. It has to collaborate with Product Catalog to add and remove items so Product Catalog becomes collaborator to Shopping Cart&lt;br /&gt;
&lt;br /&gt;
=== Disadvantages of Paper CRC cards ===&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
=== Advantages of a CRC card tool ===&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
[[File:quickcrc.gif|center|300px]]&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:VPadd.png|x300px]]&lt;br /&gt;
|[[File:VPattr.png|x300px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionalities like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
[[File:flying3D.png]|x300px|center]&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it. &lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53384</id>
		<title>CSC/ECE 517 Fall 2011/ch4 4i js</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch4_4i_js&amp;diff=53384"/>
		<updated>2011-10-20T23:43:37Z</updated>

		<summary type="html">&lt;p&gt;Sgade: Created page with &amp;quot;== Introduction == Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real worl...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Classes, Responsibilities, and Collaborations (CRC) is a design method focused on creating highly cohesive and modular systems. Classes represent the real world entities. They have responsibilities – data and actions the class has to support. These responsibilities can be filled by the class itself or may collaborate with other classes to fulfill it.&lt;br /&gt;
CRC cards are 3X5 index cards one for each class. Each has a name and has two columns one for responsibilities and one for collaborators. We can write attributes and description on back of the card.&lt;br /&gt;
CRC cards help visualize the design and design can be easily modified by just replacing few cards. These can be useful throughout the life cycle and provides a basis for formal analysis and design methodologies.&lt;br /&gt;
&lt;br /&gt;
Disadvantages of Paper CRC cards:&lt;br /&gt;
*Modification of data in hand written cards is difficult.&lt;br /&gt;
*The information on cards needs to be transferred into an electronic medium in order to be used by software development tools.&lt;br /&gt;
*As the size of the project grows it’s difficult to maintain CRC cards.&lt;br /&gt;
*Difficult to communicate between teams.&lt;br /&gt;
*Time consuming.&lt;br /&gt;
&lt;br /&gt;
Advantages of a CRC card tool:&lt;br /&gt;
*Easy to maintain cards even as project grows in size.&lt;br /&gt;
*It can graphically illustrate relationship between cards.&lt;br /&gt;
*New cards can be defined for undefined super classes, subclasses etc.&lt;br /&gt;
*Information can be easily entered, updated, deleted.&lt;br /&gt;
*Information can be verified easily.&lt;br /&gt;
*When renaming a card information on other cards is easily updated.&lt;br /&gt;
*Easy to communicate these electronic  cards between teams&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CRC Card Tools==&lt;br /&gt;
&lt;br /&gt;
=== Quick CRC ===&lt;br /&gt;
&lt;br /&gt;
QuickCRC is a commercial tool developed by Excel Software for designing object-oriented software. It can be used on Mac OS X or Windows.The process of designing a program using QuickCRC involves creating a card for each class, establishing relationships, assigning responsibilities and attributes, defining and simulating scenarios, checking the model for errors and illustrating interesting relationships between objects.&lt;br /&gt;
&lt;br /&gt;
A few features supported by this tool are:&lt;br /&gt;
*Super and subclasses can be added by selecting from a pop up list of existing cards or by typing the name.&lt;br /&gt;
*Provides namespace support for partitioning the cards into different functional areas which can be used while listing specifications, printing cards or exporting information to other tools.&lt;br /&gt;
*It can generate the inheritance graphs form the information on the CRC cards.&lt;br /&gt;
*Linking cards and scenarios to foreign documents is made easy and thus they can  be easily accessed with a single click of the mouse.&lt;br /&gt;
*Allows the creation and simulation of scenarios which allows the early identification and correction of bugs. &lt;br /&gt;
*The designer can show the attribute access of each card responsibility. QuickCRC automatically graphs the attribute access to highlight attribute usage and incomplete areas of the design and thus allows in locating design problems.&lt;br /&gt;
*Information can be imported from other development tools and thus we can generate CRC cards from source code with WinTranslator or MacTranslator.&lt;br /&gt;
*Information can be exported to other development tools as the CRC cards can be exported to MacA&amp;amp;D, WinA&amp;amp;D or QuickUML to auto-generate UML class diagrams.&lt;br /&gt;
*It can generate a text or HTML coding specification, generate cards, attributes and responsibilities from selected words in a text file or selectively print CRC cards for a peer review. Design work is saved as an XML file.&lt;br /&gt;
&lt;br /&gt;
=== ECoDE (Ectropic Collaborative Design Environment) ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Ectropic Collaborative Design Environment, ECoDE, is a development tool designed to capture two key components of Ectropic design: Collaborations (CRC Cards) and Scenarios. ECoDE includes a graphical user interface targeting novice software designers and attempts to present an environment that couples the flexible and modular structure of well-designed object-oriented software and perspicuity of functionally organized software.The main interface called the Ectropic Design Navigator consists of two tools namely The CRC Card Navigator and the Scenarios Navigator. The design process consists of three phases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Analysis mode&amp;lt;/b&amp;gt;: This phase involves identifying and analyzing the program goals, identifying candidate classes to meet them, determining the responsibilities and distributing them among the candidate classes. It also involves creating scenarios for identifying the required responsibilities and building Scenarios from a sequence of CRC Card Responsibility pairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Design mode&amp;lt;/b&amp;gt;: This phase aims at designing a complete and implementable design. It involves reviewing each CRC card and assigning a corresponding method to each responsibility assigned to the card. In this mode the designer can create, categorize, and describe methods and match them with specific responsibilities apart from the tasks available in the analysis phase.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Program Phase&amp;lt;/b&amp;gt;: In this phase the tool checks all the CRC cards and makes sure that all the responsibilities have been assigned their corresponding methods. This allows in fixing deficiencies. It also provides the ability to convert CRC cards to actual Classes after which it asks the designer to provide attributes for the class and generates source code stubs which can then be completely implemented by the designer.&lt;br /&gt;
&lt;br /&gt;
=== CRC Design Assistant ===&lt;br /&gt;
&lt;br /&gt;
The CRC Design assistant is a freely available software tool that was developed to make the CRC design process easy for students. The system consists of a simple Access database and a set of classes. The database stores the design information for the classes, responsibilities, collaborations, contracts, subsystems, users, and documentation.&lt;br /&gt;
&lt;br /&gt;
Some of the important features of this tool are:&lt;br /&gt;
&lt;br /&gt;
*The CRC view has index cards scattered around the workspace. It uses drag-and-drop to make changes to a design. Dragging one card into another automatically makes changes to both the classes. This ensures that changes in the design are consistent.&lt;br /&gt;
*The CRC view also makes identifying classes with too many responsibilities easier and also helps in identifying classes that are too interconnected with the rest of the system.&lt;br /&gt;
*The tool provides automatic documentation for the application design. The document is in rich text format (RTF) which can be opened with Microsoft Word or WordPerfect. &lt;br /&gt;
*It generates comma separated variable (CSV) files that can be opened with Microsoft Visio to create CRC diagrams and object diagrams.&lt;br /&gt;
*Lines are drawn to represent collaborations between classes thus making it easy to visualize the extent of coupling in the system.&lt;br /&gt;
*Allows the designer to view the design at different levels of complexity by providing support for subsystem abstraction and grouping classes performing related tasks into a subsystem. &lt;br /&gt;
*It allows us to handle the growth in workspace by providing an option to print the CRC cards from the database and use the traditional approach and update the database after a work session. We could also use a projector or an electronic whiteboard for the same.&lt;br /&gt;
&lt;br /&gt;
=== Visual Paradigm for UML ===&lt;br /&gt;
&lt;br /&gt;
Visual Paradigm for UML is a CASE tool for UML diagrams. It supports thirteen types of diagrams.Type of diagram can be selected from Diagram navigator.  The option to select CRC card diagram is found under requirements capturing tab.Selecting a new CRC card diagram opens up a new diagram toolbar. We can create cards by selecting CRC Card from diagram tool.  A new CRC card appears on screen. The properties have to be edited. We can edit Card name (class name), Super classes, sub classes, its attributes, its responsibilities and its collaborators.  Attributes and responsibilities may be added by right clicking on attributes or responsibilities heading and click on add attribute or responsibility. Name of attribute and description can be entered and while entering responsibility Name and its collaborator are entered.&lt;br /&gt;
&lt;br /&gt;
=== Easy CRC ===&lt;br /&gt;
&lt;br /&gt;
EasyCRC combines CRC cards and sequence diagrams. It is originally developed to teach Object oriented paradigm. Most of UML tools don’t include CRC cards and diagrams which give conceptual view of the system rather they focus more on implementation view of the system. EasyCRC is the only tool that focuses on CRC cards and scenarios. If any changes occur to sequence diagrams we can make changes to CRC diagrams as well. &lt;br /&gt;
It also provides a text editor where the description can be copy pasted and the tool picks out the noun in the description and lists them. We can select the most appropriate nouns from the list and add them to the noun list. We can also select the words that were not listed by the tool by highlighting the word and adding it to noun list.There are two ways to update the responsibilities and collaborators in CRC diagram. First one is we enter all the values manually. The other method is to draw the sequence diagrams first and from these diagrams the responsibilities and collaborators of a class would be identified and updated.&lt;br /&gt;
&lt;br /&gt;
=== Interactive 3D CRC Cards (Flying Circus) ===&lt;br /&gt;
&lt;br /&gt;
In general 2D diagrams, it is difficult to see the entire diagram and its collaborators. This restricts the process of understanding the diagram and coming up with new collaborators. To avoid these a CRC card diagram can be drawn in a 3D space. Flying Circus is an automated 3D tool that aids the technique of CRC card design. CRC cards can be created, modified and placed in a 3D environment. The collaborations between the classes can be shown by links between the classes. Cards can be of different sizes, can use different colors and have comments included in it. Different colors make the easily visible however small the card may be. Flying circus is built out of open source projects like OpenSceneGraph(OSG), libsigc++, Flex etc. Flying circus provides functionalities like creating CRC card, deleting a CRC card, collaborators update, change of information on CRC card, change of properties of CRC cards, 3D Manipulators to position it at a desired place in 3D space.&lt;br /&gt;
&lt;br /&gt;
=== Merobase Component Finder ===&lt;br /&gt;
&lt;br /&gt;
It is an online software search engine. It supports simple text based search , interface search , module lookup.  The software can be searched and reused.  The query is searched in various sources like SourceForge etc.   Merobase allows user to define a CRC card and searches its database for matching components and displays it to user. He can reuse the cards and software associated with it. &lt;br /&gt;
&lt;br /&gt;
=== Software Ideas Modeler ===&lt;br /&gt;
&lt;br /&gt;
Software Ideas Modeler is a light weight tool that supports 14 types of UML diagrams.  On starting the tool it shows all the 14 type of diagrams it supports and asks to choose one among them. After selecting CRC diagram, a diagram toolbox is opened. From there we can select a new CRC card or a link and few other shapes are also provided. When a new CRC card is added, the name can be changed by clicking the name box. The propertied can be edited by double clicking the crc card. This opens up a property pop up box. All the required details can be filled up. At the bottom of CRC a 2  plus symbols is green color are provided. One is to add collaborator and the other one is to add responsibility. A comment button is also provided. All CRC cards can be created and collaborating cards can be linked using a link from diagram tool box.&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011&amp;diff=52409</id>
		<title>CSC/ECE 517 Fall 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011&amp;diff=52409"/>
		<updated>2011-10-18T04:24:10Z</updated>

		<summary type="html">&lt;p&gt;Sgade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Link title]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1a ms]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1a cs]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1a ri]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1a lj]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1b sa]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1b ds]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1b tj]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1c cm]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1c sj]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1c ka]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1d sr]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1e vs]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1e aa]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1a sc]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1e dm]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1e an]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1e sa]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1e lm]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1g vn]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1f rs]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1f sv]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1g jn]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1h ps]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1e sm]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1i zf]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1g rn]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1i cl]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1d ss]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1i lj]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1h hs]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 1d gs]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 2b ns]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 2b jp]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 2a av]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch2 2f jm]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch2 2e ad]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch2 2e kt]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch2 2e gp]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 2b qu]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch2 2c bs]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 2c rs]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 2a ca]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch1 2b rv]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch2 2c ds]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch2 2b sa]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch2 2f vh]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch2 2e ps]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch3 3a oe]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch3 3h rr]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch3 3h ss]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch3 4b js]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch3 4b ms]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4i aa]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4i sd]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4d mt]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4d ls]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4d ch]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4c ap]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4h sv]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4e cl]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4a ga]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4f sl]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2011/ch4 4i js]]&lt;br /&gt;
&lt;br /&gt;
*[[trial]]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51059</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51059"/>
		<updated>2011-09-26T00:57:57Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Further Reading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&amp;lt;ref&amp;gt;[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&amp;lt;ref&amp;gt;[http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
6. Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51058</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51058"/>
		<updated>2011-09-26T00:57:39Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* What is a better choice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&amp;lt;ref&amp;gt;[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&amp;lt;ref&amp;gt;[http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51057</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51057"/>
		<updated>2011-09-26T00:57:09Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* What is a better choice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&amp;lt;ref&amp;gt;[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&amp;lt;ref&amp;gt;[http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf Software Development &lt;br /&gt;
and Object-Oriented &lt;br /&gt;
Programming Paradigms]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51056</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51056"/>
		<updated>2011-09-26T00:56:27Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Focus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&amp;lt;ref&amp;gt;[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&amp;lt;ref&amp;gt;[http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51055</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51055"/>
		<updated>2011-09-26T00:55:54Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Abstraction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&amp;lt;ref&amp;gt;[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&amp;lt;ref&amp;gt;[http://bulletin.sigchi.org/1997/october/papers/ross/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51053</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51053"/>
		<updated>2011-09-26T00:55:08Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Evolution from Structured to Object oriented Programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&amp;lt;ref&amp;gt;[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&amp;lt;ref&amp;gt;[http://bulletin.sigchi.org/1997/october/papers/ross/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51052</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51052"/>
		<updated>2011-09-26T00:53:57Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Evolution from Structured to Object oriented Programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Structured_programming]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&amp;lt;ref&amp;gt;[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&amp;lt;ref&amp;gt;[http://bulletin.sigchi.org/1997/october/papers/ross/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51051</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51051"/>
		<updated>2011-09-26T00:53:32Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Abstraction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.[http://en.wikipedia.org/wiki/Structured_programming]&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&amp;lt;ref&amp;gt;[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&amp;lt;ref&amp;gt;[http://bulletin.sigchi.org/1997/october/papers/ross/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51049</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51049"/>
		<updated>2011-09-26T00:53:04Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Focus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.[http://en.wikipedia.org/wiki/Structured_programming]&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&amp;lt;ref&amp;gt;[http://bulletin.sigchi.org/1997/october/papers/ross/]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51048</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51048"/>
		<updated>2011-09-26T00:52:40Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* What is a better choice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.[http://en.wikipedia.org/wiki/Structured_programming]&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&amp;lt;ref&amp;gt;[http://www.buyya.com/java/Chapter1.pdf]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51047</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51047"/>
		<updated>2011-09-26T00:51:19Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.[http://en.wikipedia.org/wiki/Structured_programming]&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:[http://www.buyya.com/java/Chapter1.pdf]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
='''References'''=&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51045</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51045"/>
		<updated>2011-09-26T00:50:45Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Evolution from Structured to Object oriented Programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.[http://en.wikipedia.org/wiki/Structured_programming]&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:[http://www.buyya.com/java/Chapter1.pdf]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51043</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51043"/>
		<updated>2011-09-26T00:50:10Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* What is a better choice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:[http://www.buyya.com/java/Chapter1.pdf]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51042</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51042"/>
		<updated>2011-09-26T00:49:56Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* What is a better choice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:[http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51041</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51041"/>
		<updated>2011-09-26T00:49:26Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Focus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51039</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51039"/>
		<updated>2011-09-26T00:49:13Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Abstraction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51038</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51038"/>
		<updated>2011-09-26T00:48:11Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Focus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51035</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51035"/>
		<updated>2011-09-26T00:47:17Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Focus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51033</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51033"/>
		<updated>2011-09-26T00:46:35Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Abstraction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.[http://bulletin.sigchi.org/1997/october/papers/ross/]&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51031</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51031"/>
		<updated>2011-09-26T00:45:20Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
1. Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
2. Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
3. [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
4. http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
5. Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51028</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51028"/>
		<updated>2011-09-26T00:34:50Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* What is a better choice */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
The differences between Structured and Object-oriented Programming are briefed below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51019</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51019"/>
		<updated>2011-09-26T00:30:25Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Polymorphism */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
The following is an example of polymorphism exhibited in the constructors of a class&lt;br /&gt;
 public class Website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public Website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public Website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51016</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51016"/>
		<updated>2011-09-26T00:27:09Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Focus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The Object-oriented Programming approach reverses the emphasis of data and functions used in structured programming. In Object-oriented Programming, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
 public class website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51010</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51010"/>
		<updated>2011-09-26T00:24:20Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Reusability */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, subroutines are written for and can be used only to perform a specific task. They cannot be reused when the task at hand is different or an extension of the functionality for which that particular function was written.&lt;br /&gt;
&lt;br /&gt;
As an example of a Base class we can consider the following Bicycle class:&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are some other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The OOP approach reverses the emphasis of data and functions used in structured programming. In OOP, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert (1990) contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
 public class website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51004</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=51004"/>
		<updated>2011-09-26T00:17:09Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Abstraction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) is essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class). A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, the only possible way in which reusability can be implemented is the same subroutine can be called multiple times.&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The OOP approach reverses the emphasis of data and functions used in structured programming. In OOP, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert (1990) contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
 public class website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50997</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50997"/>
		<updated>2011-09-26T00:13:26Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Evolution from Structured to Object oriented Programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development time lines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first Object oriented Programming language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current Object oriented Programming languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) are essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class. A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson (1992) put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, the only possible way in which reusability can be implemented is the same subroutine can be called multiple times.&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The OOP approach reverses the emphasis of data and functions used in structured programming. In OOP, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert (1990) contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
 public class website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50990</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50990"/>
		<updated>2011-09-26T00:08:46Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Evolution from Structured to Object oriented Programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development timelines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first OOP language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current OOP languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) are essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class. A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson (1992) put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, the only possible way in which reusability can be implemented is the same subroutine can be called multiple times.&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The OOP approach reverses the emphasis of data and functions used in structured programming. In OOP, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert (1990) contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
 public class website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50988</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50988"/>
		<updated>2011-09-26T00:00:14Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* Analysis and Design Differences */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Regardless of the language used prior to OOP, programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development timelines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first OOP language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current OOP languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) are essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class. A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson (1992) put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, the only possible way in which reusability can be implemented is the same subroutine can be called multiple times.&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The OOP approach reverses the emphasis of data and functions used in structured programming. In OOP, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert (1990) contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
 public class website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated.&lt;br /&gt;
 &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50987</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50987"/>
		<updated>2011-09-25T23:59:30Z</updated>

		<summary type="html">&lt;p&gt;Sgade: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Regardless of the language used prior to OOP, programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development timelines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first OOP language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current OOP languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) are essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class. A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson (1992) put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, the only possible way in which reusability can be implemented is the same subroutine can be called multiple times.&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The OOP approach reverses the emphasis of data and functions used in structured programming. In OOP, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert (1990) contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
 public class website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Analysis and Design Differences ==&lt;br /&gt;
&lt;br /&gt;
In structured programming, while analysis starts with a consideration of real-world problems, the real-world focus is lost as requirements are transformed into a series of data flow diagrams which is the intermediate step before the design stage. When program design takes place, the process has distanced itself from the real world. The design stage culminates in the creation of structure charts and detailed logic diagrams. By the time the programming team goes to work, they are no longer focused on the real-world objects being emulated. &lt;br /&gt;
In contrast, using object-oriented analysis, design, and programming techniques, the focus remains on the real-world objects throughout the development cycle. There is an overlap between each of the three development steps. The analyst and the programmer are both interested in development of usable (and reusable) objects. These programming objects (referred to as class declarations), once tested and made available to other programmers, do not have to be retested and redesigned every time changes are made to the data layout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50986</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50986"/>
		<updated>2011-09-25T23:58:27Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Regardless of the language used prior to OOP, programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development timelines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first OOP language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current OOP languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
Structured programming is suitable for small programs but for large programs, structured programming can produce cumbersome code with large amounts of data. With structured programming in large programs, for a small change, multiple subprograms will have to be changed. On the other hand, object-oriented approach is more flexible, by separating a program into a network of subsystems, with each controlling their own data, algorithms, or devices across the entire program.&lt;br /&gt;
 &lt;br /&gt;
The Object-Oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. The data is accessed by calling specially written functions, commonly called methods. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. &lt;br /&gt;
&lt;br /&gt;
An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept. An object-oriented program may thus be viewed as a collection of interacting objects, as opposed to the conventional model, in which a program is seen as a list of tasks (subroutines) to perform. Object-Oriented programming can lessen the gap between the programmer models and the application domain being modeled.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) are essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class. A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson (1992) put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, the only possible way in which reusability can be implemented is the same subroutine can be called multiple times.&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The OOP approach reverses the emphasis of data and functions used in structured programming. In OOP, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert (1990) contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
 public class website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] [http://bulletin.sigchi.org/1997/october/papers/ross/ Structured Programmers Learning Object-Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
[2] [http://books.google.com/books?id=A71tgIY4BoMC&amp;amp;pg=PT59&amp;amp;lpg=PT59&amp;amp;dq=Reusability+in+structured+and+Object+Oriented+Programming&amp;amp;source=bl&amp;amp;ots=YPROMVi6qs&amp;amp;sig=6OG-I4TIbuUN2UUgtD47Vu7SS-o&amp;amp;hl=en&amp;amp;ei=T4J_TuvJAYW-tgfckb#v=onepage&amp;amp;q&amp;amp;f=false Beginning Programming All-In-One Desk Reference For Dummies]&lt;br /&gt;
&lt;br /&gt;
[3] [http://www.buyya.com/java/Chapter1.pdf Software Development and Object-Oriented Programming Paradigms]&lt;br /&gt;
&lt;br /&gt;
[4] [http://en.wikipedia.org/wiki/Structured_programming Structured Programming]&lt;br /&gt;
&lt;br /&gt;
[5] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[6] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[7] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[8] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;br /&gt;
&lt;br /&gt;
[9] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[10] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50955</id>
		<title>CSC/ECE 517 Fall 2011/ch1 1e sm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2011/ch1_1e_sm&amp;diff=50955"/>
		<updated>2011-09-25T23:33:25Z</updated>

		<summary type="html">&lt;p&gt;Sgade: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article briefs about how [http://en.wikipedia.org/wiki/Object-oriented_programming Object-oriented Programming] came into being after [http://en.wikipedia.org/wiki/Structured_programming Structured Programming] prevailed for years and it compares and contrasts the various aspects of these two programming approaches. It sheds some light on the popular belief that Object-oriented technology will alleviate some of the problems associated with structured approaches.&lt;br /&gt;
&lt;br /&gt;
== Evolution from Structured to Object oriented Programming ==&lt;br /&gt;
&lt;br /&gt;
Regardless of the language used prior to OOP, programmers since the 1970s have embraced a style called structured programming. As with earlier &amp;quot;spaghetti code,&amp;quot; computer programmers still used such concepts as variables, assignments to variables, expression construction, and function evaluation. Typically, those programmers spent long hours designing, coding, and debugging programs. Structured techniques, such as the use of subroutines rather than GOTOs, resulted in improved development timelines and increased supportability. Although improved over prior coding techniques, structured programmers found that they usually could not reuse routines already coded for earlier programs. In 1967 the first OOP language, SIMULA-67, was introduced which had several unique ways of coding subroutines with improved potential for reuse. Current OOP languages such as Java (derived from C++) and Smalltalk share commonalities with traditional structured programming languages such as C and COBOL while adding in the ideas first developed in the 60s. Despite the many commonalities, object-oriented programming is significantly different from structured programming.&lt;br /&gt;
&lt;br /&gt;
== Comparison ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Abstraction_(computer_science) Abstraction]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
In structured programming, data and functions (or procedures) are separate. The data (e.g., employees, orders, or sales records) are essentially passed to functions (e.g., print, display, add, change, and delete routines) that act on the data as required. Thus the functions can work on data from different parts of the program. If we do not know what data a function might manipulate and when, any changes we make to that function could affect a program in unpredictable ways. This makes the task of modifying and fixing the code harder.  &lt;br /&gt;
&lt;br /&gt;
Object oriented programming can partially solve this problem by organizing data, and all the subprograms that manipulate that data, into a single location, or an object. In other words this means that the data and functions are integrated into data structures called classes. Encapsulation is used to package data with the functions that act on the data. The declaration of such an encapsulated unit is called a class, which refers to an abstract view of objects in the real world. Object-oriented programs typically restrict the programmer from haphazard access to the data. If a programmer using an object wishes to, for example, display or change the data, the only way of doing so is via a controlled access mechanism (a method of the class. A programmer writing a control routine in the main part of a program using OOP techniques simply sends a message to the object asking it to print, display, or change its data. All of the methods written with the class have open access to the data associated with an object of that class, but no part of a program constructed in the future, outside of the object, can change the data thereby possibly introducing mistakes or errors in the program. As Clarkson (1992) put it, &amp;quot;objects manipulate themselves; nothing reaches inside and stirs their contents around&amp;quot;. These features allow us to easily modify and fix the code.&lt;br /&gt;
&lt;br /&gt;
The following is a simple example that demonstrates encapsulation in Object oriented programming:&lt;br /&gt;
&lt;br /&gt;
 public class Box {&lt;br /&gt;
 private int length;&lt;br /&gt;
 private int width;&lt;br /&gt;
 private int height;&lt;br /&gt;
 public int getLength() {&lt;br /&gt;
      return length;&lt;br /&gt;
 }&lt;br /&gt;
 public void setLength(int length) {&lt;br /&gt;
      this.length = length;&lt;br /&gt;
 }&lt;br /&gt;
 public int getWidth() {&lt;br /&gt;
      return width;&lt;br /&gt;
 }&lt;br /&gt;
 public void setWidth(int width) {&lt;br /&gt;
      this.width = width;&lt;br /&gt;
 }&lt;br /&gt;
 public int getHeight() {&lt;br /&gt;
      return height;&lt;br /&gt;
 }&lt;br /&gt;
 public void setHeight(int height) {&lt;br /&gt;
      this.height = height;&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Reusability Reusability]&amp;lt;/b&amp;gt; ===&lt;br /&gt;
Reusability is achieved in Object Oriented programming through Inheritance. Inheritance is when one class inherits, or absorbs, the same fields and methods of another class, and adds necessary methods and fields to the new class. This lets developers maximize the use of application objects. In inheritance mechanism, data structures and behaviors are inherited. Without inheritance, every subclass would have to write the exact same fields and methods (because that class requires those fields and methods), which is time consuming and inefficient.&lt;br /&gt;
Developers can implement inheritance in two modes: single and multiple. Single inheritance allows the inheritance of information from a single object/class, whereas multiple inheritance allows objects to inherit information from two objects/classes simultaneously. &lt;br /&gt;
The more software you can borrow from others and incorporate in your own programs, the less you have to do yourself. There's more software to borrow in an object-oriented programming environment, because the code is more reusable. Collaboration between programmers working in different places for different organizations is enhanced, while the burden of each project is eased. Classes and frameworks from an object-oriented library can make inheritance possible.&lt;br /&gt;
&lt;br /&gt;
In structured programming, the only possible way in which reusability can be implemented is the same subroutine can be called multiple times.&lt;br /&gt;
&lt;br /&gt;
 public class Bicycle {&lt;br /&gt;
         &lt;br /&gt;
     public int cadence;&lt;br /&gt;
     public int gear;&lt;br /&gt;
     public int speed;&lt;br /&gt;
         &lt;br /&gt;
     public Bicycle(int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         gear = startGear;&lt;br /&gt;
         cadence = startCadence;&lt;br /&gt;
         speed = startSpeed;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setCadence(int newValue) {&lt;br /&gt;
         cadence = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setGear(int newValue) {&lt;br /&gt;
         gear = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
     public void applyBrake(int decrement) {&lt;br /&gt;
         speed -= decrement;&lt;br /&gt;
     }    &lt;br /&gt;
     public void speedUp(int increment) {&lt;br /&gt;
         speed += increment;&lt;br /&gt;
     }&lt;br /&gt;
        &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
A class declaration for a MountainBike class that is a subclass of Bicycle might look like this:&lt;br /&gt;
&lt;br /&gt;
 public class MountainBike extends Bicycle &lt;br /&gt;
 {      &lt;br /&gt;
     public int seatHeight;&lt;br /&gt;
     public MountainBike(int startHeight, int startCadence, int startSpeed, int startGear) {&lt;br /&gt;
         super(startCadence, startSpeed, startGear);&lt;br /&gt;
         seatHeight = startHeight;&lt;br /&gt;
     }   &lt;br /&gt;
     public void setHeight(int newValue) {&lt;br /&gt;
         seatHeight = newValue;&lt;br /&gt;
     }   &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
There are other added benefits of reusability such as:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Reliability&amp;lt;/b&amp;gt;: The increased reusability of object-oriented code also increases its reliability. A class taken from a library is likely to have found its way into a variety of different applications and situations. The more the code has been used, the more likely it is that problems will have been encountered and fixed. Bugs that would have seemed strange and hard to find in your program might already have been tracked down and eliminated.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Efficiency&amp;lt;/b&amp;gt;: The component developers are likely to be experts in their field and will have used the best possible algorithms and data structures.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Time Savings&amp;lt;/b&amp;gt;: By relying upon existing components there is less software to develop and hence applications can be built quicker.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Decreased maintenance effort&amp;lt;/b&amp;gt;: Using others' components decreases the amount of maintenance effort that the application developer needs to expend. The maintenance of the reused components is the responsibility of the component supplier.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Consistency&amp;lt;/b&amp;gt;: Reliance on a library of standard components will tend to spread a consistency of design message throughout a team of programmers working on an application. The library is the basis of a standard that will lend coherency and conformity to the design process.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Investment&amp;lt;/b&amp;gt;: Reusing software will save the cost of developing similar software from scratch. The investment in the original development is preserved if the developed software can be used in another project. The most reusable software tends to be that produced by the best developers. Reusing software is thus a way of preserving the knowledge and creations of the best developers.&lt;br /&gt;
&lt;br /&gt;
=== Focus ===&lt;br /&gt;
&lt;br /&gt;
Another major difference is that in structured programming functions are the primary focus of design. Data is of secondary importance. The structured programming approach results in many different parts of a program which have access to the data. The main control routine and any sub-routine may be coded to access the data directly, change it, and inadvertently introduce mistakes. If one programmer changes the representation of the data in the computer's memory by re-arranging fields within a record, other sub-routines in the program may need to be re-written and must then be re-tested to account for this change.&lt;br /&gt;
&lt;br /&gt;
The OOP approach reverses the emphasis of data and functions used in structured programming. In OOP, programs pass messages to object methods that are conceptually packaged with an object's data. Object-oriented programming requires the analyst, designer and programmer to focus on objects rather than actions. This is a fundamental change from structured tools that focused on desired program actions with data playing a role in the shadows. Rosson and Alpert (1990) contrast the differences between conventional structured programming languages and OOP this way:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Rather than invoking procedures to act on passive data, messages evoke object activity: A message sent to an object is a specification of some action, a request for the object to exhibit some behavior, or to supply some information. The action taken by the object is a function of its interpretation of the message and its internal state.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Polymorphism_(computer_science) Polymorphism] ===&lt;br /&gt;
&lt;br /&gt;
Polymorphism allows an object to be processed differently by data types and/or data classes. More precisely, it is the ability for different objects to respond to the same message in different ways. It allows a single name or operator to be associated with different operations, depending on the type of data it has passed, and gives the ability to redefine a method within a derived class. &lt;br /&gt;
&lt;br /&gt;
For example, given the student and business subclasses of customer in a banking system, a programmer would be able to define different getInterestRate() methods in student and business to override the default interest getInterestRate() that is held in the customer class. &lt;br /&gt;
&lt;br /&gt;
Also, in OOP, polymorphism permits the program to decide at run-time which of like-named methods derived from the same base class is the appropriate one to execute. Using this technique, also referred to as late-binding, a program coded to land &amp;quot;flying vehicles&amp;quot; can correctly land such flying vehicles as airplanes and helicopters without the need for traditional if-else or switch-case logic.&lt;br /&gt;
&lt;br /&gt;
Polymorphism cannot be implemented in structured programming. Considering the same customer class example mentioned above, in structured programming, we would have to implement two different methods for computing the interest, one for the student and another for the businessman.&lt;br /&gt;
&lt;br /&gt;
 public class website {&lt;br /&gt;
 &lt;br /&gt;
  String name;&lt;br /&gt;
  String url;&lt;br /&gt;
  String description;&lt;br /&gt;
  &lt;br /&gt;
  public website(String n, String u, String d) {&lt;br /&gt;
    name = n; &lt;br /&gt;
    url  = u;&lt;br /&gt;
    description = d;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  public website() {&lt;br /&gt;
    name = &amp;quot;&amp;quot;; &lt;br /&gt;
    url  = &amp;quot;&amp;quot;;&lt;br /&gt;
    description = &amp;quot;&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== What is a better choice ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Whether we use object oriented or structured programming depends partly on our choice of language, but also on our design.&lt;br /&gt;
For example, the C language doesn’t offer any features for object oriented programming, but with enough discipline we can still write object-oriented code in C, such as the [http://mail.gnome.org/archives/gtk-app-devel-list/1998-November/msg00080.html GTK] windowing library.&lt;br /&gt;
On the other hand, we can write a Java program that completely fails to take advantage of Java’s OOP features, by putting all of our code in a single class and using classes with public members just as we would use structs in C.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;b&amp;gt;Difference&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Structured Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
! &amp;lt;b&amp;gt;Object-Oriented Programming&amp;lt;/b&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Approach&amp;lt;/b&amp;gt;&lt;br /&gt;
| Top-down approach is followed&lt;br /&gt;
| Bottom-up approach is followed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Focus&amp;lt;/b&amp;gt;&lt;br /&gt;
| Focus is on algorithm and control flow.&lt;br /&gt;
| Focus is on object model.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Program Organization&amp;lt;/b&amp;gt;&lt;br /&gt;
| Program is divided into a number of sub modules, or functions, or procedures.&lt;br /&gt;
| Program is organized by having a number of classes and objects.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Design&amp;lt;/b&amp;gt;&lt;br /&gt;
| Functions are independent of each other.&lt;br /&gt;
| Each class is related in a hierarchical manner.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Function Call&amp;lt;/b&amp;gt;&lt;br /&gt;
| No designated receiver in the function call.&lt;br /&gt;
| There is a designated receiver for each message passing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Data/methods&amp;lt;/b&amp;gt;&lt;br /&gt;
| Views data and functions as two separate entities. &lt;br /&gt;
| Views data and function as a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Maintenance&amp;lt;/b&amp;gt;&lt;br /&gt;
| Maintenance is costly.&lt;br /&gt;
| Maintenance is relatively cheaper.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Reusability&amp;lt;/b&amp;gt;&lt;br /&gt;
| Software reuse is not possible.&lt;br /&gt;
| Helps in software reuse.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Passing Arguments&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function call is used. &lt;br /&gt;
| Message passing is used&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Abstraction&amp;lt;/b&amp;gt;&lt;br /&gt;
| Function abstraction is used. &lt;br /&gt;
| Data abstraction is used.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Algorithm/Data&amp;lt;/b&amp;gt;&lt;br /&gt;
| Algorithm is given importance. &lt;br /&gt;
| Data is given importance.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Domain&amp;lt;/b&amp;gt;&lt;br /&gt;
| Solution is solution-domain specific. &lt;br /&gt;
| Solution is problem-domain specific.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Encapsulation&amp;lt;/b&amp;gt;&lt;br /&gt;
| No encapsulation. Data and functions are separate. &lt;br /&gt;
| Encapsulation packages code and data altogether. Data and functionalities are put together in a single entity.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Programmer&amp;lt;/b&amp;gt;&lt;br /&gt;
| Relationship between programmer and program is emphasized.&lt;br /&gt;
| Relationship between programmer and user is emphasized.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;Technique&amp;lt;/b&amp;gt;&lt;br /&gt;
| Data-driven technique is used. &lt;br /&gt;
| Driven by delegation of responsibilities.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] Leonard H.Weiner(1978-02-01) [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=990555.990636&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490  &amp;quot;The roots of structured programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[2] Edsger Dijkstra, [http://dl.acm.org.prox.lib.ncsu.edu/citation.cfm?id=1243380.1243381&amp;amp;coll=DL&amp;amp;dl=GUIDE&amp;amp;CFID=270598&amp;amp;CFTOKEN=91997490 &amp;quot;Notes on Structured Programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[3] Peter Wegner, [http://dl.acm.org/citation.cfm?id=383004 &amp;quot;Concepts and paradigms of object-oriented programming&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[4] Luiz Fernando Capretz, [http://dl.acm.org/citation.cfm?id=638778 &amp;quot;A brief history of the object-oriented approach&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
[5] [http://www.educational-computing.co.uk/OOPSample.doc OOP Sample]&lt;br /&gt;
&lt;br /&gt;
[6] http://askville.amazon.com/Compare-Contrast-Structured-programming-Object-Oriented/AnswerViewer.do?requestId=2470573&lt;/div&gt;</summary>
		<author><name>Sgade</name></author>
	</entry>
</feed>