<?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=Suze</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=Suze"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Suze"/>
	<updated>2026-06-02T21:25:10Z</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_2009/wiki3_7_f1&amp;diff=29803</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=29803"/>
		<updated>2009-11-21T19:47:21Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Complementing agile : extending to newer agile methodologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can be complemented by other  design methodologies. Section 1 gives a brief overview of Agile. Section 2 highlights the advantage of agile over traditional models,  like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. Section 3 highlights why it might not be possible to introduce all of the agile practices at the same time. Section 4 takes up a few design methodologies and focuses on how they build on agile and complement it. &lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To keep pace with ever-increasing customer demands on software functionality and time-to-market expectations, software developers have had to evolve the way they develop code to be both faster and higher quality. As part of this trend, the Waterfall method of software development began to give way in the late 1990s to a more lightweight method of software development: Agile.&lt;br /&gt;
&lt;br /&gt;
Simply put, Agile software development is an approach that provides flexibility to accommodate continuous change&lt;br /&gt;
throughout the software development cycle. It stresses rapid delivery of working software, empowerment of developers, and&lt;br /&gt;
emphasizes collaboration between developers and the rest of the team, including business people.&lt;br /&gt;
&lt;br /&gt;
Agile contrasts with the still-popular Waterfall development approach, which is front-end loaded with comprehensive scope&lt;br /&gt;
and requirements definitions, and which employs clear, consecutive hand-offs from requirements definition to design to coding&lt;br /&gt;
and then to quality assurance. In contrast, Agile incorporates a continuous stream of requirements gathering that continues&lt;br /&gt;
throughout development. Business people are involved early and often throughout the release cycle, ensuring that the software&lt;br /&gt;
being developed meets the true needs of both the end-user and the business. Change to the requirements and to the overall&lt;br /&gt;
feature set is expected to occur as outside opportunities or threats arise.&lt;br /&gt;
&lt;br /&gt;
In short, Agile fully embraces change and Agile teams are structured in such a way that they can receive and act on constant&lt;br /&gt;
feedback provided by the build process, by other developers, from QA, and from business stakeholders.&lt;br /&gt;
&lt;br /&gt;
== Focus of Agile Methodologies ==&lt;br /&gt;
Agile is based upon a number of guiding principles that all Agile teams follow. For the purposes of this discussion, three&lt;br /&gt;
principles – or values – are of particular interest:&lt;br /&gt;
&lt;br /&gt;
* Quality software development&lt;br /&gt;
* Iterative flexibility&lt;br /&gt;
* Continuous improvement&lt;br /&gt;
&lt;br /&gt;
===Quality Software Development===&lt;br /&gt;
The primary focus of Agile development is to enable the development of quality software that satisfies a customer need – i.e.&lt;br /&gt;
provides a functioning feature or capability – within a specific period of time (typically no more than a few weeks) called an&lt;br /&gt;
“iteration”. In theory, a product developed in an Agile environment could be market-ready after each iteration.&lt;br /&gt;
Delivering a series of market-ready products, each in just weeks, demands that a rigorous quality process be built into the Agile&lt;br /&gt;
development cycle. Each iteration must be fully developed: tested, defect-free, and complete with documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Iterative Flexibility===&lt;br /&gt;
With a focus on speed and nimbleness, Agile is open to changes that inevitably arise throughout the development cycle. The&lt;br /&gt;
iterative process is flexible, based on an understanding that original requirements may (or will likely) need to change due to&lt;br /&gt;
customer demand, market conditions, or other reasons. Because business users are involved throughout the process, and&lt;br /&gt;
because each iteration is short, new requirements can be introduced and prioritized very quickly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Continuous Improvement===&lt;br /&gt;
An Agile environment provides developers with an opportunity to learn new skills and to exercise greater autonomy to do&lt;br /&gt;
their jobs. The iterative framework is empowering because it enables continuous improvement, with testing/quality assurance&lt;br /&gt;
occurring as part of the iterative process, rather than only periodically or at the end of a long process when it is often difficult&lt;br /&gt;
or not cost effective to fix coding defects or to incorporate lessons learned along the way. Agile also makes the testing and [http://en.wikipedia.org/wiki/Quality_assurance Quality Assurance] process transparent to the developers who originate the code, further contributing to their learning and facilitating future&lt;br /&gt;
improvements and coding efficiencies.&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
===Advantages of the agile method===&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Challenges in Applying Agile Methodologies== &lt;br /&gt;
 &lt;br /&gt;
* [3] researches about the challenges in applying agile and concludes by introducing a set of new and modified development practices, which will help in developing a large agile project. One of the aspects common to many agile development methodologies is that the entire team (business analysts, developers, and testers) collaborate very heavily. With a large project, this type of collaboration is difficult at best. Teams tend to break up into subteams for better communication. The downside to subteams is the possibility that the subteams build stove-piped  sub-systems if communication is insufficient among the teams. Problems of consistency and duplication may go undiscovered. Of course, there are other practices that help alleviate these problems such as rotating team members among the subteams, having an overall design document, etc. The different subteams may result in a non-homogeneous and inconsistent architecture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Many of the solutions agile methods promote, draw on a limited set of techniques for managing organizations and understanding customers. [7] focuses on incorporating customer-centered techniques such as [http://en.wikipedia.org/wiki/Contextual_design Contextual Design] to provide additional  solutions to the real problems recognized by agile methods. These solutions work in combination with agile methods’ strengths resulting in a process that incorporates the customer voice, provides room for UI and user interaction design, and can address significantly large projects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example Scenarios- Newer methodologies complementing agile==&lt;br /&gt;
&lt;br /&gt;
We have explored a few examples below to see how agile is complemented by other methodologies.&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;b&amp;gt;Separating Design from Engineering: &amp;lt;/b&amp;gt; Much of the distinctiveness (and much of the value) of agile methods comes from the&lt;br /&gt;
clear separation of responsibilities they bring to the development process. Developers write code and design the implementation of systems—that is what they are good at. They are not good at understanding how people work, creating effective and intuitive user interfaces, or making an interface usable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The great strength of agile methods is that they focus the engineers on doing what engineers do best. The weakness of agile methods is that they give little guidance in figuring out what to tell the engineers to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Core Team: &amp;lt;/b&amp;gt; Possible agile solutions would be to start with a core team which builds out a simple business case in a test-driven manner. This first phase will build out enough of most of the architecture. With a small team, a full agile methodology works without modification. When a significant portion of the architecture is built, it is time to divide the project by growing the development team and splitting up into smaller subteams to grow the project into a fully functional software system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Role of an architect:&amp;lt;/b&amp;gt; While there is no traditional architect role in most agile development methodologies, in large teams, it is often beneficial to reintroduce a modified version of this role. The architect is a member of the team with significant  design and development talent and experience and he has to understand the ‘whole’ application code-base. The architect is hands-on and pairs with others on the team frequently and will be a participant in many agile modeling design sessions on the whiteboard. This helps keep away redundancies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Continuous Integration:&amp;lt;/b&amp;gt; While each sub-team will have their own build running, agile methodology suggests having a 'brain' team that will have to create a master build that builds all sub-teams code and/or deploy their binary files. The master build will run frequently by pulling down the last successful builds for sub projects, compile and deploy the whole project and run the tests. In case of failure the brain team has to identify the problem and resolve it or take it to the responsible sub team to resolve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Refactoring:&amp;lt;/b&amp;gt; In large projects Refactoring sometimes becomes very expensive process and may take a month to be done. Some design ahead may be done to save expensive major refactoring later. For the conquer team when it’s still early on the project, to avoid large complicated refactoring some extra time should be spent for designing for future known requirements. Having the overall picture of use cases will make it easier to predict future requirements and create a design that will handle them. This design ahead is allowed only during the conquer phase of the project and will only apply to core systems, frameworks and similar subsystems of the system which may be more expensive to be re-factored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tests:&amp;lt;/b&amp;gt; To reduce the cost of refactoring, the team may depend on functional tests more than unit tests. Functional tests test the functionality of the system and in general do not depend on the system design. Unit tests should still be created for test driven development and for critical pieces of the system that may cause the system to break. Tests that are created after the development and tests created for reported bugs should be functional tests. Having less unit tests will lead to more time spent in debugging issues and functional tests cannot pin point problems but having a better design through constant refactoring will reduce the development time much more than the extra time being spent in debugging issues. Functional test should be documented in each test to describe the test scenario, expected results and differences between test scenarios. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are some of the recommended practices that will help mediate some of the problems in applying agile design methodologies to projects. There are also some difficulties with applying these practices such as with the master build, with communication between teams, with extreme designing to get useless frameworks, and care should be taken to avoid them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scrum is currently one of the most popular agile methods. It is a light-weight project management approach. Scrum as an agile method provides a framework that can be applied to other methods and approaches. Any process needs guidelines to support people actually doing the work. Processes such as the Unified Process spend lots of time describing techniques such as Use Cases, model driven development and architecture centric design. To offset this, scrum lifecycle can help provide a clear set of light weight management techniques that enable the team to effectively work together, deliver work and interact with the business.  This method includes some details on techniques such as pair programming, user stories and testdriven development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To further understand how Agile methods help complement other design methodologies, consider a case in point: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Agile design methodology working with Contextual Design methodology '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Contextual Design is a user-centered design method that provides techniques covering the entire front end of systems design, from figuring out who your users are and how they work through designing the detailed user interface and functionality of the system.&lt;br /&gt;
&lt;br /&gt;
Agile methods need to be used in tandem with Contextual Design methodology. Contextual Design methodology can help provide a fair idea as to the scope of the system,  decisions regarding whether tasks will be streamlined through the introduction of technology or replaced entirely by automated system, and  how this will affect the overall buisness. These design questions are also known as systems analysis or requirements analysis and aren’t addressed by agile methods, but help complete the picture about the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Contextual Design methodology provides Contextual Inquiry, work modeling, consolidation and affinity building, and visioning to support a variety of  activities. This helps understand how people work, but does not focus on clear separation of responsibilities of the development process. And the latter is where Agile methods help tremendously. Developers write code and design the implementation of systems and  agile methods help focus the engineers on doing this better.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the case of a user interface (UI) design, which must be assembled into coherent, transparent screens that support the user’s work in the new system. Regardless of where UI design is situated organizationally, a successful agile development project depends on the skill being available, even if it does not explicitly assign such a role. Because the UI is the interface between the user and the system’s function, the only way to test the system is through the UI. Effective UI design is a prerequisite for agile methods to work, but the methodology provides no separate focus or testing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Contextual Design methodology recognizes and resources UI design as a separate discipline—which fits the agile approach of focusing the developers on developing code. This provides requirements for UI design and the paper mockups permit the UI to be considered and tested on its own, independent of the developer’s underlying implementation.&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
In summary, Agile methods provide a strong set of social engineering concepts that will improve the way in which development teams work. Organizations must complement agility with both a lifecycle and a set of engineering practices that enable organizations to both better manage the collection of agile projects, but also ensure consistency and repeatability within those projects. Software development lifecycles should avoid being overly prescriptive, focusing instead on the essential states that a project must go through and report progress against.&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams- Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects- Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects- Scott Harris, Mike Cohn&lt;br /&gt;
# [http://www.agileproductdesign.com/useful_papers/beyer_rapid_cd.pdf An Agile User-Centered Method: Rapid Contextual Design by Hugh Beyer1, Karen Holtzblatt1, Lisa Baker2]&lt;br /&gt;
# [http://www.innovatetoday.net/white_papers/ProductDev/Agile_in_a_non_agile_world_whitepaper.pdf Being Agile in a Non-Agile World By David West]&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=29802</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=29802"/>
		<updated>2009-11-21T19:44:17Z</updated>

		<summary type="html">&lt;p&gt;Suze: Long introduction separated out into another section for better organizational clarity&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can be complemented by other  design methodologies. Section 1 gives a brief overview of Agile. Section 2 highlights the advantage of agile over traditional models,  like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. Section 3 highlights why it might not be possible to introduce all of the agile practices at the same time. Section 4 takes up a few design methodologies and focuses on how they build on agile and complement it. &lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
To keep pace with ever-increasing customer demands on software functionality and time-to-market expectations, software developers have had to evolve the way they develop code to be both faster and higher quality. As part of this trend, the Waterfall method of software development began to give way in the late 1990s to a more lightweight method of software development: Agile.&lt;br /&gt;
&lt;br /&gt;
Simply put, Agile software development is an approach that provides flexibility to accommodate continuous change&lt;br /&gt;
throughout the software development cycle. It stresses rapid delivery of working software, empowerment of developers, and&lt;br /&gt;
emphasizes collaboration between developers and the rest of the team, including business people.&lt;br /&gt;
&lt;br /&gt;
Agile contrasts with the still-popular Waterfall development approach, which is front-end loaded with comprehensive scope&lt;br /&gt;
and requirements definitions, and which employs clear, consecutive hand-offs from requirements definition to design to coding&lt;br /&gt;
and then to quality assurance. In contrast, Agile incorporates a continuous stream of requirements gathering that continues&lt;br /&gt;
throughout development. Business people are involved early and often throughout the release cycle, ensuring that the software&lt;br /&gt;
being developed meets the true needs of both the end-user and the business. Change to the requirements and to the overall&lt;br /&gt;
feature set is expected to occur as outside opportunities or threats arise.&lt;br /&gt;
&lt;br /&gt;
In short, Agile fully embraces change and Agile teams are structured in such a way that they can receive and act on constant&lt;br /&gt;
feedback provided by the build process, by other developers, from QA, and from business stakeholders.&lt;br /&gt;
&lt;br /&gt;
== Focus of Agile Methodologies ==&lt;br /&gt;
Agile is based upon a number of guiding principles that all Agile teams follow. For the purposes of this discussion, three&lt;br /&gt;
principles – or values – are of particular interest:&lt;br /&gt;
&lt;br /&gt;
* Quality software development&lt;br /&gt;
* Iterative flexibility&lt;br /&gt;
* Continuous improvement&lt;br /&gt;
&lt;br /&gt;
===Quality Software Development===&lt;br /&gt;
The primary focus of Agile development is to enable the development of quality software that satisfies a customer need – i.e.&lt;br /&gt;
provides a functioning feature or capability – within a specific period of time (typically no more than a few weeks) called an&lt;br /&gt;
“iteration”. In theory, a product developed in an Agile environment could be market-ready after each iteration.&lt;br /&gt;
Delivering a series of market-ready products, each in just weeks, demands that a rigorous quality process be built into the Agile&lt;br /&gt;
development cycle. Each iteration must be fully developed: tested, defect-free, and complete with documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Iterative Flexibility===&lt;br /&gt;
With a focus on speed and nimbleness, Agile is open to changes that inevitably arise throughout the development cycle. The&lt;br /&gt;
iterative process is flexible, based on an understanding that original requirements may (or will likely) need to change due to&lt;br /&gt;
customer demand, market conditions, or other reasons. Because business users are involved throughout the process, and&lt;br /&gt;
because each iteration is short, new requirements can be introduced and prioritized very quickly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Continuous Improvement===&lt;br /&gt;
An Agile environment provides developers with an opportunity to learn new skills and to exercise greater autonomy to do&lt;br /&gt;
their jobs. The iterative framework is empowering because it enables continuous improvement, with testing/quality assurance&lt;br /&gt;
occurring as part of the iterative process, rather than only periodically or at the end of a long process when it is often difficult&lt;br /&gt;
or not cost effective to fix coding defects or to incorporate lessons learned along the way. Agile also makes the testing and [http://en.wikipedia.org/wiki/Quality_assurance Quality Assurance] process transparent to the developers who originate the code, further contributing to their learning and facilitating future&lt;br /&gt;
improvements and coding efficiencies.&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
===Advantages of the agile method===&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Challenges in Applying Agile Methodologies== &lt;br /&gt;
 &lt;br /&gt;
* [3] researches about the challenges in applying agile and concludes by introducing a set of new and modified development practices, which will help in developing a large agile project. One of the aspects common to many agile development methodologies is that the entire team (business analysts, developers, and testers) collaborate very heavily. With a large project, this type of collaboration is difficult at best. Teams tend to break up into subteams for better communication. The downside to subteams is the possibility that the subteams build stove-piped  sub-systems if communication is insufficient among the teams. Problems of consistency and duplication may go undiscovered. Of course, there are other practices that help alleviate these problems such as rotating team members among the subteams, having an overall design document, etc. The different subteams may result in a non-homogeneous and inconsistent architecture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Many of the solutions agile methods promote, draw on a limited set of techniques for managing organizations and understanding customers. [7] focuses on incorporating customer-centered techniques such as [http://en.wikipedia.org/wiki/Contextual_design Contextual Design] to provide additional  solutions to the real problems recognized by agile methods. These solutions work in combination with agile methods’ strengths resulting in a process that incorporates the customer voice, provides room for UI and user interaction design, and can address significantly large projects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Complementing agile : extending to newer agile methodologies==&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;b&amp;gt;Separating Design from Engineering: &amp;lt;/b&amp;gt; Much of the distinctiveness (and much of the value) of agile methods comes from the&lt;br /&gt;
clear separation of responsibilities they bring to the development process. Developers write code and design the implementation of systems—that is what they are good at. They are not good at understanding how people work, creating effective and intuitive user interfaces, or making an interface usable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The great strength of agile methods is that they focus the engineers on doing what engineers do best. The weakness of agile methods is that they give little guidance in figuring out what to tell the engineers to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Core Team: &amp;lt;/b&amp;gt; Possible agile solutions would be to start with a core team which builds out a simple business case in a test-driven manner. This first phase will build out enough of most of the architecture. With a small team, a full agile methodology works without modification. When a significant portion of the architecture is built, it is time to divide the project by growing the development team and splitting up into smaller subteams to grow the project into a fully functional software system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Role of an architect:&amp;lt;/b&amp;gt; While there is no traditional architect role in most agile development methodologies, in large teams, it is often beneficial to reintroduce a modified version of this role. The architect is a member of the team with significant  design and development talent and experience and he has to understand the ‘whole’ application code-base. The architect is hands-on and pairs with others on the team frequently and will be a participant in many agile modeling design sessions on the whiteboard. This helps keep away redundancies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Continuous Integration:&amp;lt;/b&amp;gt; While each sub-team will have their own build running, agile methodology suggests having a 'brain' team that will have to create a master build that builds all sub-teams code and/or deploy their binary files. The master build will run frequently by pulling down the last successful builds for sub projects, compile and deploy the whole project and run the tests. In case of failure the brain team has to identify the problem and resolve it or take it to the responsible sub team to resolve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Refactoring:&amp;lt;/b&amp;gt; In large projects Refactoring sometimes becomes very expensive process and may take a month to be done. Some design ahead may be done to save expensive major refactoring later. For the conquer team when it’s still early on the project, to avoid large complicated refactoring some extra time should be spent for designing for future known requirements. Having the overall picture of use cases will make it easier to predict future requirements and create a design that will handle them. This design ahead is allowed only during the conquer phase of the project and will only apply to core systems, frameworks and similar subsystems of the system which may be more expensive to be re-factored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tests:&amp;lt;/b&amp;gt; To reduce the cost of refactoring, the team may depend on functional tests more than unit tests. Functional tests test the functionality of the system and in general do not depend on the system design. Unit tests should still be created for test driven development and for critical pieces of the system that may cause the system to break. Tests that are created after the development and tests created for reported bugs should be functional tests. Having less unit tests will lead to more time spent in debugging issues and functional tests cannot pin point problems but having a better design through constant refactoring will reduce the development time much more than the extra time being spent in debugging issues. Functional test should be documented in each test to describe the test scenario, expected results and differences between test scenarios. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are some of the recommended practices that will help mediate some of the problems in applying agile design methodologies to projects. There are also some difficulties with applying these practices such as with the master build, with communication between teams, with extreme designing to get useless frameworks, and care should be taken to avoid them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scrum is currently one of the most popular agile methods. It is a light-weight project management approach. Scrum as an agile method provides a framework that can be applied to other methods and approaches. Any process needs guidelines to support people actually doing the work. Processes such as the Unified Process spend lots of time describing techniques such as Use Cases, model driven development and architecture centric design. To offset this, scrum lifecycle can help provide a clear set of light weight management techniques that enable the team to effectively work together, deliver work and interact with the business.  This method includes some details on techniques such as pair programming, user stories and testdriven development.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To further understand how Agile methods help complement other design methodologies, consider a case in point: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Agile design methodology working with Contextual Design methodology '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Contextual Design is a user-centered design method that provides techniques covering the entire front end of systems design, from figuring out who your users are and how they work through designing the detailed user interface and functionality of the system.&lt;br /&gt;
&lt;br /&gt;
Agile methods need to be used in tandem with Contextual Design methodology. Contextual Design methodology can help provide a fair idea as to the scope of the system,  decisions regarding whether tasks will be streamlined through the introduction of technology or replaced entirely by automated system, and  how this will affect the overall buisness. These design questions are also known as systems analysis or requirements analysis and aren’t addressed by agile methods, but help complete the picture about the project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Contextual Design methodology provides Contextual Inquiry, work modeling, consolidation and affinity building, and visioning to support a variety of  activities. This helps understand how people work, but does not focus on clear separation of responsibilities of the development process. And the latter is where Agile methods help tremendously. Developers write code and design the implementation of systems and  agile methods help focus the engineers on doing this better.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider the case of a user interface (UI) design, which must be assembled into coherent, transparent screens that support the user’s work in the new system. Regardless of where UI design is situated organizationally, a successful agile development project depends on the skill being available, even if it does not explicitly assign such a role. Because the UI is the interface between the user and the system’s function, the only way to test the system is through the UI. Effective UI design is a prerequisite for agile methods to work, but the methodology provides no separate focus or testing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Contextual Design methodology recognizes and resources UI design as a separate discipline—which fits the agile approach of focusing the developers on developing code. This provides requirements for UI design and the paper mockups permit the UI to be considered and tested on its own, independent of the developer’s underlying implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
In summary, Agile methods provide a strong set of social engineering concepts that will improve the way in which development teams work. Organizations must complement agility with both a lifecycle and a set of engineering practices that enable organizations to both better manage the collection of agile projects, but also ensure consistency and repeatability within those projects. Software development lifecycles should avoid being overly prescriptive, focusing instead on the essential states that a project must go through and report progress against.&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams- Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects- Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects- Scott Harris, Mike Cohn&lt;br /&gt;
# [http://www.agileproductdesign.com/useful_papers/beyer_rapid_cd.pdf An Agile User-Centered Method: Rapid Contextual Design by Hugh Beyer1, Karen Holtzblatt1, Lisa Baker2]&lt;br /&gt;
# [http://www.innovatetoday.net/white_papers/ProductDev/Agile_in_a_non_agile_world_whitepaper.pdf Being Agile in a Non-Agile World By David West]&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=28396</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=28396"/>
		<updated>2009-11-18T16:44:41Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Continuous Improvement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can be complemented by other  design methodologies. Section 1 gives a brief overview of Agile. Section 2 highlights the advantage of agile over traditional models,  like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. Section 3 highlights why it might not be possible to introduce all of the agile practices at the same time. Section 4 takes up a few design methodologies and focuses on how they build on agile and complement it. &lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
To keep pace with ever-increasing customer demands on software functionality and time-to-market expectations, software developers have had to evolve the way they develop code to be both faster and higher quality. As part of this trend, the Waterfall method of software development began to give way in the late 1990s to a more lightweight method of software development: Agile.&lt;br /&gt;
&lt;br /&gt;
Simply put, Agile software development is an approach that provides flexibility to accommodate continuous change&lt;br /&gt;
throughout the software development cycle. It stresses rapid delivery of working software, empowerment of developers, and&lt;br /&gt;
emphasizes collaboration between developers and the rest of the team, including business people.&lt;br /&gt;
&lt;br /&gt;
Agile contrasts with the still-popular Waterfall development approach, which is front-end loaded with comprehensive scope&lt;br /&gt;
and requirements definitions, and which employs clear, consecutive hand-offs from requirements definition to design to coding&lt;br /&gt;
and then to quality assurance. In contrast, Agile incorporates a continuous stream of requirements gathering that continues&lt;br /&gt;
throughout development. Business people are involved early and often throughout the release cycle, ensuring that the software&lt;br /&gt;
being developed meets the true needs of both the end-user and the business. Change to the requirements and to the overall&lt;br /&gt;
feature set is expected to occur as outside opportunities or threats arise.&lt;br /&gt;
&lt;br /&gt;
In short, Agile fully embraces change and Agile teams are structured in such a way that they can receive and act on constant&lt;br /&gt;
feedback provided by the build process, by other developers, from QA, and from business stakeholders.&lt;br /&gt;
Agile is based upon a number of guiding principles that all Agile teams follow. For the purposes of this discussion, three&lt;br /&gt;
principles – or values – are of particular interest:&lt;br /&gt;
&lt;br /&gt;
* Quality software development&lt;br /&gt;
* Iterative flexibility&lt;br /&gt;
* Continuous improvement&lt;br /&gt;
&lt;br /&gt;
===Quality Software Development===&lt;br /&gt;
The primary focus of Agile development is to enable the development of quality software that satisfies a customer need – i.e.&lt;br /&gt;
provides a functioning feature or capability – within a specific period of time (typically no more than a few weeks) called an&lt;br /&gt;
“iteration”. In theory, a product developed in an Agile environment could be market-ready after each iteration.&lt;br /&gt;
Delivering a series of market-ready products, each in just weeks, demands that a rigorous quality process be built into the Agile&lt;br /&gt;
development cycle. Each iteration must be fully developed: tested, defect-free, and complete with documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Iterative Flexibility===&lt;br /&gt;
With a focus on speed and nimbleness, Agile is open to changes that inevitably arise throughout the development cycle. The&lt;br /&gt;
iterative process is flexible, based on an understanding that original requirements may (or will likely) need to change due to&lt;br /&gt;
customer demand, market conditions, or other reasons. Because business users are involved throughout the process, and&lt;br /&gt;
because each iteration is short, new requirements can be introduced and prioritized very quickly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Continuous Improvement===&lt;br /&gt;
An Agile environment provides developers with an opportunity to learn new skills and to exercise greater autonomy to do&lt;br /&gt;
their jobs. The iterative framework is empowering because it enables continuous improvement, with testing/quality assurance&lt;br /&gt;
occurring as part of the iterative process, rather than only periodically or at the end of a long process when it is often difficult&lt;br /&gt;
or not cost effective to fix coding defects or to incorporate lessons learned along the way. Agile also makes the testing and [http://en.wikipedia.org/wiki/Quality_assurance Quality Assurance] process transparent to the developers who originate the code, further contributing to their learning and facilitating future&lt;br /&gt;
improvements and coding efficiencies.&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
===Advantages of the agile method===&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Challenges in Applying Agile Methodologies== &lt;br /&gt;
 &lt;br /&gt;
* [3] researches about the challenges in applying agile and concludes by introducing a set of new and modified development practices, which will help in developing a large agile project. One of the aspects common to many agile development methodologies is that the entire team (business analysts, developers, and testers) collaborate very heavily. With a large project, this type of collaboration is difficult at best. Teams tend to break up into subteams for better communication. The downside to subteams is the possibility that the subteams build stove-piped  sub-systems if communication is insufficient among the teams. Problems of consistency and duplication may go undiscovered. Of course, there are other practices that help alleviate these problems such as rotating team members among the subteams, having an overall design document, etc. The different subteams may result in a non-homogeneous and inconsistent architecture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Many of the solutions agile methods promote, draw on a limited set of techniques for managing organizations and understanding customers. [7] focuses on incorporating customer-centered techniques such as [http://en.wikipedia.org/wiki/Contextual_design Contextual Design] to provide additional  solutions to the real problems recognized by agile methods. These solutions work in combination with agile methods’ strengths resulting in a process that incorporates the customer voice, provides room for UI and user interaction design, and can address significantly large projects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Complementing agile : extending to newer agile methodologies==&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;b&amp;gt;Separating Design from Engineering: &amp;lt;/b&amp;gt; Much of the distinctiveness (and much of the value) of agile methods comes from the&lt;br /&gt;
clear separation of responsibilities they bring to the development process. Developers&lt;br /&gt;
write code and design the implementation of systems—that is what they are good at.&lt;br /&gt;
They are not good at understanding how people work, creating effective and intuitive&lt;br /&gt;
user interfaces, or making an interface usable.&lt;br /&gt;
&lt;br /&gt;
The great strength of agile methods is that they focus the engineers on doing what&lt;br /&gt;
engineers do best. The weakness of agile methods is that they give little guidance in&lt;br /&gt;
figuring out what to tell the engineers to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Core Team: &amp;lt;/b&amp;gt; Possible agile solutions would be to start with a core team which builds out a simple business case in a test-driven manner. This first phase will build out enough of most of the architecture. With a small team, a full agile methodology works without modification. When a significant portion of the architecture is built, it is time to divide the project by growing the development team and splitting up into smaller subteams to grow the project into a fully functional software system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Role of an architect:&amp;lt;/b&amp;gt; While there is no traditional architect role in most agile development methodologies, in large teams, it is often beneficial to reintroduce a modified version of this role. The architect is a member of the team with significant  design and development talent and experience and he has to understand the ‘whole’ application code-base. The architect is hands-on and pairs with others on the team frequently and will be a participant in many agile modeling design sessions on the whiteboard. This helps keep away redundancies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Continuous Integration:&amp;lt;/b&amp;gt; While each sub-team will have their own build running, agile methodology suggests having a 'brain' team that will have to create a master build that builds all sub-teams code and/or deploy their binary files. The master build will run frequently by pulling down the last successful builds for sub projects, compile and deploy the whole project and run the tests. In case of failure the brain team has to identify the problem and resolve it or take it to the responsible sub team to resolve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Refactoring:&amp;lt;/b&amp;gt; In large projects Refactoring sometimes becomes very expensive process and may take a month to be done. Some design ahead may be done to save expensive major refactoring later. For the conquer team when it’s still early on the project, to avoid large complicated refactoring some extra time should be spent for designing for future known requirements. Having the overall picture of use cases will make it easier to predict future requirements and create a design that will handle them. This design ahead is allowed only during the conquer phase of the project and will only apply to core systems, frameworks and similar subsystems of the system which may be more expensive to be re-factored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tests:&amp;lt;/b&amp;gt; To reduce the cost of refactoring, the team may depend on functional tests more than unit tests. Functional tests test the functionality of the system and in general do not depend on the system design. Unit tests should still be created for test driven development and for critical pieces of the system that may cause the system to break. Tests that are created after the development and tests created for reported bugs should be functional tests. Having less unit tests will lead to more time spent in debugging issues and functional tests cannot pin point problems but having a better design through constant refactoring will reduce the development time much more than the extra time being spent in debugging issues. Functional test should be documented in each test to describe the test scenario, expected results and differences between test scenarios. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are some of the recommended practices that will help mediate some of the problems in applying agile design methodologies to projects. There are also some difficulties with applying these practices such as with the master build, with communication between teams, with extreme designing to get useless frameworks, and care should be taken to avoid them.&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams- Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects- Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects- Scott Harris, Mike Cohn&lt;br /&gt;
# An Agile User-Centered Method: Rapid Contextual Design- Hugh Beyer, Karen Holtzblatt, Lisa Baker&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=28393</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=28393"/>
		<updated>2009-11-18T16:42:16Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Study of a few Design methodologies and How Agile Complements Them */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can be complemented by other  design methodologies. Section 1 gives a brief overview of Agile. Section 2 highlights the advantage of agile over traditional models,  like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. Section 3 highlights why it might not be possible to introduce all of the agile practices at the same time. Section 4 takes up a few design methodologies and focuses on how they build on agile and complement it. &lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
To keep pace with ever-increasing customer demands on software functionality and time-to-market expectations, software developers have had to evolve the way they develop code to be both faster and higher quality. As part of this trend, the Waterfall method of software development began to give way in the late 1990s to a more lightweight method of software development: Agile.&lt;br /&gt;
&lt;br /&gt;
Simply put, Agile software development is an approach that provides flexibility to accommodate continuous change&lt;br /&gt;
throughout the software development cycle. It stresses rapid delivery of working software, empowerment of developers, and&lt;br /&gt;
emphasizes collaboration between developers and the rest of the team, including business people.&lt;br /&gt;
&lt;br /&gt;
Agile contrasts with the still-popular Waterfall development approach, which is front-end loaded with comprehensive scope&lt;br /&gt;
and requirements definitions, and which employs clear, consecutive hand-offs from requirements definition to design to coding&lt;br /&gt;
and then to quality assurance. In contrast, Agile incorporates a continuous stream of requirements gathering that continues&lt;br /&gt;
throughout development. Business people are involved early and often throughout the release cycle, ensuring that the software&lt;br /&gt;
being developed meets the true needs of both the end-user and the business. Change to the requirements and to the overall&lt;br /&gt;
feature set is expected to occur as outside opportunities or threats arise.&lt;br /&gt;
&lt;br /&gt;
In short, Agile fully embraces change and Agile teams are structured in such a way that they can receive and act on constant&lt;br /&gt;
feedback provided by the build process, by other developers, from QA, and from business stakeholders.&lt;br /&gt;
Agile is based upon a number of guiding principles that all Agile teams follow. For the purposes of this discussion, three&lt;br /&gt;
principles – or values – are of particular interest:&lt;br /&gt;
&lt;br /&gt;
* Quality software development&lt;br /&gt;
* Iterative flexibility&lt;br /&gt;
* Continuous improvement&lt;br /&gt;
&lt;br /&gt;
===Quality Software Development===&lt;br /&gt;
The primary focus of Agile development is to enable the development of quality software that satisfies a customer need – i.e.&lt;br /&gt;
provides a functioning feature or capability – within a specific period of time (typically no more than a few weeks) called an&lt;br /&gt;
“iteration”. In theory, a product developed in an Agile environment could be market-ready after each iteration.&lt;br /&gt;
Delivering a series of market-ready products, each in just weeks, demands that a rigorous quality process be built into the Agile&lt;br /&gt;
development cycle. Each iteration must be fully developed: tested, defect-free, and complete with documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Iterative Flexibility===&lt;br /&gt;
With a focus on speed and nimbleness, Agile is open to changes that inevitably arise throughout the development cycle. The&lt;br /&gt;
iterative process is flexible, based on an understanding that original requirements may (or will likely) need to change due to&lt;br /&gt;
customer demand, market conditions, or other reasons. Because business users are involved throughout the process, and&lt;br /&gt;
because each iteration is short, new requirements can be introduced and prioritized very quickly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Continuous Improvement===&lt;br /&gt;
An Agile environment provides developers with an opportunity to learn new skills and to exercise greater autonomy to do&lt;br /&gt;
their jobs. The iterative framework is empowering because it enables continuous improvement, with testing/quality assurance&lt;br /&gt;
occurring as part of the iterative process, rather than only periodically or at the end of a long process when it is often difficult&lt;br /&gt;
or not cost effective to fix coding defects or to incorporate lessons learned along the way. Agile also makes the testing and&lt;br /&gt;
 [http://en.wikipedia.org/wiki/Quality_assurance Quality Assurance] process transparent to the developers who originate the code, further contributing to their learning and facilitating future&lt;br /&gt;
improvements and coding efficiencies.&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
===Advantages of the agile method===&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Challenges in Applying Agile Methodologies== &lt;br /&gt;
 &lt;br /&gt;
* [3] researches about the challenges in applying agile and concludes by introducing a set of new and modified development practices, which will help in developing a large agile project. One of the aspects common to many agile development methodologies is that the entire team (business analysts, developers, and testers) collaborate very heavily. With a large project, this type of collaboration is difficult at best. Teams tend to break up into subteams for better communication. The downside to subteams is the possibility that the subteams build stove-piped  sub-systems if communication is insufficient among the teams. Problems of consistency and duplication may go undiscovered. Of course, there are other practices that help alleviate these problems such as rotating team members among the subteams, having an overall design document, etc. The different subteams may result in a non-homogeneous and inconsistent architecture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Many of the solutions agile methods promote, draw on a limited set of techniques for managing organizations and understanding customers. [7] focuses on incorporating customer-centered techniques such as [http://en.wikipedia.org/wiki/Contextual_design Contextual Design] to provide additional  solutions to the real problems recognized by agile methods. These solutions work in combination with agile methods’ strengths resulting in a process that incorporates the customer voice, provides room for UI and user interaction design, and can address significantly large projects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Complementing agile : extending to newer agile methodologies==&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;b&amp;gt;Separating Design from Engineering: &amp;lt;/b&amp;gt; Much of the distinctiveness (and much of the value) of agile methods comes from the&lt;br /&gt;
clear separation of responsibilities they bring to the development process. Developers&lt;br /&gt;
write code and design the implementation of systems—that is what they are good at.&lt;br /&gt;
They are not good at understanding how people work, creating effective and intuitive&lt;br /&gt;
user interfaces, or making an interface usable.&lt;br /&gt;
&lt;br /&gt;
The great strength of agile methods is that they focus the engineers on doing what&lt;br /&gt;
engineers do best. The weakness of agile methods is that they give little guidance in&lt;br /&gt;
figuring out what to tell the engineers to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Core Team: &amp;lt;/b&amp;gt; Possible agile solutions would be to start with a core team which builds out a simple business case in a test-driven manner. This first phase will build out enough of most of the architecture. With a small team, a full agile methodology works without modification. When a significant portion of the architecture is built, it is time to divide the project by growing the development team and splitting up into smaller subteams to grow the project into a fully functional software system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Role of an architect:&amp;lt;/b&amp;gt; While there is no traditional architect role in most agile development methodologies, in large teams, it is often beneficial to reintroduce a modified version of this role. The architect is a member of the team with significant  design and development talent and experience and he has to understand the ‘whole’ application code-base. The architect is hands-on and pairs with others on the team frequently and will be a participant in many agile modeling design sessions on the whiteboard. This helps keep away redundancies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Continuous Integration:&amp;lt;/b&amp;gt; While each sub-team will have their own build running, agile methodology suggests having a 'brain' team that will have to create a master build that builds all sub-teams code and/or deploy their binary files. The master build will run frequently by pulling down the last successful builds for sub projects, compile and deploy the whole project and run the tests. In case of failure the brain team has to identify the problem and resolve it or take it to the responsible sub team to resolve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Refactoring:&amp;lt;/b&amp;gt; In large projects Refactoring sometimes becomes very expensive process and may take a month to be done. Some design ahead may be done to save expensive major refactoring later. For the conquer team when it’s still early on the project, to avoid large complicated refactoring some extra time should be spent for designing for future known requirements. Having the overall picture of use cases will make it easier to predict future requirements and create a design that will handle them. This design ahead is allowed only during the conquer phase of the project and will only apply to core systems, frameworks and similar subsystems of the system which may be more expensive to be re-factored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tests:&amp;lt;/b&amp;gt; To reduce the cost of refactoring, the team may depend on functional tests more than unit tests. Functional tests test the functionality of the system and in general do not depend on the system design. Unit tests should still be created for test driven development and for critical pieces of the system that may cause the system to break. Tests that are created after the development and tests created for reported bugs should be functional tests. Having less unit tests will lead to more time spent in debugging issues and functional tests cannot pin point problems but having a better design through constant refactoring will reduce the development time much more than the extra time being spent in debugging issues. Functional test should be documented in each test to describe the test scenario, expected results and differences between test scenarios. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are some of the recommended practices that will help mediate some of the problems in applying agile design methodologies to projects. There are also some difficulties with applying these practices such as with the master build, with communication between teams, with extreme designing to get useless frameworks, and care should be taken to avoid them.&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams- Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects- Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects- Scott Harris, Mike Cohn&lt;br /&gt;
# An Agile User-Centered Method: Rapid Contextual Design- Hugh Beyer, Karen Holtzblatt, Lisa Baker&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=28392</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=28392"/>
		<updated>2009-11-18T16:41:00Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can be complemented by other  design methodologies. Section 1 gives a brief overview of Agile. Section 2 highlights the advantage of agile over traditional models,  like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. Section 3 highlights why it might not be possible to introduce all of the agile practices at the same time. Section 4 takes up a few design methodologies and focuses on how they build on agile and complement it. &lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
To keep pace with ever-increasing customer demands on software functionality and time-to-market expectations, software developers have had to evolve the way they develop code to be both faster and higher quality. As part of this trend, the Waterfall method of software development began to give way in the late 1990s to a more lightweight method of software development: Agile.&lt;br /&gt;
&lt;br /&gt;
Simply put, Agile software development is an approach that provides flexibility to accommodate continuous change&lt;br /&gt;
throughout the software development cycle. It stresses rapid delivery of working software, empowerment of developers, and&lt;br /&gt;
emphasizes collaboration between developers and the rest of the team, including business people.&lt;br /&gt;
&lt;br /&gt;
Agile contrasts with the still-popular Waterfall development approach, which is front-end loaded with comprehensive scope&lt;br /&gt;
and requirements definitions, and which employs clear, consecutive hand-offs from requirements definition to design to coding&lt;br /&gt;
and then to quality assurance. In contrast, Agile incorporates a continuous stream of requirements gathering that continues&lt;br /&gt;
throughout development. Business people are involved early and often throughout the release cycle, ensuring that the software&lt;br /&gt;
being developed meets the true needs of both the end-user and the business. Change to the requirements and to the overall&lt;br /&gt;
feature set is expected to occur as outside opportunities or threats arise.&lt;br /&gt;
&lt;br /&gt;
In short, Agile fully embraces change and Agile teams are structured in such a way that they can receive and act on constant&lt;br /&gt;
feedback provided by the build process, by other developers, from QA, and from business stakeholders.&lt;br /&gt;
Agile is based upon a number of guiding principles that all Agile teams follow. For the purposes of this discussion, three&lt;br /&gt;
principles – or values – are of particular interest:&lt;br /&gt;
&lt;br /&gt;
* Quality software development&lt;br /&gt;
* Iterative flexibility&lt;br /&gt;
* Continuous improvement&lt;br /&gt;
&lt;br /&gt;
===Quality Software Development===&lt;br /&gt;
The primary focus of Agile development is to enable the development of quality software that satisfies a customer need – i.e.&lt;br /&gt;
provides a functioning feature or capability – within a specific period of time (typically no more than a few weeks) called an&lt;br /&gt;
“iteration”. In theory, a product developed in an Agile environment could be market-ready after each iteration.&lt;br /&gt;
Delivering a series of market-ready products, each in just weeks, demands that a rigorous quality process be built into the Agile&lt;br /&gt;
development cycle. Each iteration must be fully developed: tested, defect-free, and complete with documentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Iterative Flexibility===&lt;br /&gt;
With a focus on speed and nimbleness, Agile is open to changes that inevitably arise throughout the development cycle. The&lt;br /&gt;
iterative process is flexible, based on an understanding that original requirements may (or will likely) need to change due to&lt;br /&gt;
customer demand, market conditions, or other reasons. Because business users are involved throughout the process, and&lt;br /&gt;
because each iteration is short, new requirements can be introduced and prioritized very quickly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Continuous Improvement===&lt;br /&gt;
An Agile environment provides developers with an opportunity to learn new skills and to exercise greater autonomy to do&lt;br /&gt;
their jobs. The iterative framework is empowering because it enables continuous improvement, with testing/quality assurance&lt;br /&gt;
occurring as part of the iterative process, rather than only periodically or at the end of a long process when it is often difficult&lt;br /&gt;
or not cost effective to fix coding defects or to incorporate lessons learned along the way. Agile also makes the testing and&lt;br /&gt;
 [http://en.wikipedia.org/wiki/Quality_assurance Quality Assurance] process transparent to the developers who originate the code, further contributing to their learning and facilitating future&lt;br /&gt;
improvements and coding efficiencies.&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
===Advantages of the agile method===&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Challenges in Applying Agile Methodologies== &lt;br /&gt;
 &lt;br /&gt;
* [3] researches about the challenges in applying agile and concludes by introducing a set of new and modified development practices, which will help in developing a large agile project. One of the aspects common to many agile development methodologies is that the entire team (business analysts, developers, and testers) collaborate very heavily. With a large project, this type of collaboration is difficult at best. Teams tend to break up into subteams for better communication. The downside to subteams is the possibility that the subteams build stove-piped  sub-systems if communication is insufficient among the teams. Problems of consistency and duplication may go undiscovered. Of course, there are other practices that help alleviate these problems such as rotating team members among the subteams, having an overall design document, etc. The different subteams may result in a non-homogeneous and inconsistent architecture.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Many of the solutions agile methods promote, draw on a limited set of techniques for managing organizations and understanding customers. [7] focuses on incorporating customer-centered techniques such as [http://en.wikipedia.org/wiki/Contextual_design Contextual Design] to provide additional  solutions to the real problems recognized by agile methods. These solutions work in combination with agile methods’ strengths resulting in a process that incorporates the customer voice, provides room for UI and user interaction design, and can address significantly large projects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Study of a few Design methodologies and How Agile Complements Them==&lt;br /&gt;
&lt;br /&gt;
        &lt;br /&gt;
&amp;lt;b&amp;gt;Separating Design from Engineering: &amp;lt;/b&amp;gt; Much of the distinctiveness (and much of the value) of agile methods comes from the&lt;br /&gt;
clear separation of responsibilities they bring to the development process. Developers&lt;br /&gt;
write code and design the implementation of systems—that is what they are good at.&lt;br /&gt;
They are not good at understanding how people work, creating effective and intuitive&lt;br /&gt;
user interfaces, or making an interface usable.&lt;br /&gt;
&lt;br /&gt;
The great strength of agile methods is that they focus the engineers on doing what&lt;br /&gt;
engineers do best. The weakness of agile methods is that they give little guidance in&lt;br /&gt;
figuring out what to tell the engineers to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Core Team: &amp;lt;/b&amp;gt; Possible agile solutions would be to start with a core team which builds out a simple business case in a test-driven manner. This first phase will build out enough of most of the architecture. With a small team, a full agile methodology works without modification. When a significant portion of the architecture is built, it is time to divide the project by growing the development team and splitting up into smaller subteams to grow the project into a fully functional software system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Role of an architect:&amp;lt;/b&amp;gt; While there is no traditional architect role in most agile development methodologies, in large teams, it is often beneficial to reintroduce a modified version of this role. The architect is a member of the team with significant  design and development talent and experience and he has to understand the ‘whole’ application code-base. The architect is hands-on and pairs with others on the team frequently and will be a participant in many agile modeling design sessions on the whiteboard. This helps keep away redundancies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Continuous Integration:&amp;lt;/b&amp;gt; While each sub-team will have their own build running, agile methodology suggests having a 'brain' team that will have to create a master build that builds all sub-teams code and/or deploy their binary files. The master build will run frequently by pulling down the last successful builds for sub projects, compile and deploy the whole project and run the tests. In case of failure the brain team has to identify the problem and resolve it or take it to the responsible sub team to resolve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Refactoring:&amp;lt;/b&amp;gt; In large projects Refactoring sometimes becomes very expensive process and may take a month to be done. Some design ahead may be done to save expensive major refactoring later. For the conquer team when it’s still early on the project, to avoid large complicated refactoring some extra time should be spent for designing for future known requirements. Having the overall picture of use cases will make it easier to predict future requirements and create a design that will handle them. This design ahead is allowed only during the conquer phase of the project and will only apply to core systems, frameworks and similar subsystems of the system which may be more expensive to be re-factored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tests:&amp;lt;/b&amp;gt; To reduce the cost of refactoring, the team may depend on functional tests more than unit tests. Functional tests test the functionality of the system and in general do not depend on the system design. Unit tests should still be created for test driven development and for critical pieces of the system that may cause the system to break. Tests that are created after the development and tests created for reported bugs should be functional tests. Having less unit tests will lead to more time spent in debugging issues and functional tests cannot pin point problems but having a better design through constant refactoring will reduce the development time much more than the extra time being spent in debugging issues. Functional test should be documented in each test to describe the test scenario, expected results and differences between test scenarios. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are some of the recommended practices that will help mediate some of the problems in applying agile design methodologies to projects. There are also some difficulties with applying these practices such as with the master build, with communication between teams, with extreme designing to get useless frameworks, and care should be taken to avoid them.&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams- Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects- Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects- Scott Harris, Mike Cohn&lt;br /&gt;
# An Agile User-Centered Method: Rapid Contextual Design- Hugh Beyer, Karen Holtzblatt, Lisa Baker&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26513</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26513"/>
		<updated>2009-11-10T04:04:21Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other  design methodologies. Section 1 highlights the advantage of agile over traditional models,  like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. Section 2 highlights why it might not be possible to introduce all of the agile practices at the same time. Section 3 takes up a few design methodologies and focuses on how agile complements them. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
===Advantages of the agile method===&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
==Challenges in Applying Agile Methodologies== &lt;br /&gt;
 &lt;br /&gt;
* [3] researches about the challenges in applying agile and concludes by introducing a set of new and modified development practices, which will help in developing a large agile project. One of the aspects common to many agile development methodologies is that the entire team (business analysts, developers, and testers) collaborate very heavily. With a large project, this type of collaboration is difficult at best. Teams tend to break up into subteams for better communication. The downside to subteams is the possibility that the subteams build stove-piped  sub-systems if communication is insufficient among the teams. Problems of consistency and duplication may go undiscovered. Of course, there are other practices that help alleviate these problems such as rotating team members among the subteams, having an overall design document, etc. The different subteams may result in a non-homogeneous and inconsistent architecture.&lt;br /&gt;
&lt;br /&gt;
* Many of the solutions agile methods promote, draw on a limited set of techniques for managing organizations and understanding customers. [7] focuses on incorporating customer-centered techniques such as [http://en.wikipedia.org/wiki/Contextual_design Contextual Design] to provide additional  solutions to the real problems recognized by agile methods. These solutions work in combination with agile methods’ strengths resulting in a process that incorporates the customer voice, provides room for UI and user interaction design, and can address significantly large projects.&lt;br /&gt;
&lt;br /&gt;
== Study of a few Design methodologies and How Agile Complements Them==&lt;br /&gt;
&lt;br /&gt;
===Separating Design from Engineering ===&lt;br /&gt;
         &lt;br /&gt;
Much of the distinctiveness (and much of the value) of agile methods comes from the&lt;br /&gt;
clear separation of responsibilities they bring to the development process. Developers&lt;br /&gt;
write code and design the implementation of systems—that is what they are good at.&lt;br /&gt;
They are not good at understanding how people work, creating effective and intuitive&lt;br /&gt;
user interfaces, or making an interface usable.&lt;br /&gt;
&lt;br /&gt;
The great strength of agile methods is that they focus the engineers on doing what&lt;br /&gt;
engineers do best. The weakness of agile methods is that they give little guidance in&lt;br /&gt;
figuring out what to tell the engineers to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams- Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects- Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects- Scott Harris, Mike Cohn&lt;br /&gt;
# An Agile User-Centered Method: Rapid Contextual Design- Hugh Beyer, Karen Holtzblatt, Lisa Baker&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26512</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26512"/>
		<updated>2009-11-10T03:56:02Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other  design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. Section 1 highlights the advantage of agile over traditional models, section 2 highlights why it might not be possible to introduce all of the agile practices at the same time. Section 3 takes up a few design methodologies and focuses on how agile complements it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
===Advantages of the agile method===&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
==Challenges in Applying Agile Methodologies== &lt;br /&gt;
 &lt;br /&gt;
* [3] researches about the challenges in applying agile and concludes by introducing a set of new and modified development practices, which will help in developing a large agile project. One of the aspects common to many agile development methodologies is that the entire team (business analysts, developers, and testers) collaborate very heavily. With a large project, this type of collaboration is difficult at best. Teams tend to break up into subteams for better communication. The downside to subteams is the possibility that the subteams build stove-piped  sub-systems if communication is insufficient among the teams. Problems of consistency and duplication may go undiscovered. Of course, there are other practices that help alleviate these problems such as rotating team members among the subteams, having an overall design document, etc. The different subteams may result in a non-homogeneous and inconsistent architecture.&lt;br /&gt;
&lt;br /&gt;
* Many of the solutions agile methods promote, draw on a limited set of techniques for managing organizations and understanding customers. [7] focuses on incorporating customer-centered techniques such as [http://en.wikipedia.org/wiki/Contextual_design Contextual Design] to provide additional  solutions to the real problems recognized by agile methods. These solutions work in combination with agile methods’ strengths resulting in a process that incorporates the customer voice, provides room for UI and user interaction design, and can address significantly large projects.&lt;br /&gt;
&lt;br /&gt;
== Study of a few Design methodologies and How Agile Complements Them==&lt;br /&gt;
&lt;br /&gt;
===Separating Design from Engineering ===&lt;br /&gt;
         &lt;br /&gt;
Much of the distinctiveness (and much of the value) of agile methods comes from the&lt;br /&gt;
clear separation of responsibilities they bring to the development process. Developers&lt;br /&gt;
write code and design the implementation of systems—that is what they are good at.&lt;br /&gt;
They are not good at understanding how people work, creating effective and intuitive&lt;br /&gt;
user interfaces, or making an interface usable.&lt;br /&gt;
   The great strength of agile methods is that they focus the engineers on doing what&lt;br /&gt;
engineers do best. The weakness of agile methods is that they give little guidance in&lt;br /&gt;
figuring out what to tell the engineers to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams- Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects- Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects- Scott Harris, Mike Cohn&lt;br /&gt;
# An Agile User-Centered Method: Rapid Contextual Design- Hugh Beyer, Karen Holtzblatt, Lisa Baker&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26511</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26511"/>
		<updated>2009-11-10T03:27:14Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Challenges in Applying Agile Methodologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
===Advantages of the agile method===&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
==Challenges in Applying Agile Methodologies== &lt;br /&gt;
 &lt;br /&gt;
* [3] researches about the challenges in applying agile and concludes by introducing a set of new and modified development practices, which will help in developing a large agile project. One of the aspects common to many agile development methodologies is that the entire team (business analysts, developers, and testers) collaborate very heavily. With a large project, this type of collaboration is difficult at best. Teams tend to break up into subteams for better communication. The downside to subteams is the possibility that the subteams build stove-piped  sub-systems if communication is insufficient among the teams. Problems of consistency and duplication may go undiscovered. Of course, there are other practices that help alleviate these problems such as rotating team members among the subteams, having an overall design document, etc. The different subteams may result in a non-homogeneous and inconsistent architecture.&lt;br /&gt;
&lt;br /&gt;
* Many of the solutions agile methods promote, draw on a limited set of techniques for managing organizations and understanding customers. [7] focuses on incorporating customer-centered techniques such as [http://en.wikipedia.org/wiki/Contextual_design Contextual Design] to provide additional  solutions to the real problems recognized by agile methods. These solutions work in combination with agile methods’ strengths resulting in a process that incorporates the customer voice, provides room for UI and user interaction design, and can address significantly large projects.&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams- Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects- Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects- Scott Harris, Mike Cohn&lt;br /&gt;
# An Agile User-Centered Method: Rapid Contextual Design- Hugh Beyer, Karen Holtzblatt, Lisa Baker&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26510</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26510"/>
		<updated>2009-11-10T03:23:49Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
===Advantages of the agile method===&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
==Challenges in Applying Agile Methodologies== &lt;br /&gt;
[3] researches about the challenges in applying agile and concludes by introducing a set of new and modified development practices, which will help in developing a large agile project. We will summarise them later in this wiki.&lt;br /&gt;
&lt;br /&gt;
* One of the aspects common to many agile development methodologies is that the entire team (business analysts, developers, and testers) collaborate very heavily. With&lt;br /&gt;
a large project, this type of collaboration is difficult at best. Teams tend to break up into subteams for better communication.&lt;br /&gt;
The downside to subteams is the possibility that the subteams build stove-piped  sub-&lt;br /&gt;
systems if communication is insufficient among the teams. Problems of consistency&lt;br /&gt;
and duplication may go undiscovered. Of course, there are other practices that help&lt;br /&gt;
alleviate these problems such as rotating team members among the subteams, having&lt;br /&gt;
an overall design document, etc. The different subteams may result in a non-homogeneous and inconsistent&lt;br /&gt;
architecture.&lt;br /&gt;
&lt;br /&gt;
* Many of the solutions agile methods promote, draw on a limited set of techniques for managing organizations and understanding customers. [7] focuses on incorporating customer-centered techniques such as [http://en.wikipedia.org/wiki/Contextual_design Contextual Design] to provide additional solutions to the real problems recognized by agile methods. These solutions work in combination with agile methods’ strengths resulting in a process&lt;br /&gt;
that incorporates the customer voice, provides room for UI and user interaction&lt;br /&gt;
design, and can address significantly large projects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams- Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects- Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects- Scott Harris, Mike Cohn&lt;br /&gt;
# An Agile User-Centered Method: Rapid Contextual Design- Hugh Beyer, Karen Holtzblatt, Lisa Baker&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26509</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26509"/>
		<updated>2009-11-10T02:43:37Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
Some of the advantages of the agile method are explained below:&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
# [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
# [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
# Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
# Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams, Grigori Melnik, Frank Maurer&lt;br /&gt;
# Rolling the DICE for agile software projects, Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
# Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects, Scott Harris, Mike Cohn&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26508</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26508"/>
		<updated>2009-11-10T02:36:18Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
Some of the advantages of the agile method are explained below:&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
1. [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
2. [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
3. Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
4. Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams, Grigori Melnik, Frank Maurer&lt;br /&gt;
5. Rolling the DICE for agile software projects, Bartlomiej Ziolkowski, Geoffrey Drake&lt;br /&gt;
6. Incorporating Learning and Expected Cost of Change in Prioritizing Features on Agile Projects, Scott Harris, Mike Cohn&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26507</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26507"/>
		<updated>2009-11-10T02:25:49Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
Some of the advantages of the agile method are explained below:&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
1. [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
2. [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
3. Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
4. Research Paper:  Comparative Analysis of Job Satisfaction in Agile and Non-Agile Software Development Teams, Grigori Melnik, Frank Maurer&lt;br /&gt;
5. Rolling the DICE for agile software projects, Bartlomiej Ziolkowski, Geoffrey Drake&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26506</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26506"/>
		<updated>2009-11-10T02:20:21Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
Some of the advantages of the agile method are explained below:&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
* [http://virtual.vtt.fi/virtual/xp2006/ XP 2006 Website]&lt;br /&gt;
* [http://www.agile200x.org/ Agile Development Conference]&lt;br /&gt;
* Experience Paper: Applying Agile to Large Projects: New Agile Software Development Practices for Large Projects- Ahmed Elshamy and Amr Elssamadisy&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26504</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26504"/>
		<updated>2009-11-10T01:51:31Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
Some of the advantages of the agile method are explained below:&lt;br /&gt;
&lt;br /&gt;
* Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
* Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
* Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
* Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
* However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26503</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26503"/>
		<updated>2009-11-10T01:50:51Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;br /&gt;
&lt;br /&gt;
Some of the advantages of the agile method are explained below:&lt;br /&gt;
1. Once a stage is completed in the Waterfall method, there is no going back, since most software designed and implemented under the waterfall method is hard to change according to time and user needs.  The problem can only be fixed by going back and designing an entirely new system, a very costly and inefficient method. Whereas, Agile methods adapt to change, as at the end of each stage, the logical programme, designed to cope and adapt to new ideas from the outset, allows changes to be made easily.  With Agile, changes can be made if necessary without getting the entire programme rewritten.  This approach not only reduces overheads, it also helps in the upgrading of programmes.&lt;br /&gt;
   &lt;br /&gt;
2. Another Agile method advantage is one has a launchable product at the end of each tested stage.  This ensures bugs are caught and eliminated in the development cycle, and the product is double tested again after the first bug elimination.  This is not possible for the Waterfall method, since the product is tested only at the very end, which means any bugs found results in the entire programme having to be re-written.&lt;br /&gt;
  &lt;br /&gt;
3. Agile’s modular nature means employing better suited object-oriented designs and programmes, which means one always has a working model for timely release even when it does not always entirely match customer specifications.  Whereas, there is only one main release in the waterfall method and any problems or delays mean highly dissatisfied customers.&lt;br /&gt;
   &lt;br /&gt;
4. Agile methods allow for specification changes as per end-user’s requirements, spelling customer satisfaction.  As already mentioned, this is not possible when the waterfall method is employed, since any changes to be made means the project has to be started all over again.&lt;br /&gt;
  &lt;br /&gt;
5. However, both methods do allow for a sort of departmentalization e.g. in waterfall departmentalization is done at each stage.  As for Agile, each coding module can be delegated to separate groups.  This allows for several parts of the project to be done at the same time, though departmentalization is more effectively used in Agile methodologies.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26499</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26499"/>
		<updated>2009-11-10T00:54:43Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
&lt;br /&gt;
The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
*''' Individuals and interactions''' over processes and tools&lt;br /&gt;
*'''Working software''' over comprehensive documentation&lt;br /&gt;
* '''Customer collaboration''' over contract negotiation&lt;br /&gt;
* '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, agile values the items on the left more. The items on the right are what the traditional design methodologies emphasise on.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26498</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26498"/>
		<updated>2009-11-10T00:52:16Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Agile vs Traditional Methodologies ==&lt;br /&gt;
 The agile manifesto focuses on &lt;br /&gt;
&lt;br /&gt;
    *''' Individuals and interactions''' over processes and tools&lt;br /&gt;
    * '''Working software''' over comprehensive documentation&lt;br /&gt;
    * '''Customer collaboration''' over contract negotiation&lt;br /&gt;
    * '''Responding to change''' over following a plan&lt;br /&gt;
&lt;br /&gt;
That is, while there is value in the items on the right, we value the items on the left more. The items on the right are what the traditional design methodologies empahasise on.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26497</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26497"/>
		<updated>2009-11-10T00:43:18Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wikipedia article focuses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] software development methodology can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations. A lot of the agile methodologies are conflicting each other and hence cannot be all applied at the same time.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26496</id>
		<title>CSC/ECE 517 Fall 2009/wiki3 7 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki3_7_f1&amp;diff=26496"/>
		<updated>2009-11-10T00:39:47Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki article focusses on how  [http://en.wikipedia.org/wiki/Agile_software_development Agile] can complement other traditional design methodologies like the [http://en.wikipedia.org/wiki/Waterfall_model waterfall model]. &lt;br /&gt;
We take a few software development practices from the customer, management and development points of view, focus on the limitations of the traditional software development model and discuss how agile development methodologies can be used to complement/overcome its limitations.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_f1&amp;diff=25833</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_f1&amp;diff=25833"/>
		<updated>2009-10-14T00:52:16Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Service Oriented Architecture provides another view of providing functionality based upon services offered in terms of protocols and a specific API. To provide services, platforms rely upon principles and the power that can be expressed through reflection and meta programming. Research and report how these critical concepts relate to and support SOA.'''&lt;br /&gt;
&lt;br /&gt;
== Service Oriented Architectures==&lt;br /&gt;
Service Oriented Architecture is not a new thing, but has been there since around 1991 by virtue of the [http://www.omg.org/gettingstarted/history_of_corba.htm CORBA specifications]. The earliest SOA architectures were, DCOM and CORBA [http://www.service-architecture.com/web-services/articles/prior_service-oriented_architecture_specifications.html 1]. [http://en.wikipedia.org/wiki/Service_Oriented_Architectures Service Oriented Architecture] (SOA) is a paradigm for organizing and utilizing distributed capabilities that may be under the control of different ownership domains. SOA provides a uniform means to offer, discover, interact with and use capabilities to produce desired effects consistent with measurable preconditions and expectations. It is a collection of services. These services communicate with each other either by simple data passing or it could involve two or more services coordinating some activity by means of some predefined standard connecting services.  This makes it easier for software integration of different modules developed by different people. Rather than defining an [http://en.wikipedia.org/wiki/API API], SOA defines the interface in terms of protocols and functionality such that modules following these protocols can easily be integrated together. &lt;br /&gt;
The typical SOA implementation can be illustrated in the figure:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Service-oriented_architecture_basics.jpg|SOA Functioning]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main characteristics of SOA are:&lt;br /&gt;
&lt;br /&gt;
* '''Based on open standards''' - The governing principles are free for all to use and not protected by intellectual property.&lt;br /&gt;
* '''Interoperable''' - Diverse systems should be able to work together (inter-operate)&lt;br /&gt;
* '''Autonomous''' - Services have control over the logic they encapsulate.&lt;br /&gt;
* '''Reusable''' - Logic is divided into services with the intention of promoting reuse.&lt;br /&gt;
* '''Reliable''' - It should not have many flaws&lt;br /&gt;
* '''Discoverable''' - Services are designed to be outwardly descriptive so that they can be found and assessed via available discovery mechanisms&lt;br /&gt;
* '''Loosely-Coupled''' - Loose coupling occurs when the dependent class contains a pointer only to an interface, which can then be implemented by one or many concrete classes.&lt;br /&gt;
* '''Stateless''' - Should exhibit the same behaviour and yield the same result whether called once, or 100 times&lt;br /&gt;
* '''Composable''' - Collections of services can be coordinated and assembled to form composite services.&lt;br /&gt;
* '''Manageable''' - It should be easy to maintain it&lt;br /&gt;
* '''Secure''' - It should not be easily hackable&lt;br /&gt;
&lt;br /&gt;
=== Core Components of SOA===&lt;br /&gt;
As mentioned earlier, the services communicate with each other using a predefined protocol. The techniques used for protocol selection and execution form the core components of SOA. While using SOA, we have a service that has tells the type of service its provides using [http://en.wikipedia.org/wiki/Web_Services_Description_Language Web Services Description Language (WSDL)] and a directory, like [http://www.service-architecture.com/web-services/articles/universal_description_discovery_and_integration_uddi.html Universal Description, Discovery, and Integration (UDDI)] that holds this information. The service consumer (one who wants some service) will lookup this directory for the name of the service that can fulfill the consumer's request. The consumer and the service provider communicate using some format (in layman terms a language) like SOAP. These ideology leads to the following components of a SOA implementation.&lt;br /&gt;
&lt;br /&gt;
* '''SOAP''': Simple Object Access Protocol - As a layman's example of how SOAP procedures can be used, a SOAP message could be sent to a web service enabled web site (for example, a house price database) with the parameters needed for a search. The site would then return an [http://en.wikipedia.org/wiki/XML XML]-formatted document with the resulting data (prices, location, features, etc). Because the data is returned in a standardized machine-parseable format, it could then be integrated directly into a third-party site.&lt;br /&gt;
* '''WSDL''': Web Services Description Language - Its an XML-based language that provides a model for describing Web Services.&lt;br /&gt;
* '''UDDI''': Universal Discovery, Definition and Integration - Its an XML-based database for companies world-wide to list themselves on the internet&lt;br /&gt;
* '''BPEL''': Business Process Execution Language - Its a language for specifying interaction with web services.&lt;br /&gt;
* '''ESB''': [http://en.wikipedia.org/wiki/Enterprise_service_bus Enterprise Service Bus] &lt;br /&gt;
* '''WS-*''': Web Services Standards - a collection of protocols and standards used for exchanging data between applications&lt;br /&gt;
&lt;br /&gt;
===Benefits of SOA ===&lt;br /&gt;
The benefits offered by SOA can be directly derived from the characteristics of SOA. The features like loose coupling between the service requests and service provider implies flexibility and reuse of services for different service consumers. The benefits can be summarized as below:&lt;br /&gt;
* Improve long-term value of software assets&lt;br /&gt;
* Improve quality through modularity and testability&lt;br /&gt;
* Reduce development time with composition and re-usability&lt;br /&gt;
* Leverage heterogeneous development environments&lt;br /&gt;
* Avoid vendor and platform lock-in&lt;br /&gt;
* Integrate with [http://en.wikipedia.org/wiki/Enterprise_resource_planning ERPs] and Enterprise infrastructure software&lt;br /&gt;
&lt;br /&gt;
===Use cases for SOA with Ruby===&lt;br /&gt;
Ruby can be a productive way to:&lt;br /&gt;
* Build web applications over web services&lt;br /&gt;
* Write web services tests with minimal code&lt;br /&gt;
* Write custom web services monitoring and management&lt;br /&gt;
* Integrate ERPs, [http://en.wikipedia.org/wiki/Commercial_off-the-shelf COTS] and custom applications&lt;br /&gt;
* Write SOA glue-code, e.g. custom transformation&lt;br /&gt;
* Perform programmatic web services orchestration&lt;br /&gt;
* Develop basic web services&lt;br /&gt;
&lt;br /&gt;
==Reflection in Ruby==&lt;br /&gt;
&lt;br /&gt;
One of the many advantages of dynamic languages such as Ruby is the ability to introspect—to examine aspects of the program from within the program itself. This is called reflection. At runtime, we can discover the following things about our ruby program - &lt;br /&gt;
* what objects it contains,&lt;br /&gt;
* the class hierarchy,&lt;br /&gt;
* the attributes and methods of objects, and&lt;br /&gt;
* information on methods.&lt;br /&gt;
&lt;br /&gt;
Ruby provide a module called &amp;quot;ObjectSpace&amp;quot; that lets you to use reflection and see all the above mentioned information. So if you say, &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ObjectSpace.each_object { |x| puts x }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will print all living, nonimmediate objects in Ruby process.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ObjectSpace.each_object(Class) { |x| puts x}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will print all classes in Ruby process.&lt;br /&gt;
&lt;br /&gt;
The following code iterates over all the classes, compares their name. If name matches then create object and execute whichever function you like. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class ClassFromString&lt;br /&gt;
    @@counter = 0&lt;br /&gt;
        def initialize&lt;br /&gt;
           @@counter += 1&lt;br /&gt;
        end&lt;br /&gt;
    &lt;br /&gt;
        def getCounterValue&lt;br /&gt;
           puts @@counter&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    def createClassFromString(classname)&lt;br /&gt;
        ObjectSpace.each_object(Class) do |x|&lt;br /&gt;
           if x.name == classname&lt;br /&gt;
           object = x.new&lt;br /&gt;
           object.getCounterValue&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    createClassFromString(&amp;quot;ClassFromString&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you get the object you can use any method of that object. For e.g. you can use superclass method to get the name of the parent class and so on and can build complete hierarchy dynamically.&lt;br /&gt;
You can get the information about methods of a given class using methods like private_methods(), protected_methods() which are defined in Object class which is base class for each object.&lt;br /&gt;
&lt;br /&gt;
'''Distributed Ruby''' and '''Marshalling''' are two reflection-based technologies that let us send objects around the world and through time, which enables use of Service Oriented Architectures.&lt;br /&gt;
&lt;br /&gt;
===Marshalling===&lt;br /&gt;
&lt;br /&gt;
Java features the ability to serialize objects, letting you store them somewhere and reconstitute them when needed.&lt;br /&gt;
To &amp;quot;serialize&amp;quot; an object means to convert its state into a byte stream in such a way that the byte stream can be converted back into a copy of the object.  You can use this facility, for instance, to save a tree of objects that represent some portion of application state—a document, a CAD drawing, a piece of music, and so on.&lt;br /&gt;
Ruby calls this kind of serialization marshaling (think of railroad marshaling yards where individual cars are assembled in sequence into a complete train, which is then dispatched somewhere). Saving an object and some or all of its components is done using the method ''Marshal.dump''. Typically, you will dump an entire object tree starting with some given object. Later, you can reconstitute the object using ''Marshal.load''.&lt;br /&gt;
&lt;br /&gt;
Example -  &lt;br /&gt;
&lt;br /&gt;
We have a class Chord that holds a collection of musical notes. We’d like to save away a particularly wonderful chord so we can e-mail it to friends. They can then load it into their copy of Ruby and savor it too. Let’s start with the classes for Note and Chord.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note = Struct.new(:value)&lt;br /&gt;
class Note&lt;br /&gt;
    def to_s&lt;br /&gt;
       value.to_s&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class Chord&lt;br /&gt;
   def initialize(arr)&lt;br /&gt;
      @arr = arr&lt;br /&gt;
   end&lt;br /&gt;
 &lt;br /&gt;
   def play&lt;br /&gt;
      @arr.join('')&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we’ll create our masterpiece and use Marshal.dump to save a serialized version of it to disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
c = Chord.new( [ Note.new(&amp;quot;G&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;Bb&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;Db&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;E&amp;quot;) ] )&lt;br /&gt;
File.open(&amp;quot;posterity&amp;quot;, &amp;quot;w+&amp;quot;) do |f|&lt;br /&gt;
    Marshal.dump(c, f)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, it can be read by our friends.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
File.open(&amp;quot;posterity&amp;quot;) do |f|&lt;br /&gt;
    chord = Marshal.load(f)&lt;br /&gt;
end&lt;br /&gt;
chord.play ! &amp;quot;GBbDbE&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Distributed Ruby ===&lt;br /&gt;
Distributed Ruby or DRb allows Ruby programs to communicate with each other on the same machine or over a network. DRb uses remote method invocation (RMI) to pass commands and data between processes. Since we can serialize an object or a set of objects into a form suitable for out-ofprocess storage, we can use this capability for the transmission of objects from one  process to another. Using drb, a Ruby process may act as a server, as a client, or as both. A drb server acts as a source of objects, while a client is a user of those objects. To the client, it appears&lt;br /&gt;
that the objects are local, but in reality the code is still being executed remotely. This can be found in the SOAP implementation of RUBY libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming and SOA==&lt;br /&gt;
The non - dependence of service consumers with service providers during compile time causes a dynamic runtime binding. Invocation of a wide range of service providers calls for techniques that can help creation of service requests at runtime for compatibility with the binding identified during runtime. This can be achieved by using the technique of Metaprogramming. &amp;quot;Meta&amp;quot; means &amp;quot;self&amp;quot; and hence meta programming can be stated as self programming or program that codes itself. This means that there will be some set of code which will create code at runtime. Using this we can create code that binds the service consumer with service provider.&lt;br /&gt;
The concept of meta programming is explained by using Ruby language.&lt;br /&gt;
&lt;br /&gt;
===Metaprogramming in Ruby===&lt;br /&gt;
Metaprogramming is inbuilt and used extensively by the language itself. Consider the following standard used syntax to create getters and setters in ruby:&lt;br /&gt;
&amp;quot;&amp;lt;code&amp;gt;attr_writer :a&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;attr_reader :a&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;attr_accessor :b&amp;lt;/code&amp;gt;&amp;quot;. Each of the single lines of code creates the accessor or/and mutators methods for the variables. This is an example of '''''Metaprogramming'''''. The logic written by the base ruby code (in &amp;lt;code&amp;gt;object.c&amp;lt;/code&amp;gt; file in the ruby directory) uses the information about the variable name provided by the developer and creates at runtime the accessor and mutator methods. This is at runtime as physically there is no code which is present.&lt;br /&gt;
Metaprogramming is achieved by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; method provided by the Ruby language. &lt;br /&gt;
 class GreetPeople&lt;br /&gt;
  eval %{def greeting puts &amp;quot;Hello All!&amp;quot; end}&lt;br /&gt;
 end&lt;br /&gt;
 me = GreetPeople.new&lt;br /&gt;
 puts me.hi&lt;br /&gt;
&lt;br /&gt;
''produces'' '''''Hello All!'''''&lt;br /&gt;
&lt;br /&gt;
One can use &amp;lt;code&amp;gt;define_method&amp;lt;/code&amp;gt; to generate classes and methods at runtime. The usage is like below&lt;br /&gt;
 class Logger&lt;br /&gt;
   def self.add_logging(id_string)&lt;br /&gt;
     define_method(:log) do |msg|&lt;br /&gt;
       now = Time.now.strftime(&amp;quot;%H:%M:%S&amp;quot;) &lt;br /&gt;
       STDERR.puts &amp;quot;#{now}-#{id_string}: #{self} (#{msg})&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 class Song &amp;lt; Logger&lt;br /&gt;
  add_logging &amp;quot;Tune&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 class Album &amp;lt; Logger&lt;br /&gt;
  add_logging &amp;quot;CD&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 song = Song.new&lt;br /&gt;
 song.log(&amp;quot;rock on&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The output produced is:&lt;br /&gt;
 13:26:13-Tune: #&amp;lt;Song:0x0a20e4&amp;gt; (rock on)&lt;br /&gt;
&lt;br /&gt;
Look the part &amp;lt;code&amp;gt;#&amp;lt;Song:0x0a20e4&amp;gt;&amp;lt;/code&amp;gt; even if there is no mention of the class Song, the logger method printed the name of the class as it picked it up at runtime from the keyword '''&amp;quot;self&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
Other methods like add_method adds method to the a class at runtime.&lt;br /&gt;
&lt;br /&gt;
===SOA with Ruby===&lt;br /&gt;
Ruby has some standard libraries for each functional block in the SOA architecture. These libraries are&lt;br /&gt;
 XML 1.0 - REXML, others&lt;br /&gt;
 SOAP 1.1 - SOAP4R, AWS&lt;br /&gt;
 WSDL 1.1 - WSDL4R, AWS&lt;br /&gt;
 UDDI V2 - UDDI4R&lt;br /&gt;
&lt;br /&gt;
Each of these libraries use Metaprogramming in some form or the other. Below is the description for each of the libraries&lt;br /&gt;
====XML Parsing====&lt;br /&gt;
XML is the foundation for the web services. The request, identification of service, method and its parameters of the service, the response, all are in the form of an xml. Thus XML parsing and construction is very important part for effective SOA implementation. &lt;br /&gt;
The XML parsing is handled by the REXML library which is coded in native Ruby code and hence is slow.&lt;br /&gt;
&lt;br /&gt;
The sample code for parsing is&lt;br /&gt;
 require 'rexml/document'&lt;br /&gt;
 xml = &amp;quot;&amp;lt;xml&amp;gt;&amp;lt;person&amp;gt;Abc Xyz&amp;lt;/person&amp;gt;&amp;lt;/xml&amp;gt;&lt;br /&gt;
 begin&lt;br /&gt;
   REXML::Document.new(xml)&lt;br /&gt;
 rescue REXML::ParseException&lt;br /&gt;
   puts &amp;quot;Error occured&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
At runtime the code identifies the nodes and children for each node which can be converted into a collections object for usage and identifying the names and values for each element.&lt;br /&gt;
&lt;br /&gt;
While reading an XML, the use of REXML results in a complex piece of code. Life can be made much simpler by use of '''Builder::XmlMarkup''' libraries.&lt;br /&gt;
The code by use of this library is just like one-one mapping between the Domain object and the elements of the XML.&lt;br /&gt;
&lt;br /&gt;
====WSDL, SOAP and UDDI in Ruby====&lt;br /&gt;
Consider the following example of a  [http://www.brics.dk/~amoeller/WWW/webservices/wsdlexample.html wsdl file].&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;definitions name=&amp;quot;StockQuote&amp;quot;&lt;br /&gt;
             targetNamespace=&amp;quot;http://example.com/stockquote.wsdl&amp;quot;&lt;br /&gt;
             xmlns:tns=&amp;quot;http://example.com/stockquote.wsdl&amp;quot;&lt;br /&gt;
             xmlns:xsd1=&amp;quot;http://example.com/stockquote.xsd&amp;quot;&lt;br /&gt;
             xmlns:soap=&amp;quot;http://schemas.xmlsoap.org/wsdl/soap/&amp;quot;&lt;br /&gt;
             xmlns=&amp;quot;http://schemas.xmlsoap.org/wsdl/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;types&amp;gt;&lt;br /&gt;
    &amp;lt;schema targetNamespace=&amp;quot;http://example.com/stockquote.xsd&amp;quot;&lt;br /&gt;
            xmlns=&amp;quot;http://www.w3.org/2000/10/XMLSchema&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;element name=&amp;quot;TradePriceRequest&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;complexType&amp;gt;&lt;br /&gt;
          &amp;lt;all&amp;gt;&lt;br /&gt;
            &amp;lt;element name=&amp;quot;tickerSymbol&amp;quot; type=&amp;quot;string&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/all&amp;gt;&lt;br /&gt;
        &amp;lt;/complexType&amp;gt;&lt;br /&gt;
      &amp;lt;/element&amp;gt;&lt;br /&gt;
      &amp;lt;element name=&amp;quot;TradePrice&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;complexType&amp;gt;&lt;br /&gt;
           &amp;lt;all&amp;gt;&lt;br /&gt;
             &amp;lt;element name=&amp;quot;price&amp;quot; type=&amp;quot;float&amp;quot;/&amp;gt;&lt;br /&gt;
           &amp;lt;/all&amp;gt;&lt;br /&gt;
         &amp;lt;/complexType&amp;gt;&lt;br /&gt;
      &amp;lt;/element&amp;gt;&lt;br /&gt;
    &amp;lt;/schema&amp;gt;&lt;br /&gt;
  &amp;lt;/types&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;message name=&amp;quot;GetLastTradePriceInput&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;part name=&amp;quot;body&amp;quot; element=&amp;quot;xsd1:TradePriceRequest&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;message name=&amp;quot;GetLastTradePriceOutput&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;part name=&amp;quot;body&amp;quot; element=&amp;quot;xsd1:TradePrice&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;portType name=&amp;quot;StockQuotePortType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;operation name=&amp;quot;GetLastTradePrice&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input message=&amp;quot;tns:GetLastTradePriceInput&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;output message=&amp;quot;tns:GetLastTradePriceOutput&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/operation&amp;gt;&lt;br /&gt;
  &amp;lt;/portType&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;binding name=&amp;quot;StockQuoteSoapBinding&amp;quot; type=&amp;quot;tns:StockQuotePortType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;soap:binding style=&amp;quot;document&amp;quot; transport=&amp;quot;http://schemas.xmlsoap.org/soap/http&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;operation name=&amp;quot;GetLastTradePrice&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;soap:operation soapAction=&amp;quot;http://example.com/GetLastTradePrice&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;&lt;br /&gt;
        &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;&lt;br /&gt;
        &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/operation&amp;gt;&lt;br /&gt;
  &amp;lt;/binding&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;service name=&amp;quot;StockQuoteService&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;documentation&amp;gt;My first service&amp;lt;/documentation&amp;gt;&lt;br /&gt;
    &amp;lt;port name=&amp;quot;StockQuotePort&amp;quot; binding=&amp;quot;tns:StockQuoteSoapBinding&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;soap:address location=&amp;quot;http://example.com/stockquote&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/port&amp;gt;&lt;br /&gt;
  &amp;lt;/service&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/definitions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This file is parsed by using the REXML api and then using the '''''SOAP4R''''' library one can invoke the service. One can also use '''''WSDL4R''''' library to directly create the Ruby code for identifying the Name of the service, the elements and I/O objects. Below is a sample code on how a SOAP call is made using the SOAP4R library&lt;br /&gt;
&lt;br /&gt;
 class ServiceRequestController &amp;lt; ApplicationController&lt;br /&gt;
  @apiKey  = &amp;quot;StockQuoteService&amp;quot;&lt;br /&gt;
  def requestAService&lt;br /&gt;
   @wsdlUrl = &amp;quot;abc&amp;quot;&lt;br /&gt;
   driver = SOAP::WSDLDriverFactory.new(@wsdlUrl).create_rpc_driver&lt;br /&gt;
   driver.add_method('GetLastTradePriceInput',:tradePriceRequestObject)&lt;br /&gt;
   driver.GetLastTradePriceInput(tradePriceRequestObject)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here the method name is found by parsing the wsdl file to get the '''message name'''. The children of this node are the parameters and o/p that the method returns.&lt;br /&gt;
Thus by using &amp;lt;code&amp;gt;add_method&amp;lt;/code&amp;gt; one could dynamically add a method to a class and invoke it.&lt;br /&gt;
&lt;br /&gt;
The WSDL4R is packaged with SOAP4R library. This is because all the information needed for invoking a service is same and one can have a same implementation for all the services. This is made possible due to the DuckTyping nature of Ruby.&lt;br /&gt;
&lt;br /&gt;
UDDI is one link that is not yet discussed. As mentioned earlier there has to be one single place where one can find all the information for the service if one is going to communicate with different businesses. The below sample code illustrates how the list of businesses and the services that are available and can be looked up [http://uddi4r.rubyforge.org/ ]&lt;br /&gt;
 &lt;br /&gt;
 require &amp;quot;lib/client&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # create the client&lt;br /&gt;
 uddi = Uddi4r::Client.new(&amp;quot;http://uddi.xmethods.net/inquire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # find first matching business&lt;br /&gt;
 list = uddi.find_business(:name=&amp;gt;&amp;quot;chaiwat&amp;quot;)&lt;br /&gt;
 biz = list.business_infos.first()&lt;br /&gt;
 &lt;br /&gt;
 # find first service&lt;br /&gt;
 service = biz.service_infos.first()&lt;br /&gt;
 &lt;br /&gt;
 # and it's binding&lt;br /&gt;
 binding = uddi.find_binding(service.service_key)&lt;br /&gt;
 template = binding.binding_template.first()&lt;br /&gt;
 puts template.access_point()&lt;br /&gt;
&lt;br /&gt;
This uses the UDDI4R library to parse the UDDI registry given by http://uddi.xmethods.net/inquire and identify the Business names and the services. Once Identified one can use the SOAP4R or WSDL4R libraries to make the remote calls.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1] SOA with Ruby at �erubycon on �July 18, 2007 by Zak Mandhro �Senior Manager �BearingPoint, Inc&lt;br /&gt;
&lt;br /&gt;
2] [http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html SOA and Web Services]&lt;br /&gt;
&lt;br /&gt;
3] Programming Ruby 1.9 by Dave Thomas, with Chad Fowler and Andy Hunt&lt;br /&gt;
&lt;br /&gt;
4] [http://soa.sys-con.com/node/39831 Web Services Made Easy]&lt;br /&gt;
&lt;br /&gt;
5] Ruby On Rails Power By Aneesha Bakharia&lt;br /&gt;
&lt;br /&gt;
6] Rails for Java Developers&lt;br /&gt;
&lt;br /&gt;
7] [http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection Oriented Programming]&lt;br /&gt;
&lt;br /&gt;
8] [http://nvisia.com/techs/?p=42 Shortcomings of Reflection]&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_f1&amp;diff=25832</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_f1&amp;diff=25832"/>
		<updated>2009-10-14T00:49:45Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Service Oriented Architecture provides another view of providing functionality based upon services offered in terms of protocols and a specific API. To provide services, platforms rely upon principles and the power that can be expressed through reflection and meta programming. Research and report how these critical concepts relate to and support SOA.'''&lt;br /&gt;
&lt;br /&gt;
== Service Oriented Architectures==&lt;br /&gt;
Service Oriented Architecture is not a new thing, but has been there since around 1991 by virtue of the [http://www.omg.org/gettingstarted/history_of_corba.htm CORBA specifications]. The earliest SOA architectures were, DCOM and CORBA [http://www.service-architecture.com/web-services/articles/prior_service-oriented_architecture_specifications.html 1]. [http://en.wikipedia.org/wiki/Service_Oriented_Architectures Service Oriented Architecture] (SOA) is a paradigm for organizing and utilizing distributed capabilities that may be under the control of different ownership domains. SOA provides a uniform means to offer, discover, interact with and use capabilities to produce desired effects consistent with measurable preconditions and expectations. It is a collection of services. These services communicate with each other either by simple data passing or it could involve two or more services coordinating some activity by means of some predefined standard connecting services.  This makes it easier for software integration of different modules developed by different people. Rather than defining an [http://en.wikipedia.org/wiki/API API], SOA defines the interface in terms of protocols and functionality such that modules following these protocols can easily be integrated together. &lt;br /&gt;
The typical SOA implementation can be illustrated in the figure:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Service-oriented_architecture_basics.jpg|SOA Functioning]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main characteristics of SOA are:&lt;br /&gt;
&lt;br /&gt;
* '''Based on open standards''' - The governing principles are free for all to use and not protected by intellectual property.&lt;br /&gt;
* '''Interoperable''' - Diverse systems should be able to work together (inter-operate)&lt;br /&gt;
* '''Autonomous''' - Services have control over the logic they encapsulate.&lt;br /&gt;
* '''Reusable''' - Logic is divided into services with the intention of promoting reuse.&lt;br /&gt;
* '''Reliable''' - It should not have many flaws&lt;br /&gt;
* '''Discoverable''' - Services are designed to be outwardly descriptive so that they can be found and assessed via available discovery mechanisms&lt;br /&gt;
* '''Loosely-Coupled''' - Loose coupling occurs when the dependent class contains a pointer only to an interface, which can then be implemented by one or many concrete classes.&lt;br /&gt;
* '''Stateless''' - Should exhibit the same behaviour and yield the same result whether called once, or 100 times&lt;br /&gt;
* '''Composable''' - Collections of services can be coordinated and assembled to form composite services.&lt;br /&gt;
* '''Manageable''' - It should be easy to maintain it&lt;br /&gt;
* '''Secure''' - It should not be easily hackable&lt;br /&gt;
&lt;br /&gt;
=== Core Components of SOA===&lt;br /&gt;
As mentioned earlier, the services communicate with each other using a predefined protocol. The techniques used for protocol selection and execution form the core components of SOA. While using SOA, we have a service that has tells the type of service its provides using [http://en.wikipedia.org/wiki/Web_Services_Description_Language Web Services Description Language (WSDL)] and a directory, like [http://www.service-architecture.com/web-services/articles/universal_description_discovery_and_integration_uddi.html Universal Description, Discovery, and Integration (UDDI)] that holds this information. The service consumer (one who wants some service) will lookup this directory for the name of the service that can fulfill the consumer's request. The consumer and the service provider communicate using some format (in layman terms a language) like SOAP. These ideology leads to the following components of a SOA implementation.&lt;br /&gt;
&lt;br /&gt;
* '''SOAP''': Simple Object Access Protocol - As a layman's example of how SOAP procedures can be used, a SOAP message could be sent to a web service enabled web site (for example, a house price database) with the parameters needed for a search. The site would then return an [http://en.wikipedia.org/wiki/XML XML]-formatted document with the resulting data (prices, location, features, etc). Because the data is returned in a standardized machine-parseable format, it could then be integrated directly into a third-party site.&lt;br /&gt;
* '''WSDL''': Web Services Description Language - Its an XML-based language that provides a model for describing Web Services.&lt;br /&gt;
* '''UDDI''': Universal Discovery, Definition and Integration - Its an XML-based database for companies world-wide to list themselves on the internet&lt;br /&gt;
* '''BPEL''': Business Process Execution Language - Its a language for specifying interaction with web services.&lt;br /&gt;
* '''ESB''': [http://en.wikipedia.org/wiki/Enterprise_service_bus Enterprise Service Bus] &lt;br /&gt;
* '''WS-*''': Web Services Standards - a collection of protocols and standards used for exchanging data between applications&lt;br /&gt;
&lt;br /&gt;
===Benefits of SOA ===&lt;br /&gt;
The benefits offered by SOA can be directly derived from the characteristics of SOA. The features like loose coupling between the service requests and service provider implies flexibility and reuse of services for different service consumers. The benefits can be summarized as below:&lt;br /&gt;
* Improve long-term value of software assets&lt;br /&gt;
* Improve quality through modularity and testability&lt;br /&gt;
* Reduce development time with composition and re-usability&lt;br /&gt;
* Leverage heterogeneous development environments&lt;br /&gt;
* Avoid vendor and platform lock-in&lt;br /&gt;
* Integrate with [http://en.wikipedia.org/wiki/Enterprise_resource_planning ERPs] and Enterprise infrastructure software&lt;br /&gt;
&lt;br /&gt;
===Use cases for SOA with Ruby===&lt;br /&gt;
Ruby can be a productive way to:&lt;br /&gt;
* Build web applications over web services&lt;br /&gt;
* Write web services tests with minimal code&lt;br /&gt;
* Write custom web services monitoring and management&lt;br /&gt;
* Integrate ERPs, [http://en.wikipedia.org/wiki/Commercial_off-the-shelf COTS] and custom applications&lt;br /&gt;
* Write SOA glue-code, e.g. custom transformation&lt;br /&gt;
* Perform programmatic web services orchestration&lt;br /&gt;
* Develop basic web services&lt;br /&gt;
&lt;br /&gt;
==Reflection in Ruby==&lt;br /&gt;
&lt;br /&gt;
One of the many advantages of dynamic languages such as Ruby is the ability to introspect—to examine aspects of the program from within the program itself. This is called reflection. At runtime, we can discover the following things about our ruby program - &lt;br /&gt;
* what objects it contains,&lt;br /&gt;
* the class hierarchy,&lt;br /&gt;
* the attributes and methods of objects, and&lt;br /&gt;
* information on methods.&lt;br /&gt;
&lt;br /&gt;
Ruby provide a module called &amp;quot;ObjectSpace&amp;quot; that lets you to use reflection and see all the above mentioned information. So if you say, &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ObjectSpace.each_object { |x| puts x }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will print all living, nonimmediate objects in Ruby process.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ObjectSpace.each_object(Class) { |x| puts x}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will print all classes in Ruby process.&lt;br /&gt;
&lt;br /&gt;
The following code iterates over all the classes, compares their name. If name matches then create object and execute whichever function you like. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class ClassFromString&lt;br /&gt;
    @@counter = 0&lt;br /&gt;
        def initialize&lt;br /&gt;
           @@counter += 1&lt;br /&gt;
        end&lt;br /&gt;
    &lt;br /&gt;
        def getCounterValue&lt;br /&gt;
           puts @@counter&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    def createClassFromString(classname)&lt;br /&gt;
        ObjectSpace.each_object(Class) do |x|&lt;br /&gt;
           if x.name == classname&lt;br /&gt;
           object = x.new&lt;br /&gt;
           object.getCounterValue&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    createClassFromString(&amp;quot;ClassFromString&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you get the object you can use any method of that object. For e.g. you can use superclass method to get the name of the parent class and so on and can build complete hierarchy dynamically.&lt;br /&gt;
You can get the information about methods of a given class using methods like private_methods(), protected_methods() which are defined in Object class which is base class for each object.&lt;br /&gt;
&lt;br /&gt;
'''Distributed Ruby''' and '''Marshalling''' are two reflection-based technologies that let us send objects around the world and through time, which enables use of Service Oriented Architectures.&lt;br /&gt;
&lt;br /&gt;
===Marshalling===&lt;br /&gt;
&lt;br /&gt;
Java features the ability to serialize objects, letting you store them somewhere and reconstitute them when needed.&lt;br /&gt;
To &amp;quot;serialize&amp;quot; an object means to convert its state into a byte stream in such a way that the byte stream can be converted back into a copy of the object.  You can use this facility, for instance, to save a tree of objects that represent some portion of application state—a document, a CAD drawing, a piece of music, and so on.&lt;br /&gt;
Ruby calls this kind of serialization marshaling (think of railroad marshaling yards where individual cars are assembled in sequence into a complete train, which is then dispatched somewhere). Saving an object and some or all of its components is done using the method ''Marshal.dump''. Typically, you will dump an entire object tree starting with some given object. Later, you can reconstitute the object using ''Marshal.load''.&lt;br /&gt;
&lt;br /&gt;
Example -  &lt;br /&gt;
&lt;br /&gt;
We have a class Chord that holds a collection of musical notes. We’d like to save away a particularly wonderful chord so we can e-mail it to friends. They can then load it into their copy of Ruby and savor it too. Let’s start with the classes for Note and Chord.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note = Struct.new(:value)&lt;br /&gt;
class Note&lt;br /&gt;
    def to_s&lt;br /&gt;
       value.to_s&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class Chord&lt;br /&gt;
   def initialize(arr)&lt;br /&gt;
      @arr = arr&lt;br /&gt;
   end&lt;br /&gt;
 &lt;br /&gt;
   def play&lt;br /&gt;
      @arr.join('')&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we’ll create our masterpiece and use Marshal.dump to save a serialized version of it to disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
c = Chord.new( [ Note.new(&amp;quot;G&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;Bb&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;Db&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;E&amp;quot;) ] )&lt;br /&gt;
File.open(&amp;quot;posterity&amp;quot;, &amp;quot;w+&amp;quot;) do |f|&lt;br /&gt;
    Marshal.dump(c, f)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, it can be read by our friends.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
File.open(&amp;quot;posterity&amp;quot;) do |f|&lt;br /&gt;
    chord = Marshal.load(f)&lt;br /&gt;
end&lt;br /&gt;
chord.play ! &amp;quot;GBbDbE&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Distributed Ruby ===&lt;br /&gt;
Distributed Ruby or DRb allows Ruby programs to communicate with each other on the same machine or over a network. DRb uses remote method invocation (RMI) to pass commands and data between processes. Since we can serialize an object or a set of objects into a form suitable for out-ofprocess storage, we can use this capability for the transmission of objects from one  process to another. Using drb, a Ruby process may act as a server, as a client, or as both. A drb server acts as a source of objects, while a client is a user of those objects. To the client, it appears&lt;br /&gt;
that the objects are local, but in reality the code is still being executed remotely. This can be found in the SOAP implementation of RUBY libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming and SOA==&lt;br /&gt;
The non - dependence of service consumers with service providers during compile time causes a dynamic runtime binding. Invocation of a wide range of service providers calls for techniques that can help creation of service requests at runtime for compatibility with the binding identified during runtime. This can be achieved by using the technique of Metaprogramming. &amp;quot;Meta&amp;quot; means &amp;quot;self&amp;quot; and hence meta programming can be stated as self programming or program that codes itself. This means that there will be some set of code which will create code at runtime. Using this we can create code that binds the service consumer with service provider.&lt;br /&gt;
The concept of meta programming is explained by using Ruby language.&lt;br /&gt;
&lt;br /&gt;
===Metaprogramming in Ruby===&lt;br /&gt;
Metaprogramming is inbuilt and used extensively by the language itself. Consider the following standard used syntax to create getters and setters in ruby:&lt;br /&gt;
&amp;quot;&amp;lt;code&amp;gt;attr_writer :a&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;attr_reader :a&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;attr_accessor :b&amp;lt;/code&amp;gt;&amp;quot;. Each of the single lines of code creates the accessor or/and mutators methods for the variables. This is an example of '''''Metaprogramming'''''. The logic written by the base ruby code (in &amp;lt;code&amp;gt;object.c&amp;lt;/code&amp;gt; file in the ruby directory) uses the information about the variable name provided by the developer and creates at runtime the accessor and mutator methods. This is at runtime as physically there is no code which is present.&lt;br /&gt;
Metaprogramming is achieved by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; method provided by the Ruby language. &lt;br /&gt;
 class GreetPeople&lt;br /&gt;
  eval %{def greeting puts &amp;quot;Hello All!&amp;quot; end}&lt;br /&gt;
 end&lt;br /&gt;
 me = GreetPeople.new&lt;br /&gt;
 puts me.hi&lt;br /&gt;
&lt;br /&gt;
''produces'' '''''Hello All!'''''&lt;br /&gt;
&lt;br /&gt;
One can use &amp;lt;code&amp;gt;define_method&amp;lt;/code&amp;gt; to generate classes and methods at runtime. The usage is like below&lt;br /&gt;
 class Logger&lt;br /&gt;
   def self.add_logging(id_string)&lt;br /&gt;
     define_method(:log) do |msg|&lt;br /&gt;
       now = Time.now.strftime(&amp;quot;%H:%M:%S&amp;quot;) &lt;br /&gt;
       STDERR.puts &amp;quot;#{now}-#{id_string}: #{self} (#{msg})&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 class Song &amp;lt; Logger&lt;br /&gt;
  add_logging &amp;quot;Tune&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 class Album &amp;lt; Logger&lt;br /&gt;
  add_logging &amp;quot;CD&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 song = Song.new&lt;br /&gt;
 song.log(&amp;quot;rock on&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The output produced is:&lt;br /&gt;
 13:26:13-Tune: #&amp;lt;Song:0x0a20e4&amp;gt; (rock on)&lt;br /&gt;
&lt;br /&gt;
Look the part &amp;lt;code&amp;gt;#&amp;lt;Song:0x0a20e4&amp;gt;&amp;lt;/code&amp;gt; even if there is no mention of the class Song, the logger method printed the name of the class as it picked it up at runtime from the keyword '''&amp;quot;self&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
Other methods like add_method adds method to the a class at runtime.&lt;br /&gt;
&lt;br /&gt;
===SOA with Ruby===&lt;br /&gt;
Ruby has some standard libraries for each functional block in the SOA architecture. These libraries are&lt;br /&gt;
 XML 1.0 - REXML, others&lt;br /&gt;
 SOAP 1.1 - SOAP4R, AWS&lt;br /&gt;
 WSDL 1.1 - WSDL4R, AWS&lt;br /&gt;
 UDDI V2 - UDDI4R&lt;br /&gt;
&lt;br /&gt;
Each of these libraries use Metaprogramming in some form or the other. Below is the description for each of the libraries&lt;br /&gt;
====XML Parsing====&lt;br /&gt;
XML is the foundation for the web services. The request, identification of service, method and its parameters of the service, the response, all are in the form of an xml. Thus XML parsing and construction is very important part for effective SOA implementation. &lt;br /&gt;
The XML parsing is handled by the REXML library which is coded in native Ruby code and hence is slow.&lt;br /&gt;
&lt;br /&gt;
The sample code for parsing is&lt;br /&gt;
 require 'rexml/document'&lt;br /&gt;
 xml = &amp;quot;&amp;lt;xml&amp;gt;&amp;lt;person&amp;gt;Abc Xyz&amp;lt;/person&amp;gt;&amp;lt;/xml&amp;gt;&lt;br /&gt;
 begin&lt;br /&gt;
   REXML::Document.new(xml)&lt;br /&gt;
 rescue REXML::ParseException&lt;br /&gt;
   puts &amp;quot;Error occured&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
At runtime the code identifies the nodes and children for each node which can be converted into a collections object for usage and identifying the names and values for each element.&lt;br /&gt;
&lt;br /&gt;
While reading an XML, the use of REXML results in a complex piece of code. Life can be made much simpler by use of '''Builder::XmlMarkup''' libraries.&lt;br /&gt;
The code by use of this library is just like one-one mapping between the Domain object and the elements of the XML.&lt;br /&gt;
&lt;br /&gt;
====WSDL, SOAP and UDDI in Ruby====&lt;br /&gt;
Consider the following example of a  [http://www.brics.dk/~amoeller/WWW/webservices/wsdlexample.html wsdl file].&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;definitions name=&amp;quot;StockQuote&amp;quot;&lt;br /&gt;
             targetNamespace=&amp;quot;http://example.com/stockquote.wsdl&amp;quot;&lt;br /&gt;
             xmlns:tns=&amp;quot;http://example.com/stockquote.wsdl&amp;quot;&lt;br /&gt;
             xmlns:xsd1=&amp;quot;http://example.com/stockquote.xsd&amp;quot;&lt;br /&gt;
             xmlns:soap=&amp;quot;http://schemas.xmlsoap.org/wsdl/soap/&amp;quot;&lt;br /&gt;
             xmlns=&amp;quot;http://schemas.xmlsoap.org/wsdl/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;types&amp;gt;&lt;br /&gt;
    &amp;lt;schema targetNamespace=&amp;quot;http://example.com/stockquote.xsd&amp;quot;&lt;br /&gt;
            xmlns=&amp;quot;http://www.w3.org/2000/10/XMLSchema&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;element name=&amp;quot;TradePriceRequest&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;complexType&amp;gt;&lt;br /&gt;
          &amp;lt;all&amp;gt;&lt;br /&gt;
            &amp;lt;element name=&amp;quot;tickerSymbol&amp;quot; type=&amp;quot;string&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/all&amp;gt;&lt;br /&gt;
        &amp;lt;/complexType&amp;gt;&lt;br /&gt;
      &amp;lt;/element&amp;gt;&lt;br /&gt;
      &amp;lt;element name=&amp;quot;TradePrice&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;complexType&amp;gt;&lt;br /&gt;
           &amp;lt;all&amp;gt;&lt;br /&gt;
             &amp;lt;element name=&amp;quot;price&amp;quot; type=&amp;quot;float&amp;quot;/&amp;gt;&lt;br /&gt;
           &amp;lt;/all&amp;gt;&lt;br /&gt;
         &amp;lt;/complexType&amp;gt;&lt;br /&gt;
      &amp;lt;/element&amp;gt;&lt;br /&gt;
    &amp;lt;/schema&amp;gt;&lt;br /&gt;
  &amp;lt;/types&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;message name=&amp;quot;GetLastTradePriceInput&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;part name=&amp;quot;body&amp;quot; element=&amp;quot;xsd1:TradePriceRequest&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;message name=&amp;quot;GetLastTradePriceOutput&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;part name=&amp;quot;body&amp;quot; element=&amp;quot;xsd1:TradePrice&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;portType name=&amp;quot;StockQuotePortType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;operation name=&amp;quot;GetLastTradePrice&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input message=&amp;quot;tns:GetLastTradePriceInput&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;output message=&amp;quot;tns:GetLastTradePriceOutput&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/operation&amp;gt;&lt;br /&gt;
  &amp;lt;/portType&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;binding name=&amp;quot;StockQuoteSoapBinding&amp;quot; type=&amp;quot;tns:StockQuotePortType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;soap:binding style=&amp;quot;document&amp;quot; transport=&amp;quot;http://schemas.xmlsoap.org/soap/http&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;operation name=&amp;quot;GetLastTradePrice&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;soap:operation soapAction=&amp;quot;http://example.com/GetLastTradePrice&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;&lt;br /&gt;
        &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;&lt;br /&gt;
        &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/operation&amp;gt;&lt;br /&gt;
  &amp;lt;/binding&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;service name=&amp;quot;StockQuoteService&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;documentation&amp;gt;My first service&amp;lt;/documentation&amp;gt;&lt;br /&gt;
    &amp;lt;port name=&amp;quot;StockQuotePort&amp;quot; binding=&amp;quot;tns:StockQuoteSoapBinding&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;soap:address location=&amp;quot;http://example.com/stockquote&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/port&amp;gt;&lt;br /&gt;
  &amp;lt;/service&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/definitions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This file is parsed by using the REXML api and then using the '''''SOAP4R''''' library one can invoke the service. One can also use '''''WSDL4R''''' library to directly create the Ruby code for identifying the Name of the service, the elements and I/O objects. Below is a sample code on how a SOAP call is made using the SOAP4R library&lt;br /&gt;
&lt;br /&gt;
 class ServiceRequestController &amp;lt; ApplicationController&lt;br /&gt;
  @apiKey  = &amp;quot;StockQuoteService&amp;quot;&lt;br /&gt;
  def requestAService&lt;br /&gt;
   @wsdlUrl = &amp;quot;abc&amp;quot;&lt;br /&gt;
   driver = SOAP::WSDLDriverFactory.new(@wsdlUrl).create_rpc_driver&lt;br /&gt;
   driver.add_method('GetLastTradePriceInput',:tradePriceRequestObject)&lt;br /&gt;
   driver.GetLastTradePriceInput(tradePriceRequestObject)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here the method name is found by parsing the wsdl file to get the '''message name'''. The children of this node are the parameters and o/p that the method returns.&lt;br /&gt;
Thus by using &amp;lt;code&amp;gt;add_method&amp;lt;/code&amp;gt; one could dynamically add a method to a class and invoke it.&lt;br /&gt;
&lt;br /&gt;
The WSDL4R is packaged with SOAP4R library. This is because all the information needed for invoking a service is same and one can have a same implementation for all the services. This is made possible due to the DuckTyping nature of Ruby.&lt;br /&gt;
&lt;br /&gt;
UDDI is one link that is not yet discussed. As mentioned earlier there has to be one single place where one can find all the information for the service if one is going to communicate with different businesses. The below sample code illustrates how the list of businesses and the services that are available and can be looked up [http://uddi4r.rubyforge.org/ ]&lt;br /&gt;
 &lt;br /&gt;
 require &amp;quot;lib/client&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # create the client&lt;br /&gt;
 uddi = Uddi4r::Client.new(&amp;quot;http://uddi.xmethods.net/inquire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # find first matching business&lt;br /&gt;
 list = uddi.find_business(:name=&amp;gt;&amp;quot;chaiwat&amp;quot;)&lt;br /&gt;
 biz = list.business_infos.first()&lt;br /&gt;
 &lt;br /&gt;
 # find first service&lt;br /&gt;
 service = biz.service_infos.first()&lt;br /&gt;
 &lt;br /&gt;
 # and it's binding&lt;br /&gt;
 binding = uddi.find_binding(service.service_key)&lt;br /&gt;
 template = binding.binding_template.first()&lt;br /&gt;
 puts template.access_point()&lt;br /&gt;
&lt;br /&gt;
This uses the UDDI4R library to parse the UDDI registry given by http://uddi.xmethods.net/inquire and identify the Business names and the services. Once Identified one can use the SOAP4R or WSDL4R libraries to make the remote calls.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1] SOA with Ruby at �erubycon on �July 18, 2007 by Zak Mandhro �Senior Manager �BearingPoint, Inc&lt;br /&gt;
&lt;br /&gt;
2] [http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html SOA and Web Services]&lt;br /&gt;
&lt;br /&gt;
3] Programming Ruby 1.9 by Dave Thomas, with Chad Fowler and Andy Hunt&lt;br /&gt;
&lt;br /&gt;
4] [http://soa.sys-con.com/node/39831 Web Services Made Easy]&lt;br /&gt;
&lt;br /&gt;
5] Ruby On Rails Power By Aneesha Bakharia&lt;br /&gt;
&lt;br /&gt;
6] Rails for Java Developers&lt;br /&gt;
&lt;br /&gt;
7] [http://en.wikipedia.org/wiki/Reflection_(computer_science) Reflection Oriented Programming]&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_f1&amp;diff=25820</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_f1&amp;diff=25820"/>
		<updated>2009-10-13T21:28:32Z</updated>

		<summary type="html">&lt;p&gt;Suze: Code indented for better clarity.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Service Oriented Architecture provides another view of providing functionality based upon services offered in terms of protocols and a specific API. To provide services, platforms rely upon principles and the power that can be expressed through reflection and meta programming. Research and report how these critical concepts relate to and support SOA.'''&lt;br /&gt;
&lt;br /&gt;
== Service Oriented Architectures==&lt;br /&gt;
Service Oriented Architecture is not a new thing, but has been there since around 1991 by virtue of the [http://www.omg.org/gettingstarted/history_of_corba.htm CORBA specifications]. The earliest SOA architectures were, DCOM and CORBA [http://www.service-architecture.com/web-services/articles/prior_service-oriented_architecture_specifications.html 1]. [http://en.wikipedia.org/wiki/Service_Oriented_Architectures Service Oriented Architecture] (SOA) is a paradigm for organizing and utilizing distributed capabilities that may be under the control of different ownership domains. SOA provides a uniform means to offer, discover, interact with and use capabilities to produce desired effects consistent with measurable preconditions and expectations. It is a collection of services. These services communicate with each other either by simple data passing or it could involve two or more services coordinating some activity by means of some predefined standard connecting services.  This makes it easier for software integration of different modules developed by different people. Rather than defining an [http://en.wikipedia.org/wiki/API API], SOA defines the interface in terms of protocols and functionality such that modules following these protocols can easily be integrated together. &lt;br /&gt;
The typical SOA implementation can be illustrated in the figure:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Service-oriented_architecture_basics.jpg|SOA Functioning]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main characteristics of SOA are:&lt;br /&gt;
&lt;br /&gt;
* '''Based on open standards''' - The governing principles are free for all to use and not protected by intellectual property.&lt;br /&gt;
* '''Interoperable''' - Diverse systems should be able to work together (inter-operate)&lt;br /&gt;
* '''Autonomous''' - Services have control over the logic they encapsulate.&lt;br /&gt;
* '''Reusable''' - Logic is divided into services with the intention of promoting reuse.&lt;br /&gt;
* '''Reliable''' - It should not have many flaws&lt;br /&gt;
* '''Discoverable''' - Services are designed to be outwardly descriptive so that they can be found and assessed via available discovery mechanisms&lt;br /&gt;
* '''Loosely-Coupled''' - Loose coupling occurs when the dependent class contains a pointer only to an interface, which can then be implemented by one or many concrete classes.&lt;br /&gt;
* '''Stateless''' - Should exhibit the same behaviour and yield the same result whether called once, or 100 times&lt;br /&gt;
* '''Composable''' - Collections of services can be coordinated and assembled to form composite services.&lt;br /&gt;
* '''Manageable''' - It should be easy to maintain it&lt;br /&gt;
* '''Secure''' - It should not be easily hackable&lt;br /&gt;
&lt;br /&gt;
=== Core Components of SOA===&lt;br /&gt;
As mentioned earlier, the services communicate with each other using a predefined protocol. The techniques used for protocol selection and execution form the core components of SOA. While using SOA, we have a service that has tells the type of service its provides using [http://en.wikipedia.org/wiki/Web_Services_Description_Language Web Services Description Language (WSDL)] and a directory, like [http://www.service-architecture.com/web-services/articles/universal_description_discovery_and_integration_uddi.html Universal Description, Discovery, and Integration (UDDI)] that holds this information. The service consumer (one who wants some service) will lookup this directory for the name of the service that can fulfill the consumer's request. The consumer and the service provider communicate using some format (in layman terms a language) like SOAP. These ideology leads to the following components of a SOA implementation.&lt;br /&gt;
&lt;br /&gt;
* '''SOAP''': Simple Object Access Protocol - As a layman's example of how SOAP procedures can be used, a SOAP message could be sent to a web service enabled web site (for example, a house price database) with the parameters needed for a search. The site would then return an [http://en.wikipedia.org/wiki/XML XML]-formatted document with the resulting data (prices, location, features, etc). Because the data is returned in a standardized machine-parseable format, it could then be integrated directly into a third-party site.&lt;br /&gt;
* '''WSDL''': Web Services Description Language - Its an XML-based language that provides a model for describing Web Services.&lt;br /&gt;
* '''UDDI''': Universal Discovery, Definition and Integration - Its an XML-based database for companies world-wide to list themselves on the internet&lt;br /&gt;
* '''BPEL''': Business Process Execution Language - Its a language for specifying interaction with web services.&lt;br /&gt;
* '''ESB''': [http://en.wikipedia.org/wiki/Enterprise_service_bus Enterprise Service Bus] &lt;br /&gt;
* '''WS-*''': Web Services Standards - a collection of protocols and standards used for exchanging data between applications&lt;br /&gt;
&lt;br /&gt;
===Benefits of SOA ===&lt;br /&gt;
The benefits offered by SOA can be directly derived from the characteristics of SOA. The features like loose coupling between the service requests and service provider implies flexibility and reuse of services for different service consumers. The benefits can be summarized as below:&lt;br /&gt;
* Improve long-term value of software assets&lt;br /&gt;
* Improve quality through modularity and testability&lt;br /&gt;
* Reduce development time with composition and re-usability&lt;br /&gt;
* Leverage heterogeneous development environments&lt;br /&gt;
* Avoid vendor and platform lock-in&lt;br /&gt;
* Integrate with [http://en.wikipedia.org/wiki/Enterprise_resource_planning ERPs] and Enterprise infrastructure software&lt;br /&gt;
&lt;br /&gt;
===Use cases for SOA with Ruby===&lt;br /&gt;
Ruby can be a productive way to:&lt;br /&gt;
* Build web applications over web services&lt;br /&gt;
* Write web services tests with minimal code&lt;br /&gt;
* Write custom web services monitoring and management&lt;br /&gt;
* Integrate ERPs, [http://en.wikipedia.org/wiki/Commercial_off-the-shelf COTS] and custom applications&lt;br /&gt;
* Write SOA glue-code, e.g. custom transformation&lt;br /&gt;
* Perform programmatic web services orchestration&lt;br /&gt;
* Develop basic web services&lt;br /&gt;
&lt;br /&gt;
==Reflection in Ruby==&lt;br /&gt;
&lt;br /&gt;
One of the many advantages of dynamic languages such as Ruby is the ability to introspect—to examine aspects of the program from within the program itself. This is called reflection. At runtime, we can discover the following things about our ruby program - &lt;br /&gt;
* what objects it contains,&lt;br /&gt;
* the class hierarchy,&lt;br /&gt;
* the attributes and methods of objects, and&lt;br /&gt;
* information on methods.&lt;br /&gt;
&lt;br /&gt;
Ruby provide a module called &amp;quot;ObjectSpace&amp;quot; that lets you to use reflection and see all the above mentioned information. So if you say, &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ObjectSpace.each_object { |x| puts x }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will print all living, nonimmediate objects in Ruby process.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ObjectSpace.each_object(Class) { |x| puts x}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will print all classes in Ruby process.&lt;br /&gt;
&lt;br /&gt;
The following code iterates over all the classes, compares their name. If name matches then create object and execute whichever function you like. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class ClassFromString&lt;br /&gt;
    @@counter = 0&lt;br /&gt;
        def initialize&lt;br /&gt;
           @@counter += 1&lt;br /&gt;
        end&lt;br /&gt;
    &lt;br /&gt;
        def getCounterValue&lt;br /&gt;
           puts @@counter&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    def createClassFromString(classname)&lt;br /&gt;
        ObjectSpace.each_object(Class) do |x|&lt;br /&gt;
           if x.name == classname&lt;br /&gt;
           object = x.new&lt;br /&gt;
           object.getCounterValue&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    createClassFromString(&amp;quot;ClassFromString&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you get the object you can use any method of that object. For e.g. you can use superclass method to get the name of the parent class and so on and can build complete hierarchy dynamically.&lt;br /&gt;
You can get the information about methods of a given class using methods like private_methods(), protected_methods() which are defined in Object class which is base class for each object.&lt;br /&gt;
&lt;br /&gt;
'''Distributed Ruby''' and '''Marshalling''' are two reflection-based technologies that let us send objects around the world and through time, which enables use of Service Oriented Architectures.&lt;br /&gt;
&lt;br /&gt;
===Marshalling===&lt;br /&gt;
&lt;br /&gt;
Java features the ability to serialize objects, letting you store them somewhere and reconstitute them when needed.&lt;br /&gt;
To &amp;quot;serialize&amp;quot; an object means to convert its state into a byte stream in such a way that the byte stream can be converted back into a copy of the object.  You can use this facility, for instance, to save a tree of objects that represent some portion of application state—a document, a CAD drawing, a piece of music, and so on.&lt;br /&gt;
Ruby calls this kind of serialization marshaling (think of railroad marshaling yards where individual cars are assembled in sequence into a complete train, which is then dispatched somewhere). Saving an object and some or all of its components is done using the method ''Marshal.dump''. Typically, you will dump an entire object tree starting with some given object. Later, you can reconstitute the object using ''Marshal.load''.&lt;br /&gt;
&lt;br /&gt;
Example -  &lt;br /&gt;
&lt;br /&gt;
We have a class Chord that holds a collection of musical notes. We’d like to save away a particularly wonderful chord so we can e-mail it to friends. They can then load it into their copy of Ruby and savor it too. Let’s start with the classes for Note and Chord.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note = Struct.new(:value)&lt;br /&gt;
class Note&lt;br /&gt;
    def to_s&lt;br /&gt;
       value.to_s&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class Chord&lt;br /&gt;
   def initialize(arr)&lt;br /&gt;
      @arr = arr&lt;br /&gt;
   end&lt;br /&gt;
 &lt;br /&gt;
   def play&lt;br /&gt;
      @arr.join('')&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we’ll create our masterpiece and use Marshal.dump to save a serialized version of it to disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
c = Chord.new( [ Note.new(&amp;quot;G&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;Bb&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;Db&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;E&amp;quot;) ] )&lt;br /&gt;
File.open(&amp;quot;posterity&amp;quot;, &amp;quot;w+&amp;quot;) do |f|&lt;br /&gt;
    Marshal.dump(c, f)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, it can be read by our friends.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
File.open(&amp;quot;posterity&amp;quot;) do |f|&lt;br /&gt;
    chord = Marshal.load(f)&lt;br /&gt;
end&lt;br /&gt;
chord.play ! &amp;quot;GBbDbE&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Distributed Ruby ===&lt;br /&gt;
Distributed Ruby or DRb allows Ruby programs to communicate with each other on the same machine or over a network. DRb uses remote method invocation (RMI) to pass commands and data between processes. Since we can serialize an object or a set of objects into a form suitable for out-ofprocess storage, we can use this capability for the transmission of objects from one  process to another. Using drb, a Ruby process may act as a server, as a client, or as both. A drb server acts as a source of objects, while a client is a user of those objects. To the client, it appears&lt;br /&gt;
that the objects are local, but in reality the code is still being executed remotely. This can be found in the SOAP implementation of RUBY libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming and SOA==&lt;br /&gt;
The non - dependence of service consumers with service providers during compile time causes a dynamic runtime binding. Invocation of a wide range of service providers calls for techniques that can help creation of service requests at runtime for compatibility with the binding identified during runtime. This can be achieved by using the technique of Metaprogramming. &amp;quot;Meta&amp;quot; means &amp;quot;self&amp;quot; and hence meta programming can be stated as self programming or program that codes itself. This means that there will be some set of code which will create code at runtime. Using this we can create code that binds the service consumer with service provider.&lt;br /&gt;
The concept of meta programming is explained by using Ruby language.&lt;br /&gt;
&lt;br /&gt;
===Metaprogramming in Ruby===&lt;br /&gt;
Metaprogramming is inbuilt and used extensively by the language itself. Consider the following standard used syntax to create getters and setters in ruby:&lt;br /&gt;
&amp;quot;&amp;lt;code&amp;gt;attr_writer :a&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;attr_reader :a&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;attr_accessor :b&amp;lt;/code&amp;gt;&amp;quot;. Each of the single lines of code creates the accessor or/and mutators methods for the variables. This is an example of '''''Metaprogramming'''''. The logic written by the base ruby code (in &amp;lt;code&amp;gt;object.c&amp;lt;/code&amp;gt; file in the ruby directory) uses the information about the variable name provided by the developer and creates at runtime the accessor and mutator methods. This is at runtime as physically there is no code which is present.&lt;br /&gt;
Metaprogramming is achieved by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; method provided by the Ruby language. &lt;br /&gt;
 class GreetPeople&lt;br /&gt;
  eval %{def greeting puts &amp;quot;Hello All!&amp;quot; end}&lt;br /&gt;
 end&lt;br /&gt;
 me = GreetPeople.new&lt;br /&gt;
 puts me.hi&lt;br /&gt;
&lt;br /&gt;
''produces'' '''''Hello All!'''''&lt;br /&gt;
&lt;br /&gt;
One can use &amp;lt;code&amp;gt;define_method&amp;lt;/code&amp;gt; to generate classes and methods at runtime. The usage is like below&lt;br /&gt;
 class Logger&lt;br /&gt;
   def self.add_logging(id_string)&lt;br /&gt;
     define_method(:log) do |msg|&lt;br /&gt;
       now = Time.now.strftime(&amp;quot;%H:%M:%S&amp;quot;) &lt;br /&gt;
       STDERR.puts &amp;quot;#{now}-#{id_string}: #{self} (#{msg})&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 class Song &amp;lt; Logger&lt;br /&gt;
  add_logging &amp;quot;Tune&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 class Album &amp;lt; Logger&lt;br /&gt;
  add_logging &amp;quot;CD&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 song = Song.new&lt;br /&gt;
 song.log(&amp;quot;rock on&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The output produced is:&lt;br /&gt;
 13:26:13-Tune: #&amp;lt;Song:0x0a20e4&amp;gt; (rock on)&lt;br /&gt;
&lt;br /&gt;
Look the part &amp;lt;code&amp;gt;#&amp;lt;Song:0x0a20e4&amp;gt;&amp;lt;/code&amp;gt; even if there is no mention of the class Song, the logger method printed the name of the class as it picked it up at runtime from the keyword '''&amp;quot;self&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
Other methods like add_method adds method to the a class at runtime.&lt;br /&gt;
&lt;br /&gt;
===SOA with Ruby===&lt;br /&gt;
Ruby has some standard libraries for each functional block in the SOA architecture. These libraries are&lt;br /&gt;
 XML 1.0 - REXML, others&lt;br /&gt;
 SOAP 1.1 - SOAP4R, AWS&lt;br /&gt;
 WSDL 1.1 - WSDL4R, AWS&lt;br /&gt;
 UDDI V2 - UDDI4R&lt;br /&gt;
&lt;br /&gt;
Each of these libraries use Metaprogramming in some form or the other. Below is the description for each of the libraries&lt;br /&gt;
====XML Parsing====&lt;br /&gt;
XML is the foundation for the web services. The request, identification of service, method and its parameters of the service, the response, all are in the form of an xml. Thus XML parsing and construction is very important part for effective SOA implementation. &lt;br /&gt;
The XML parsing is handled by the REXML library which is coded in native Ruby code and hence is slow.&lt;br /&gt;
&lt;br /&gt;
The sample code for parsing is&lt;br /&gt;
 require 'rexml/document'&lt;br /&gt;
 xml = &amp;quot;&amp;lt;xml&amp;gt;&amp;lt;person&amp;gt;Abc Xyz&amp;lt;/person&amp;gt;&amp;lt;/xml&amp;gt;&lt;br /&gt;
 begin&lt;br /&gt;
   REXML::Document.new(xml)&lt;br /&gt;
 rescue REXML::ParseException&lt;br /&gt;
   puts &amp;quot;Error occured&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
At runtime the code identifies the nodes and children for each node which can be converted into a collections object for usage and identifying the names and values for each element.&lt;br /&gt;
&lt;br /&gt;
While reading an XML, the use of REXML results in a complex piece of code. Life can be made much simpler by use of '''Builder::XmlMarkup''' libraries.&lt;br /&gt;
The code by use of this library is just like one-one mapping between the Domain object and the elements of the XML.&lt;br /&gt;
&lt;br /&gt;
====WSDL, SOAP and UDDI in Ruby====&lt;br /&gt;
Consider the following example of a  [http://www.brics.dk/~amoeller/WWW/webservices/wsdlexample.html wsdl file].&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;definitions name=&amp;quot;StockQuote&amp;quot;&lt;br /&gt;
             targetNamespace=&amp;quot;http://example.com/stockquote.wsdl&amp;quot;&lt;br /&gt;
             xmlns:tns=&amp;quot;http://example.com/stockquote.wsdl&amp;quot;&lt;br /&gt;
             xmlns:xsd1=&amp;quot;http://example.com/stockquote.xsd&amp;quot;&lt;br /&gt;
             xmlns:soap=&amp;quot;http://schemas.xmlsoap.org/wsdl/soap/&amp;quot;&lt;br /&gt;
             xmlns=&amp;quot;http://schemas.xmlsoap.org/wsdl/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;types&amp;gt;&lt;br /&gt;
    &amp;lt;schema targetNamespace=&amp;quot;http://example.com/stockquote.xsd&amp;quot;&lt;br /&gt;
            xmlns=&amp;quot;http://www.w3.org/2000/10/XMLSchema&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;element name=&amp;quot;TradePriceRequest&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;complexType&amp;gt;&lt;br /&gt;
          &amp;lt;all&amp;gt;&lt;br /&gt;
            &amp;lt;element name=&amp;quot;tickerSymbol&amp;quot; type=&amp;quot;string&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/all&amp;gt;&lt;br /&gt;
        &amp;lt;/complexType&amp;gt;&lt;br /&gt;
      &amp;lt;/element&amp;gt;&lt;br /&gt;
      &amp;lt;element name=&amp;quot;TradePrice&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;complexType&amp;gt;&lt;br /&gt;
           &amp;lt;all&amp;gt;&lt;br /&gt;
             &amp;lt;element name=&amp;quot;price&amp;quot; type=&amp;quot;float&amp;quot;/&amp;gt;&lt;br /&gt;
           &amp;lt;/all&amp;gt;&lt;br /&gt;
         &amp;lt;/complexType&amp;gt;&lt;br /&gt;
      &amp;lt;/element&amp;gt;&lt;br /&gt;
    &amp;lt;/schema&amp;gt;&lt;br /&gt;
  &amp;lt;/types&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;message name=&amp;quot;GetLastTradePriceInput&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;part name=&amp;quot;body&amp;quot; element=&amp;quot;xsd1:TradePriceRequest&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;message name=&amp;quot;GetLastTradePriceOutput&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;part name=&amp;quot;body&amp;quot; element=&amp;quot;xsd1:TradePrice&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;portType name=&amp;quot;StockQuotePortType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;operation name=&amp;quot;GetLastTradePrice&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input message=&amp;quot;tns:GetLastTradePriceInput&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;output message=&amp;quot;tns:GetLastTradePriceOutput&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/operation&amp;gt;&lt;br /&gt;
  &amp;lt;/portType&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;binding name=&amp;quot;StockQuoteSoapBinding&amp;quot; type=&amp;quot;tns:StockQuotePortType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;soap:binding style=&amp;quot;document&amp;quot; transport=&amp;quot;http://schemas.xmlsoap.org/soap/http&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;operation name=&amp;quot;GetLastTradePrice&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;soap:operation soapAction=&amp;quot;http://example.com/GetLastTradePrice&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;&lt;br /&gt;
        &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;&lt;br /&gt;
        &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/operation&amp;gt;&lt;br /&gt;
  &amp;lt;/binding&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;service name=&amp;quot;StockQuoteService&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;documentation&amp;gt;My first service&amp;lt;/documentation&amp;gt;&lt;br /&gt;
    &amp;lt;port name=&amp;quot;StockQuotePort&amp;quot; binding=&amp;quot;tns:StockQuoteSoapBinding&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;soap:address location=&amp;quot;http://example.com/stockquote&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/port&amp;gt;&lt;br /&gt;
  &amp;lt;/service&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/definitions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This file is parsed by using the REXML api and then using the '''''SOAP4R''''' library one can invoke the service. One can also use '''''WSDL4R''''' library to directly create the Ruby code for identifying the Name of the service, the elements and I/O objects. Below is a sample code on how a SOAP call is made using the SOAP4R library&lt;br /&gt;
&lt;br /&gt;
 class ServiceRequestController &amp;lt; ApplicationController&lt;br /&gt;
  @apiKey  = &amp;quot;StockQuoteService&amp;quot;&lt;br /&gt;
  def requestAService&lt;br /&gt;
   @wsdlUrl = &amp;quot;abc&amp;quot;&lt;br /&gt;
   driver = SOAP::WSDLDriverFactory.new(@wsdlUrl).create_rpc_driver&lt;br /&gt;
   driver.add_method('GetLastTradePriceInput',:tradePriceRequestObject)&lt;br /&gt;
   driver.GetLastTradePriceInput(tradePriceRequestObject)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here the method name is found by parsing the wsdl file to get the '''message name'''. The children of this node are the parameters and o/p that the method returns.&lt;br /&gt;
Thus by using &amp;lt;code&amp;gt;add_method&amp;lt;/code&amp;gt; one could dynamically add a method to a class and invoke it.&lt;br /&gt;
&lt;br /&gt;
The WSDL4R is packaged with SOAP4R library. This is because all the information needed for invoking a service is same and one can have a same implementation for all the services. This is made possible due to the DuckTyping nature of Ruby.&lt;br /&gt;
&lt;br /&gt;
UDDI is one link that is not yet discussed. As mentioned earlier there has to be one single place where one can find all the information for the service if one is going to communicate with different businesses. The below sample code illustrates how the list of businesses and the services that are available and can be looked up [http://uddi4r.rubyforge.org/ ]&lt;br /&gt;
 &lt;br /&gt;
 require &amp;quot;lib/client&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # create the client&lt;br /&gt;
 uddi = Uddi4r::Client.new(&amp;quot;http://uddi.xmethods.net/inquire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # find first matching business&lt;br /&gt;
 list = uddi.find_business(:name=&amp;gt;&amp;quot;chaiwat&amp;quot;)&lt;br /&gt;
 biz = list.business_infos.first()&lt;br /&gt;
 &lt;br /&gt;
 # find first service&lt;br /&gt;
 service = biz.service_infos.first()&lt;br /&gt;
 &lt;br /&gt;
 # and it's binding&lt;br /&gt;
 binding = uddi.find_binding(service.service_key)&lt;br /&gt;
 template = binding.binding_template.first()&lt;br /&gt;
 puts template.access_point()&lt;br /&gt;
&lt;br /&gt;
This uses the UDDI4R library to parse the UDDI registry given by http://uddi.xmethods.net/inquire and identify the Business names and the services. Once Identified one can use the SOAP4R or WSDL4R libraries to make the remote calls.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1] SOA with Ruby at �erubycon on �July 18, 2007 by Zak Mandhro �Senior Manager �BearingPoint, Inc&lt;br /&gt;
&lt;br /&gt;
2] [http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html SOA and Web Services]&lt;br /&gt;
&lt;br /&gt;
3] Programming Ruby 1.9 by Dave Thomas, with Chad Fowler and Andy Hunt&lt;br /&gt;
&lt;br /&gt;
4] [http://soa.sys-con.com/node/39831 Web Services Made Easy]&lt;br /&gt;
&lt;br /&gt;
5] Ruby On Rails Power By Aneesha Bakharia&lt;br /&gt;
&lt;br /&gt;
6] Rails for Java Developers&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_f1&amp;diff=25620</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 17 f1</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_17_f1&amp;diff=25620"/>
		<updated>2009-10-11T01:38:48Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Service Oriented Architecture provides another view of providing functionality based upon services offered in terms of protocols and a specific API. To provide services, platforms rely upon principles and the power that can be expressed through reflection and meta programming. Research and report how these critical concepts relate to and support SOA.'''&lt;br /&gt;
&lt;br /&gt;
== Service Oriented Architectures==&lt;br /&gt;
Service Oriented Architecture is not a new thing, but has been there since around 1991 by virtue of the [http://www.omg.org/gettingstarted/history_of_corba.htm CORBA specifications]. The earliest SOA architectures were, DCOM and CORBA [http://www.service-architecture.com/web-services/articles/prior_service-oriented_architecture_specifications.html 1]. [http://en.wikipedia.org/wiki/Service_Oriented_Architectures Service Oriented Architecture] (SOA) is a paradigm for organizing and utilizing distributed capabilities that may be under the control of different ownership domains. SOA provides a uniform means to offer, discover, interact with and use capabilities to produce desired effects consistent with measurable preconditions and expectations. It is a collection of services. These services communicate with each other either by simple data passing or it could involve two or more services coordinating some activity by means of some predefined standard connecting services.  This makes it easier for software integration of different modules developed by different people. Rather than defining an [http://en.wikipedia.org/wiki/API API], SOA defines the interface in terms of protocols and functionality such that modules following these protocols can easily be integrated together. &lt;br /&gt;
The typical SOA implementation can be illustrated in the figure:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Service-oriented_architecture_basics.jpg|SOA Functioning]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main characteristics of SOA are:&lt;br /&gt;
&lt;br /&gt;
* '''Based on open standards''' - The governing principles are free for all to use and not protected by intellectual property.&lt;br /&gt;
* '''Interoperable''' - Diverse systems should be able to work together (inter-operate)&lt;br /&gt;
* '''Autonomous''' - Services have control over the logic they encapsulate.&lt;br /&gt;
* '''Reusable''' - Logic is divided into services with the intention of promoting reuse.&lt;br /&gt;
* '''Reliable''' - It should not have many flaws&lt;br /&gt;
* '''Discoverable''' - Services are designed to be outwardly descriptive so that they can be found and assessed via available discovery mechanisms&lt;br /&gt;
* '''Loosely-Coupled''' - Loose coupling occurs when the dependent class contains a pointer only to an interface, which can then be implemented by one or many concrete classes.&lt;br /&gt;
* '''Stateless''' - Should exhibit the same behaviour and yield the same result whether called once, or 100 times&lt;br /&gt;
* '''Composable''' - Collections of services can be coordinated and assembled to form composite services.&lt;br /&gt;
* '''Manageable''' - It should be easy to maintain it&lt;br /&gt;
* '''Secure''' - It should not be easily hackable&lt;br /&gt;
&lt;br /&gt;
=== Core Components of SOA===&lt;br /&gt;
As mentioned earlier, the services communicate with each other using a predefined protocol. The techniques used for protocol selection and execution form the core components of SOA. While using SOA, we have a service that has tells the type of service its provides using [http://en.wikipedia.org/wiki/Web_Services_Description_Language Web Services Description Language (WSDL)] and a directory, like [http://www.service-architecture.com/web-services/articles/universal_description_discovery_and_integration_uddi.html Universal Description, Discovery, and Integration (UDDI)] that holds this information. The service consumer (one who wants some service) will lookup this directory for the name of the service that can fulfill the consumer's request. The consumer and the service provider communicate using some format (in layman terms a language) like SOAP. These ideology leads to the following components of a SOA implementation.&lt;br /&gt;
&lt;br /&gt;
* '''SOAP''': Simple Object Access Protocol - As a layman's example of how SOAP procedures can be used, a SOAP message could be sent to a web service enabled web site (for example, a house price database) with the parameters needed for a search. The site would then return an [http://en.wikipedia.org/wiki/XML XML]-formatted document with the resulting data (prices, location, features, etc). Because the data is returned in a standardized machine-parseable format, it could then be integrated directly into a third-party site.&lt;br /&gt;
* '''WSDL''': Web Services Description Language - Its an XML-based language that provides a model for describing Web Services.&lt;br /&gt;
* '''UDDI''': Universal Discovery, Definition and Integration - Its an XML-based database for companies world-wide to list themselves on the internet&lt;br /&gt;
* '''BPEL''': Business Process Execution Language - Its a language for specifying interaction with web services.&lt;br /&gt;
* '''ESB''': [http://en.wikipedia.org/wiki/Enterprise_service_bus Enterprise Service Bus] &lt;br /&gt;
* '''WS-*''': Web Services Standards - a collection of protocols and standards used for exchanging data between applications&lt;br /&gt;
&lt;br /&gt;
===Benefits of SOA ===&lt;br /&gt;
The benefits offered by SOA can be directly derived from the characteristics of SOA. The features like loose coupling between the service requests and service provider implies flexibility and reuse of services for different service consumers. The benefits can be summarized as below:&lt;br /&gt;
* Improve long-term value of software assets&lt;br /&gt;
* Improve quality through modularity and testability&lt;br /&gt;
* Reduce development time with composition and re-usability&lt;br /&gt;
* Leverage heterogeneous development environments&lt;br /&gt;
* Avoid vendor and platform lock-in&lt;br /&gt;
* Integrate with [http://en.wikipedia.org/wiki/Enterprise_resource_planning ERPs] and Enterprise infrastructure software&lt;br /&gt;
&lt;br /&gt;
===Use cases for SOA with Ruby===&lt;br /&gt;
Ruby can be a productive way to:&lt;br /&gt;
* Build web applications over web services&lt;br /&gt;
* Write web services tests with minimal code&lt;br /&gt;
* Write custom web services monitoring and management&lt;br /&gt;
* Integrate ERPs, [http://en.wikipedia.org/wiki/Commercial_off-the-shelf COTS] and custom applications&lt;br /&gt;
* Write SOA glue-code, e.g. custom transformation&lt;br /&gt;
* Perform programmatic web services orchestration&lt;br /&gt;
* Develop basic web services&lt;br /&gt;
&lt;br /&gt;
==Reflection in Ruby==&lt;br /&gt;
&lt;br /&gt;
One of the many advantages of dynamic languages such as Ruby is the ability to introspect—to examine aspects of the program from within the program itself. This is called reflection. At runtime, we can discover the following things about our ruby program - &lt;br /&gt;
* what objects it contains,&lt;br /&gt;
* the class hierarchy,&lt;br /&gt;
* the attributes and methods of objects, and&lt;br /&gt;
* information on methods.&lt;br /&gt;
&lt;br /&gt;
Ruby provide a module called &amp;quot;ObjectSpace&amp;quot; that lets you to use reflection and see all the above mentioned information. So if you say, &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ObjectSpace.each_object { |x| puts x }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will print all living, nonimmediate objects in Ruby process.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ObjectSpace.each_object(Class) { |x| puts x}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
will print all classes in Ruby process.&lt;br /&gt;
&lt;br /&gt;
The following code iterates over all the classes, compares their name. If name matches then create object and execute whichever function you like. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class ClassFromString&lt;br /&gt;
    @@counter = 0&lt;br /&gt;
    def initialize&lt;br /&gt;
    @@counter += 1&lt;br /&gt;
    end&lt;br /&gt;
    def getCounterValue&lt;br /&gt;
    puts @@counter&lt;br /&gt;
    end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    def createClassFromString(classname)&lt;br /&gt;
    ObjectSpace.each_object(Class) do |x|&lt;br /&gt;
    if x.name == classname&lt;br /&gt;
    object = x.new&lt;br /&gt;
    object.getCounterValue&lt;br /&gt;
    object = x.new&lt;br /&gt;
    object.getCounterValue&lt;br /&gt;
    end&lt;br /&gt;
    end&lt;br /&gt;
    end&lt;br /&gt;
    createClassFromString(&amp;quot;ClassFromString&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you get the object you can use any method of that object. For e.g. you can use superclass method to get the name of the parent class and so on and can build complete hierarchy dynamically.&lt;br /&gt;
You can get the information about methods of a given class using methods like private_methods(), protected_methods() which are defined in Object class which is base class for each object.&lt;br /&gt;
&lt;br /&gt;
'''Distributed Ruby''' and '''Marshalling''' are two reflection-based technologies that let us send objects around the world and through time, which enables use of Service Oriented Architectures.&lt;br /&gt;
&lt;br /&gt;
===Marshalling===&lt;br /&gt;
&lt;br /&gt;
Java features the ability to serialize objects, letting you store them somewhere and reconstitute them when needed.&lt;br /&gt;
To &amp;quot;serialize&amp;quot; an object means to convert its state into a byte stream in such a way that the byte stream can be converted back into a copy of the object.  You can use this facility, for instance, to save a tree of objects that represent some portion of application state—a document, a CAD drawing, a piece of music, and so on.&lt;br /&gt;
Ruby calls this kind of serialization marshaling (think of railroad marshaling yards where individual cars are assembled in sequence into a complete train, which is then dispatched somewhere). Saving an object and some or all of its components is done using the method ''Marshal.dump''. Typically, you will dump an entire object tree starting with some given object. Later, you can reconstitute the object using ''Marshal.load''.&lt;br /&gt;
&lt;br /&gt;
Example -  &lt;br /&gt;
&lt;br /&gt;
We have a class Chord that holds a collection of musical notes. We’d like to save away a particularly wonderful chord so we can e-mail it to friends. They can then load it into their copy of Ruby and savor it too. Let’s start with the classes for Note and Chord.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note = Struct.new(:value)&lt;br /&gt;
class Note&lt;br /&gt;
def to_s&lt;br /&gt;
value.to_s&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
class Chord&lt;br /&gt;
def initialize(arr)&lt;br /&gt;
@arr = arr&lt;br /&gt;
end&lt;br /&gt;
def play&lt;br /&gt;
@arr.join('')&lt;br /&gt;
end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we’ll create our masterpiece and use Marshal.dump to save a serialized version of it to disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
c = Chord.new( [ Note.new(&amp;quot;G&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;Bb&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;Db&amp;quot;),&lt;br /&gt;
Note.new(&amp;quot;E&amp;quot;) ] )&lt;br /&gt;
File.open(&amp;quot;posterity&amp;quot;, &amp;quot;w+&amp;quot;) do |f|&lt;br /&gt;
Marshal.dump(c, f)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, it can be read by our friends.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
File.open(&amp;quot;posterity&amp;quot;) do |f|&lt;br /&gt;
chord = Marshal.load(f)&lt;br /&gt;
end&lt;br /&gt;
chord.play ! &amp;quot;GBbDbE&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Distributed Ruby ===&lt;br /&gt;
Distributed Ruby or DRb allows Ruby programs to communicate with each other on the same machine or over a network. DRb uses remote method invocation (RMI) to pass commands and data between processes. Since we can serialize an object or a set of objects into a form suitable for out-ofprocess storage, we can use this capability for the transmission of objects from one  process to another. Using drb, a Ruby process may act as a server, as a client, or as both. A drb server acts as a source of objects, while a client is a user of those objects. To the client, it appears&lt;br /&gt;
that the objects are local, but in reality the code is still being executed remotely. This can be found in the SOAP implementation of RUBY libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming and SOA==&lt;br /&gt;
The non - dependence of service consumers with service providers during compile time causes a dynamic runtime binding. Invocation of a wide range of service providers calls for techniques that can help creation of service requests at runtime for compatibility with the binding identified during runtime. This can be achieved by using the technique of Metaprogramming. &amp;quot;Meta&amp;quot; means &amp;quot;self&amp;quot; and hence meta programming can be stated as self programming or program that codes itself. This means that there will be some set of code which will create code at runtime. Using this we can create code that binds the service consumer with service provider.&lt;br /&gt;
The concept of meta programming is explained by using Ruby language.&lt;br /&gt;
&lt;br /&gt;
===Metaprogramming in Ruby===&lt;br /&gt;
Metaprogramming is inbuilt and used extensively by the language itself. Consider the following standard used syntax to create getters and setters in ruby:&lt;br /&gt;
&amp;quot;&amp;lt;code&amp;gt;attr_writer :a&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;attr_reader :a&amp;lt;/code&amp;gt;&amp;quot;, &amp;quot;&amp;lt;code&amp;gt;attr_accessor :b&amp;lt;/code&amp;gt;&amp;quot;. Each of the single lines of code creates the accessor or/and mutators methods for the variables. This is an example of '''''Metaprogramming'''''. The logic written by the base ruby code (in &amp;lt;code&amp;gt;object.c&amp;lt;/code&amp;gt; file in the ruby directory) uses the information about the variable name provided by the developer and creates at runtime the accessor and mutator methods. This is at runtime as physically there is no code which is present.&lt;br /&gt;
Metaprogramming is achieved by the &amp;lt;code&amp;gt;eval&amp;lt;/code&amp;gt; method provided by the Ruby language. &lt;br /&gt;
 class GreetPeople&lt;br /&gt;
  eval %{def greeting puts &amp;quot;Hello All!&amp;quot; end}&lt;br /&gt;
 end&lt;br /&gt;
 me = GreetPeople.new&lt;br /&gt;
 puts me.hi&lt;br /&gt;
&lt;br /&gt;
''produces'' '''''Hello All!'''''&lt;br /&gt;
&lt;br /&gt;
One can use &amp;lt;code&amp;gt;define_method&amp;lt;/code&amp;gt; to generate classes and methods at runtime. The usage is like below&lt;br /&gt;
 class Logger&lt;br /&gt;
   def self.add_logging(id_string)&lt;br /&gt;
     define_method(:log) do |msg|&lt;br /&gt;
       now = Time.now.strftime(&amp;quot;%H:%M:%S&amp;quot;) &lt;br /&gt;
       STDERR.puts &amp;quot;#{now}-#{id_string}: #{self} (#{msg})&amp;quot;&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 class Song &amp;lt; Logger&lt;br /&gt;
  add_logging &amp;quot;Tune&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 class Album &amp;lt; Logger&lt;br /&gt;
  add_logging &amp;quot;CD&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 song = Song.new&lt;br /&gt;
 song.log(&amp;quot;rock on&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The output produced is:&lt;br /&gt;
 13:26:13-Tune: #&amp;lt;Song:0x0a20e4&amp;gt; (rock on)&lt;br /&gt;
&lt;br /&gt;
Look the part &amp;lt;code&amp;gt;#&amp;lt;Song:0x0a20e4&amp;gt;&amp;lt;/code&amp;gt; even if there is no mention of the class Song, the logger method printed the name of the class as it picked it up at runtime from the keyword '''&amp;quot;self&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
Other methods like add_method adds method to the a class at runtime.&lt;br /&gt;
&lt;br /&gt;
===SOA with Ruby===&lt;br /&gt;
Ruby has some standard libraries for each functional block in the SOA architecture. These libraries are&lt;br /&gt;
 XML 1.0 - REXML, others&lt;br /&gt;
 SOAP 1.1 - SOAP4R, AWS&lt;br /&gt;
 WSDL 1.1 - WSDL4R, AWS&lt;br /&gt;
 UDDI V2 - UDDI4R&lt;br /&gt;
&lt;br /&gt;
Each of these libraries use Metaprogramming in some form or the other. Below is the description for each of the libraries&lt;br /&gt;
====XML Parsing====&lt;br /&gt;
XML is the foundation for the web services. The request, identification of service, method and its parameters of the service, the response, all are in the form of an xml. Thus XML parsing and construction is very important part for effective SOA implementation. &lt;br /&gt;
The XML parsing is handled by the REXML library which is coded in native Ruby code and hence is slow.&lt;br /&gt;
&lt;br /&gt;
The sample code for parsing is&lt;br /&gt;
 require 'rexml/document'&lt;br /&gt;
 xml = &amp;quot;&amp;lt;xml&amp;gt;&amp;lt;person&amp;gt;Abc Xyz&amp;lt;/person&amp;gt;&amp;lt;/xml&amp;gt;&lt;br /&gt;
 begin&lt;br /&gt;
   REXML::Document.new(xml)&lt;br /&gt;
 rescue REXML::ParseException&lt;br /&gt;
   puts &amp;quot;Error occured&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
At runtime the code identifies the nodes and children for each node which can be converted into a collections object for usage and identifying the names and values for each element.&lt;br /&gt;
&lt;br /&gt;
While reading an XML, the use of REXML results in a complex piece of code. Life can be made much simpler by use of '''Builder::XmlMarkup''' libraries.&lt;br /&gt;
The code by use of this library is just like one-one mapping between the Domain object and the elements of the XML.&lt;br /&gt;
&lt;br /&gt;
===WSDL, SOAP and UDDI in Ruby===&lt;br /&gt;
Consider the following example of a  [http://www.brics.dk/~amoeller/WWW/webservices/wsdlexample.html wsdl file].&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;definitions name=&amp;quot;StockQuote&amp;quot;&lt;br /&gt;
             targetNamespace=&amp;quot;http://example.com/stockquote.wsdl&amp;quot;&lt;br /&gt;
             xmlns:tns=&amp;quot;http://example.com/stockquote.wsdl&amp;quot;&lt;br /&gt;
             xmlns:xsd1=&amp;quot;http://example.com/stockquote.xsd&amp;quot;&lt;br /&gt;
             xmlns:soap=&amp;quot;http://schemas.xmlsoap.org/wsdl/soap/&amp;quot;&lt;br /&gt;
             xmlns=&amp;quot;http://schemas.xmlsoap.org/wsdl/&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;types&amp;gt;&lt;br /&gt;
    &amp;lt;schema targetNamespace=&amp;quot;http://example.com/stockquote.xsd&amp;quot;&lt;br /&gt;
            xmlns=&amp;quot;http://www.w3.org/2000/10/XMLSchema&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;element name=&amp;quot;TradePriceRequest&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;complexType&amp;gt;&lt;br /&gt;
          &amp;lt;all&amp;gt;&lt;br /&gt;
            &amp;lt;element name=&amp;quot;tickerSymbol&amp;quot; type=&amp;quot;string&amp;quot;/&amp;gt;&lt;br /&gt;
          &amp;lt;/all&amp;gt;&lt;br /&gt;
        &amp;lt;/complexType&amp;gt;&lt;br /&gt;
      &amp;lt;/element&amp;gt;&lt;br /&gt;
      &amp;lt;element name=&amp;quot;TradePrice&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;complexType&amp;gt;&lt;br /&gt;
           &amp;lt;all&amp;gt;&lt;br /&gt;
             &amp;lt;element name=&amp;quot;price&amp;quot; type=&amp;quot;float&amp;quot;/&amp;gt;&lt;br /&gt;
           &amp;lt;/all&amp;gt;&lt;br /&gt;
         &amp;lt;/complexType&amp;gt;&lt;br /&gt;
      &amp;lt;/element&amp;gt;&lt;br /&gt;
    &amp;lt;/schema&amp;gt;&lt;br /&gt;
  &amp;lt;/types&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;message name=&amp;quot;GetLastTradePriceInput&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;part name=&amp;quot;body&amp;quot; element=&amp;quot;xsd1:TradePriceRequest&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;message name=&amp;quot;GetLastTradePriceOutput&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;part name=&amp;quot;body&amp;quot; element=&amp;quot;xsd1:TradePrice&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;portType name=&amp;quot;StockQuotePortType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;operation name=&amp;quot;GetLastTradePrice&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input message=&amp;quot;tns:GetLastTradePriceInput&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;output message=&amp;quot;tns:GetLastTradePriceOutput&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/operation&amp;gt;&lt;br /&gt;
  &amp;lt;/portType&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;binding name=&amp;quot;StockQuoteSoapBinding&amp;quot; type=&amp;quot;tns:StockQuotePortType&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;soap:binding style=&amp;quot;document&amp;quot; transport=&amp;quot;http://schemas.xmlsoap.org/soap/http&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;operation name=&amp;quot;GetLastTradePrice&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;soap:operation soapAction=&amp;quot;http://example.com/GetLastTradePrice&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;input&amp;gt;&lt;br /&gt;
        &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;output&amp;gt;&lt;br /&gt;
        &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/output&amp;gt;&lt;br /&gt;
    &amp;lt;/operation&amp;gt;&lt;br /&gt;
  &amp;lt;/binding&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;service name=&amp;quot;StockQuoteService&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;documentation&amp;gt;My first service&amp;lt;/documentation&amp;gt;&lt;br /&gt;
    &amp;lt;port name=&amp;quot;StockQuotePort&amp;quot; binding=&amp;quot;tns:StockQuoteSoapBinding&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;soap:address location=&amp;quot;http://example.com/stockquote&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/port&amp;gt;&lt;br /&gt;
  &amp;lt;/service&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/definitions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This file is parsed by using the REXML api and then using the '''''SOAP4R''''' library one can invoke the service. One can also use '''''WSDL4R''''' library to directly create the Ruby code for identifying the Name of the service, the elements and I/O objects. Below is a sample code on how a SOAP call is made using the SOAP4R library&lt;br /&gt;
&lt;br /&gt;
 class ServiceRequestController &amp;lt; ApplicationController&lt;br /&gt;
  @apiKey  = &amp;quot;StockQuoteService&amp;quot;&lt;br /&gt;
  def requestAService&lt;br /&gt;
   @wsdlUrl = &amp;quot;abc&amp;quot;&lt;br /&gt;
   driver = SOAP::WSDLDriverFactory.new(@wsdlUrl).create_rpc_driver&lt;br /&gt;
   driver.add_method('GetLastTradePriceInput',:tradePriceRequestObject)&lt;br /&gt;
   driver.GetLastTradePriceInput(tradePriceRequestObject)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
Here the method name is found by parsing the wsdl file to get the '''message name'''. The children of this node are the parameters and o/p that the method returns.&lt;br /&gt;
Thus by using &amp;lt;code&amp;gt;add_method&amp;lt;/code&amp;gt; one could dynamically add a method to a class and invoke it.&lt;br /&gt;
&lt;br /&gt;
The WSDL4R is packaged with SOAP4R library. This is because all the information needed for invoking a service is same and one can have a same implementation for all the services. This is made possible due to the DuckTyping nature of Ruby.&lt;br /&gt;
&lt;br /&gt;
UDDI is one link that is not yet discussed. As mentioned earlier there has to be one single place where one can find all the information for the service if one is going to communicate with different businesses. The below sample code illustrates how the list of businesses and the services that are available and can be looked up [http://uddi4r.rubyforge.org/ ]&lt;br /&gt;
 &lt;br /&gt;
 require &amp;quot;lib/client&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 # create the client&lt;br /&gt;
 uddi = Uddi4r::Client.new(&amp;quot;http://uddi.xmethods.net/inquire&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # find first matching business&lt;br /&gt;
 list = uddi.find_business(:name=&amp;gt;&amp;quot;chaiwat&amp;quot;)&lt;br /&gt;
 biz = list.business_infos.first()&lt;br /&gt;
 &lt;br /&gt;
 # find first service&lt;br /&gt;
 service = biz.service_infos.first()&lt;br /&gt;
 &lt;br /&gt;
 # and it's binding&lt;br /&gt;
 binding = uddi.find_binding(service.service_key)&lt;br /&gt;
 template = binding.binding_template.first()&lt;br /&gt;
 puts template.access_point()&lt;br /&gt;
&lt;br /&gt;
This uses the UDDI4R library to parse the UDDI registry given by http://uddi.xmethods.net/inquire and identify the Business names and the services. Once Identified one can use the SOAP4R or WSDL4R libraries to make the remote calls.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1] SOA with Ruby at �erubycon on �July 18, 2007 by Zak Mandhro �Senior Manager �BearingPoint, Inc&lt;br /&gt;
&lt;br /&gt;
2] [http://www.service-architecture.com/web-services/articles/service-oriented_architecture_soa_definition.html SOA and Web Services]&lt;br /&gt;
&lt;br /&gt;
3] Programming Ruby 1.9 by Dave Thomas, with Chad Fowler and Andy Hunt&lt;br /&gt;
&lt;br /&gt;
4] [http://soa.sys-con.com/node/39831 Web Services Made Easy]&lt;br /&gt;
&lt;br /&gt;
5] Ruby On Rails Power By Aneesha Bakharia&lt;br /&gt;
&lt;br /&gt;
6] Rails for Java Developers&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17808</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17808"/>
		<updated>2009-09-06T15:46:07Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Ruby Advantages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features: Ruby vs Python==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Programming Environments ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
Both languages provide interactive shells (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level persistence support. Multiple IDEs are available for Python, including GUI debuggers. A gdb-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an EclipseIde for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies MVC framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Features exclusive to each of Ruby and Python==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
==Advantages of Ruby/Python over statically typed languages==&lt;br /&gt;
&lt;br /&gt;
The term Dynamic language refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have type checking performed during compile-time as opposed to run-time and an objects type cannot be changed. Programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. Apart from being dynamically typed, there are many features provided by dynamic languages that aren’t to be found in Static languages. These include blocks and closures, metaprogramming, and unbounded polymorphism and support for multiple programming paradigms. These features lend certain advantages to a dynamic language which are listed below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Typed features===&lt;br /&gt;
With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Verbosity===&lt;br /&gt;
Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===More compact code===&lt;br /&gt;
'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
Ruby and Python allows you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
===Duck Typing===&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Environments Suited to Each==&lt;br /&gt;
&lt;br /&gt;
Python is useful for rapid prototyping, web scripting, XML processing, database applications, GUI applications, scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
Ruby is useful for typical scripting language applications such as text processing and middleware programs. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class regular expressions, which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the Ruby on Rails web framework. Websites like Twitter and Hulu use the Ruby on Rails web development framework in production environments.&lt;br /&gt;
Ruby can also be used as a high-level API wrapper (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17807</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17807"/>
		<updated>2009-09-06T15:44:02Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features: Ruby vs Python==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Programming Environments ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
Both languages provide interactive shells (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level persistence support. Multiple IDEs are available for Python, including GUI debuggers. A gdb-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an EclipseIde for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies MVC framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Features exclusive to each of Ruby and Python==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction&lt;br /&gt;
between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
==Advantages of Ruby/Python over statically typed languages==&lt;br /&gt;
&lt;br /&gt;
The term Dynamic language refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have type checking performed during compile-time as opposed to run-time and an objects type cannot be changed. Programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. Apart from being dynamically typed, there are many features provided by dynamic languages that aren’t to be found in Static languages. These include blocks and closures, metaprogramming, and unbounded polymorphism and support for multiple programming paradigms. These features lend certain advantages to a dynamic language which are listed below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Typed features===&lt;br /&gt;
With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Verbosity===&lt;br /&gt;
Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===More compact code===&lt;br /&gt;
'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
Ruby and Python allows you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
===Duck Typing===&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Environments Suited to Each==&lt;br /&gt;
&lt;br /&gt;
Python is useful for rapid prototyping, web scripting, XML processing, database applications, GUI applications, scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
Ruby is useful for typical scripting language applications such as text processing and middleware programs. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class regular expressions, which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the Ruby on Rails web framework. Websites like Twitter and Hulu use the Ruby on Rails web development framework in production environments.&lt;br /&gt;
Ruby can also be used as a high-level API wrapper (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17805</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17805"/>
		<updated>2009-09-06T15:16:01Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features: Ruby vs Python==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Web Programming Environments ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies MVC framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Advantages of Ruby/Python over statically typed languages==&lt;br /&gt;
&lt;br /&gt;
The term Dynamic language refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have type checking performed during compile-time as opposed to run-time and an objects type cannot be changed. Programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. Apart from being dynamically typed, there are many features provided by dynamic languages that aren’t to be found in Static languages. These include blocks and closures, metaprogramming, and unbounded polymorphism and support for multiple programming paradigms. These features lend certain advantages to a dynamic language which are listed below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Typed features===&lt;br /&gt;
With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Verbosity===&lt;br /&gt;
Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===More compact code===&lt;br /&gt;
'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
Ruby and Python allows you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
===Duck Typing===&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Environments Suited to Each==&lt;br /&gt;
&lt;br /&gt;
Python is useful for rapid prototyping, web scripting, XML processing, database applications, GUI applications, scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
Ruby is useful for typical scripting language applications such as text processing and middleware programs. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class regular expressions, which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the Ruby on Rails web framework. Websites like Twitter and Hulu use the Ruby on Rails web development framework in production environments.&lt;br /&gt;
Ruby can also be used as a high-level API wrapper (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17647</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17647"/>
		<updated>2009-09-05T21:45:54Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Web Programming Environments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Web Programming Environments ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies MVC framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Advantages of Ruby/Python over statically typed languages==&lt;br /&gt;
&lt;br /&gt;
The term Dynamic language refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have type checking performed during compile-time as opposed to run-time and an objects type cannot be changed. Programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. Apart from being dynamically typed, there are many features provided by dynamic languages that aren’t to be found in Static languages. These include blocks and closures, metaprogramming, and unbounded polymorphism and support for multiple programming paradigms. These features lend certain advantages to a dynamic language which are listed below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
Ruby and Python allows you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&lt;br /&gt;
'''Result''':&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Environments Suited to Each==&lt;br /&gt;
&lt;br /&gt;
Python is useful for rapid prototyping, web scripting, XML processing, database applications, GUI applications, scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
Ruby is useful for typical scripting language applications such as text processing and middleware programs. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class regular expressions, which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the Ruby on Rails web framework. Websites like Twitter and Hulu use the Ruby on Rails web development framework in production environments.&lt;br /&gt;
Ruby can also be used as a high-level API wrapper (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17645</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17645"/>
		<updated>2009-09-05T21:44:34Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Web Programming Environments ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies MVC framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push&lt;br /&gt;
&lt;br /&gt;
 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Advantages of Ruby/Python over statically typed languages==&lt;br /&gt;
&lt;br /&gt;
The term Dynamic language refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have type checking performed during compile-time as opposed to run-time and an objects type cannot be changed. Programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. Apart from being dynamically typed, there are many features provided by dynamic languages that aren’t to be found in Static languages. These include blocks and closures, metaprogramming, and unbounded polymorphism and support for multiple programming paradigms. These features lend certain advantages to a dynamic language which are listed below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
Java:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
Java:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
Java:  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
Ruby and Python allows you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
Java:&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing.&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Environments Suited to Each==&lt;br /&gt;
&lt;br /&gt;
Python is useful for rapid prototyping, web scripting, XML processing, database applications, GUI applications, scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
Ruby is useful for typical scripting language applications such as text processing and middleware programs. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class regular expressions, which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the Ruby on Rails web framework. Websites like Twitter and Hulu use the Ruby on Rails web development framework in production environments.&lt;br /&gt;
Ruby can also be used as a high-level API wrapper (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17642</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17642"/>
		<updated>2009-09-05T21:40:19Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Web Programming Environments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Web Programming Environments ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies MVC framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push&lt;br /&gt;
&lt;br /&gt;
 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Advantages of each over statically typed languages==&lt;br /&gt;
&lt;br /&gt;
The term Dynamic language refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects. Statically typed languages such as Java or C# need to have all expressions assigned to a particular type before being run (or during compile-time).&lt;br /&gt;
&lt;br /&gt;
Apart from being dynamically typed, there are many features provided by dynamic languages that aren’t to be found in Static languages. These include blocks and closures, metaprogramming, and unbounded polymorphism and support for multiple programming paradigms. &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
Ruby does not have primitives; everything, including integers are full fledged objects.&lt;br /&gt;
&lt;br /&gt;
  0.zero?    # =&amp;gt; true&lt;br /&gt;
  1.zero?    # =&amp;gt; false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
With Static typing in Java and C#, we need to declare the type of each variable (int, char, float etc.) while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed. Where ‘type’ refers to a set of values or a set of operations. &lt;br /&gt;
&lt;br /&gt;
Java:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
Java&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
Python&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
Statically typed languages are verbose. &lt;br /&gt;
&lt;br /&gt;
Java:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
All the statements below achieve the same functionality. &lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
Java:  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
Ruby and Python allows you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing.&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17641</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17641"/>
		<updated>2009-09-05T21:13:51Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Web Programming Environments ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies MVC framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
==Advantages of each over statically typed languages==&lt;br /&gt;
&lt;br /&gt;
The term Dynamic language refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects. Statically typed languages such as Java or C# need to have all expressions assigned to a particular type before being run (or during compile-time).&lt;br /&gt;
&lt;br /&gt;
Apart from being dynamically typed, there are many features provided by dynamic languages that aren’t to be found in Static languages. These include blocks and closures, metaprogramming, and unbounded polymorphism and support for multiple programming paradigms. &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
Ruby does not have primitives; everything, including integers are full fledged objects.&lt;br /&gt;
&lt;br /&gt;
  0.zero?    # =&amp;gt; true&lt;br /&gt;
  1.zero?    # =&amp;gt; false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
With Static typing in Java and C#, we need to declare the type of each variable (int, char, float etc.) while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed. Where ‘type’ refers to a set of values or a set of operations. &lt;br /&gt;
&lt;br /&gt;
Java:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
Java&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
Python&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
Statically typed languages are verbose. &lt;br /&gt;
&lt;br /&gt;
Java:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
All the statements below achieve the same functionality. &lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
Java:  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
Ruby and Python allows you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing.&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17626</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17626"/>
		<updated>2009-09-05T18:35:09Z</updated>

		<summary type="html">&lt;p&gt;Suze: /*  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Web Programming Environments ==&lt;br /&gt;
&lt;br /&gt;
    * Ruby on Rails - A Ruby Application Server for web development&lt;br /&gt;
    * Zope - Like Ruby on Rails, but in Python &lt;br /&gt;
&lt;br /&gt;
Both of these are&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17625</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17625"/>
		<updated>2009-09-05T18:24:29Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Language Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ==&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17624</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17624"/>
		<updated>2009-09-05T18:18:06Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby Logo]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Python.png&amp;diff=17622</id>
		<title>File:Python.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Python.png&amp;diff=17622"/>
		<updated>2009-09-05T18:12:25Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17619</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17619"/>
		<updated>2009-09-05T18:04:06Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby]]&lt;br /&gt;
[[Image:python.png|frame|alt=Puzzle globe logo|Python]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Svg2raster.png&amp;diff=17618</id>
		<title>File:Svg2raster.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Svg2raster.png&amp;diff=17618"/>
		<updated>2009-09-05T17:59:00Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17617</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17617"/>
		<updated>2009-09-05T17:58:43Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
[[Image:svg2raster.png|frame|alt=Puzzle globe logo|Ruby]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17599</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17599"/>
		<updated>2009-09-05T15:12:46Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Other Differences */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17598</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17598"/>
		<updated>2009-09-05T15:03:42Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Language Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Function&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  row 1, cell 1&lt;br /&gt;
|  row 1, cell 2&lt;br /&gt;
|  row 1, cell 3&lt;br /&gt;
|-&lt;br /&gt;
|  row 2, cell 1&lt;br /&gt;
|  row 2, cell 2&lt;br /&gt;
|  row 2, cell 3&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17590</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17590"/>
		<updated>2009-09-05T07:34:40Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* First parameter of method definition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17589</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17589"/>
		<updated>2009-09-05T07:31:43Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Access Protection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== First parameter of method definition ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17588</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17588"/>
		<updated>2009-09-05T07:31:15Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Access levels for methods and instance variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
 Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== First parameter of method definition ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17587</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17587"/>
		<updated>2009-09-05T07:23:20Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Functions and methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access levels for methods and instance variables ===&lt;br /&gt;
&lt;br /&gt;
One of the differences of Ruby compared to Python and Perl is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision by forcing all instance variables to be private, but also provides a simple way to declare set and get methods. &lt;br /&gt;
&lt;br /&gt;
To make methods and instance variables private in Python, one '''always''' needs to write __ in front of the name. In Ruby, instance variables are private by default. Methods defined after the method call ''private'' are private.&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate functions and methods; all of them are methods.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== First parameter of method definition ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17585</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17585"/>
		<updated>2009-09-05T07:09:17Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Ruby continuations vs Python Generators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access levels for methods and instance variables ===&lt;br /&gt;
&lt;br /&gt;
One of the differences of Ruby compared to Python and Perl is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision by forcing all instance variables to be private, but also provides a simple way to declare set and get methods. &lt;br /&gt;
&lt;br /&gt;
To make methods and instance variables private in Python, one '''always''' needs to write __ in front of the name. In Ruby, instance variables are private by default. Methods defined after the method call ''private'' are private.&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, there are no separate functions and methods; all of them are methods. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== First parameter of method definition ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even coroutines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited coroutine.&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17584</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17584"/>
		<updated>2009-09-05T07:03:02Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Language Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access levels for methods and instance variables ===&lt;br /&gt;
&lt;br /&gt;
One of the differences of Ruby compared to Python and Perl is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision by forcing all instance variables to be private, but also provides a simple way to declare set and get methods. &lt;br /&gt;
&lt;br /&gt;
To make methods and instance variables private in Python, one '''always''' needs to write __ in front of the name. In Ruby, instance variables are private by default. Methods defined after the method call ''private'' are private.&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, there are no separate functions and methods; all of them are methods. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== First parameter of method definition ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17583</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17583"/>
		<updated>2009-09-05T07:01:07Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Ruby Blocks and Python Lambdas */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access levels for methods and instance variables ===&lt;br /&gt;
&lt;br /&gt;
One of the differences of Ruby compared to Python and Perl is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision by forcing all instance variables to be private, but also provides a simple way to declare set and get methods. &lt;br /&gt;
&lt;br /&gt;
To make methods and instance variables private in Python, one '''always''' needs to write __ in front of the name. In Ruby, instance variables are private by default. Methods defined after the method call ''private'' are private.&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, there are no separate functions and methods; all of them are methods. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== First parameter of method definition ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17582</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17582"/>
		<updated>2009-09-05T06:54:24Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Access levels for methods and instance variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access levels for methods and instance variables ===&lt;br /&gt;
&lt;br /&gt;
One of the differences of Ruby compared to Python and Perl is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a tradeoff in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision by forcing all instance variables to be private, but also provides a simple way to declare set and get methods. &lt;br /&gt;
&lt;br /&gt;
To make methods and instance variables private in Python, one '''always''' needs to write __ in front of the name. In Ruby, instance variables are private by default. Methods defined after the method call ''private'' are private.&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, there are no separate functions and methods; all of them are methods. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== First parameter of method definition ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ruby Blocks and Python Lambdas===&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17574</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17574"/>
		<updated>2009-09-05T06:33:08Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Language Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Access levels for methods and instance variables ===&lt;br /&gt;
&lt;br /&gt;
To make methods and instance variables private in Python, one '''always''' needs to write __ in front of the name. In Ruby, instance variables are private by default. Methods defined after the method call ''private'' are private.&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, there are no separate functions and methods; all of them are methods. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== First parameter of method definition ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
Continuation is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A generator in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ruby Blocks and Python Lambdas===&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17562</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17562"/>
		<updated>2009-09-05T05:32:57Z</updated>

		<summary type="html">&lt;p&gt;Suze: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Private methods and variables ===&lt;br /&gt;
&lt;br /&gt;
To make methods and instance variables private in Python, one '''always''' needs to write __ in front of the name. In Ruby, instance variables are private by default. Methods defined after the method call private are private.&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, there are no separate functions and methods; all of them are methods. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== “self” ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
The use of continuations seem rather limited, and hard to understand, but it’s there in Ruby, and not in Python. &lt;br /&gt;
Continuations are useful when it comes to ''usecases''. However, they can be replicated in Python 3.1 with passing variables into ''.next()'' . &lt;br /&gt;
&lt;br /&gt;
Python has generators. You can fake them in Ruby by using '''blocks''', or use continuations. Python generators are easy and clean.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17561</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=17561"/>
		<updated>2009-09-05T05:31:57Z</updated>

		<summary type="html">&lt;p&gt;Suze: /* Language Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features&lt;br /&gt;
* Web programming environments&lt;br /&gt;
* Features exclusive to each&lt;br /&gt;
* Advantages of each over statically typed languages&lt;br /&gt;
* Projects environments suited to each&lt;br /&gt;
&lt;br /&gt;
==Language Features==&lt;br /&gt;
&lt;br /&gt;
===Private methods and variables ===&lt;br /&gt;
&lt;br /&gt;
To make methods and instance variables private in Python, one '''always''' needs to write __ in front of the name. In Ruby, instance variables are private by default. Methods defined after the method call private are private.&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
In Ruby, there are no separate functions and methods; all of them are methods. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
Ruby:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== “self” ===&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
The use of continuations seem rather limited, and hard to understand, but it’s there in Ruby, and not in Python. &lt;br /&gt;
Continuations are useful when it comes to ''usecases''. However, they can be replicated in Python 3.1 with passing variables into ''.next()'' . &lt;br /&gt;
&lt;br /&gt;
Python has generators. You can fake them in Ruby by using '''blocks''', or use continuations. Python generators are easy and clean.&lt;/div&gt;</summary>
		<author><name>Suze</name></author>
	</entry>
</feed>