<?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=Vpadman2</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=Vpadman2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Vpadman2"/>
	<updated>2026-05-16T18:55:14Z</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_2012/ch2b_2w35_av&amp;diff=71277</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71277"/>
		<updated>2012-11-30T22:29:35Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Image_builder_av.png]]&lt;br /&gt;
&lt;br /&gt;
== Abstract Factory ==&lt;br /&gt;
&lt;br /&gt;
Abstract factory method, also known as Kit, provide an interface for creating families of related or dependent objects without specifying their concrete classes. The major difference between Abstract factory and builder pattern is that the focus with builder pattern is on 'step-by-step' object creation but with abstract factory, there is no step by step object creation. The object that is being created is usually created immediately and returned to the caller. The client software creates a concrete implementation of the abstract factory class and then uses the generic interfaces defined by the abstract factory to create the concrete objects according to the requirement&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Abstract_factory_pattern Abstract Factory Wiki]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Consider a case where we need to define a different look and feel for different operating systems or profiles. Hard coding them into each type can result in code duplication and also a poor quality code. This is where abstract factory pattern comes to use. A common factory class can be created for declaring an interface for creating each look and feel. Then, a concrete class can be created for each type of look and feel that we want and just implementing the required effects in the interfaces. An example of using Abstract factory to define different widget interfaces is shown here.&lt;br /&gt;
&lt;br /&gt;
[[File:Abstract.PNG]]&lt;br /&gt;
&lt;br /&gt;
Here in this example, the MotifWidgetFactory has its own implementation of the createScrollBar and createWindow functions that instantiate MotifWindow and MotifScrollBar. This allows any number of newer types of objects to be created by just extending the abstract class and implementing the desired features. The clients call these operations to obtain the widget instances, but they'll never know which concrete classes have been used to create them. All the operations that are done by the client is done using the Abstract factory interface. &lt;br /&gt;
&lt;br /&gt;
Abstract factory pattern helps in achieving the following, &lt;br /&gt;
# a system should be independent of how its products are created, composed, and represented.&lt;br /&gt;
# a system should be configured with one of multiple families of products.&lt;br /&gt;
# a family of related product objects is designed to be used together, and you need to enforce this constraint.&lt;br /&gt;
# you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Factory Method == &lt;br /&gt;
&lt;br /&gt;
In factory method, a class defines interface for creating an object but lets the subclasses to decide which class to instantiate. Factory methods are used in the following situations. &lt;br /&gt;
# a class can't anticipate the class of objects it must create.&lt;br /&gt;
# a class wants its subclasses to specify the objects it creates.&lt;br /&gt;
# classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate.&lt;br /&gt;
&lt;br /&gt;
In this method, there exists an Abstract Creator class, that is implemented by a ConcreteCreator class. The problem occurs when the ConcreteCreator has to create an object of Product class, but doesn't know the exact type of product is required by the object of ConcreteCreator. Such situations occur when there is no proper relation between the Product and Creator. So, it will not be possible to say that a particular type of Creator always requires a particular type of Product. So a method in ConcreteCreator is used to create an object of the required type and is therefore called a Factory method. &lt;br /&gt;
&lt;br /&gt;
The major difference between Builder pattern and Factory method is that, like Abstract factory there is no step by step process for the creation of an object. Factory method also provides a good way to connect parallel class hierarchies by allowing clients to access the factory methods for creating objects. A major advantage of using this methods is that, the factory methods can be as parameterized methods thus allowing to create a variety of different types of object as required by the Creator.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prototype Method ==&lt;br /&gt;
&lt;br /&gt;
Prototype method allows to specify the kinds of objects to create using a prototypical instance and new objects can be created by copying this prototype. This approach is mainly useful when the type of object will  not be known until runtime. Some areas where prototyping proves useful are,&lt;br /&gt;
# when the classes to instantiate are specified at run-time, for example, by dynamic loading; or&lt;br /&gt;
# to avoid building a class hierarchy of factories that parallels the class hierarchy of products; or&lt;br /&gt;
# when instances of a class can have one of only a few different combinations of state. It may be more convenient to install a corresponding number of prototypes and clone them rather than instantiating the class manually, each time with the appropriate state.&lt;br /&gt;
&lt;br /&gt;
One important aspect of the prototype method is that an object should be able to close itself in order to facilitate copying of the object. So when a clone of an object is obtained, that object can be used to represent more objects of similar type. Thus, the user need not remember more object types and the Concrete classes are hidden from the user. &lt;br /&gt;
Some of the advantages of Prototyping are,&lt;br /&gt;
# Adding and removing products at runtime - this allows the client to create any of the objects of the concrete classes at runtime by just using one prototype. Provides a much greater flexibility. &lt;br /&gt;
# Reduced Subclassing - This reduces the total number of subclasses that need to be created as the prototype method can simply call clone instead of asking a factory method to return an object. So, no creator class hierarchy is required, thus bettering Factory method in that aspect. &lt;br /&gt;
# applications can be configured dynamically.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
[2] http://en.wikipedia.org/wiki/Design_Patterns&amp;lt;br&amp;gt;&lt;br /&gt;
[3] http://www.oodesign.com/&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71276</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71276"/>
		<updated>2012-11-30T22:29:26Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Image_builder_av.png]]&lt;br /&gt;
&lt;br /&gt;
== Abstract Factory ==&lt;br /&gt;
&lt;br /&gt;
Abstract factory method, also known as Kit, provide an interface for creating families of related or dependent objects without specifying their concrete classes. The major difference between Abstract factory and builder pattern is that the focus with builder pattern is on 'step-by-step' object creation but with abstract factory, there is no step by step object creation. The object that is being created is usually created immediately and returned to the caller. The client software creates a concrete implementation of the abstract factory class and then uses the generic interfaces defined by the abstract factory to create the concrete objects according to the requirement&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Abstract_factory_pattern Abstract Factory Wiki]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Consider a case where we need to define a different look and feel for different operating systems or profiles. Hard coding them into each type can result in code duplication and also a poor quality code. This is where abstract factory pattern comes to use. A common factory class can be created for declaring an interface for creating each look and feel. Then, a concrete class can be created for each type of look and feel that we want and just implementing the required effects in the interfaces. An example of using Abstract factory to define different widget interfaces is shown here.&lt;br /&gt;
&lt;br /&gt;
[[File:Abstract.PNG]]&lt;br /&gt;
&lt;br /&gt;
Here in this example, the MotifWidgetFactory has its own implementation of the createScrollBar and createWindow functions that instantiate MotifWindow and MotifScrollBar. This allows any number of newer types of objects to be created by just extending the abstract class and implementing the desired features. The clients call these operations to obtain the widget instances, but they'll never know which concrete classes have been used to create them. All the operations that are done by the client is done using the Abstract factory interface. &lt;br /&gt;
&lt;br /&gt;
Abstract factory pattern helps in achieving the following, &lt;br /&gt;
# a system should be independent of how its products are created, composed, and represented.&lt;br /&gt;
# a system should be configured with one of multiple families of products.&lt;br /&gt;
# a family of related product objects is designed to be used together, and you need to enforce this constraint.&lt;br /&gt;
# you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Factory Method == &lt;br /&gt;
&lt;br /&gt;
In factory method, a class defines interface for creating an object but lets the subclasses to decide which class to instantiate. Factory methods are used in the following situations. &lt;br /&gt;
# a class can't anticipate the class of objects it must create.&lt;br /&gt;
# a class wants its subclasses to specify the objects it creates.&lt;br /&gt;
# classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate.&lt;br /&gt;
&lt;br /&gt;
In this method, there exists an Abstract Creator class, that is implemented by a ConcreteCreator class. The problem occurs when the ConcreteCreator has to create an object of Product class, but doesn't know the exact type of product is required by the object of ConcreteCreator. Such situations occur when there is no proper relation between the Product and Creator. So, it will not be possible to say that a particular type of Creator always requires a particular type of Product. So a method in ConcreteCreator is used to create an object of the required type and is therefore called a Factory method. &lt;br /&gt;
&lt;br /&gt;
The major difference between Builder pattern and Factory method is that, like Abstract factory there is no step by step process for the creation of an object. Factory method also provides a good way to connect parallel class hierarchies by allowing clients to access the factory methods for creating objects. A major advantage of using this methods is that, the factory methods can be as parameterized methods thus allowing to create a variety of different types of object as required by the Creator.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prototype Method ==&lt;br /&gt;
&lt;br /&gt;
Prototype method allows to specify the kinds of objects to create using a prototypical instance and new objects can be created by copying this prototype. This approach is mainly useful when the type of object will  not be known until runtime. Some areas where prototyping proves useful are,&lt;br /&gt;
# when the classes to instantiate are specified at run-time, for example, by dynamic loading; or&lt;br /&gt;
# to avoid building a class hierarchy of factories that parallels the class hierarchy of products; or&lt;br /&gt;
# when instances of a class can have one of only a few different combinations of state. It may be more convenient to install a corresponding number of prototypes and clone them rather than instantiating the class manually, each time with the appropriate state.&lt;br /&gt;
&lt;br /&gt;
One important aspect of the prototype method is that an object should be able to close itself in order to facilitate copying of the object. So when a clone of an object is obtained, that object can be used to represent more objects of similar type. Thus, the user need not remember more object types and the Concrete classes are hidden from the user. &lt;br /&gt;
Some of the advantages of Prototyping are,&lt;br /&gt;
# Adding and removing products at runtime - this allows the client to create any of the objects of the concrete classes at runtime by just using one prototype. Provides a much greater flexibility. &lt;br /&gt;
# Reduced Subclassing - This reduces the total number of subclasses that need to be created as the prototype method can simply call clone instead of asking a factory method to return an object. So, no creator class hierarchy is required, thus bettering Factory method in that aspect. &lt;br /&gt;
# applications can be configured dynamically.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
[2] http://en.wikipedia.org/wiki/Design_Patterns&amp;lt;/br&amp;gt;&lt;br /&gt;
[3] http://www.oodesign.com/&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71275</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71275"/>
		<updated>2012-11-30T22:29:12Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Image_builder_av.png]]&lt;br /&gt;
&lt;br /&gt;
== Abstract Factory ==&lt;br /&gt;
&lt;br /&gt;
Abstract factory method, also known as Kit, provide an interface for creating families of related or dependent objects without specifying their concrete classes. The major difference between Abstract factory and builder pattern is that the focus with builder pattern is on 'step-by-step' object creation but with abstract factory, there is no step by step object creation. The object that is being created is usually created immediately and returned to the caller. The client software creates a concrete implementation of the abstract factory class and then uses the generic interfaces defined by the abstract factory to create the concrete objects according to the requirement&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Abstract_factory_pattern Abstract Factory Wiki]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Consider a case where we need to define a different look and feel for different operating systems or profiles. Hard coding them into each type can result in code duplication and also a poor quality code. This is where abstract factory pattern comes to use. A common factory class can be created for declaring an interface for creating each look and feel. Then, a concrete class can be created for each type of look and feel that we want and just implementing the required effects in the interfaces. An example of using Abstract factory to define different widget interfaces is shown here.&lt;br /&gt;
&lt;br /&gt;
[[File:Abstract.PNG]]&lt;br /&gt;
&lt;br /&gt;
Here in this example, the MotifWidgetFactory has its own implementation of the createScrollBar and createWindow functions that instantiate MotifWindow and MotifScrollBar. This allows any number of newer types of objects to be created by just extending the abstract class and implementing the desired features. The clients call these operations to obtain the widget instances, but they'll never know which concrete classes have been used to create them. All the operations that are done by the client is done using the Abstract factory interface. &lt;br /&gt;
&lt;br /&gt;
Abstract factory pattern helps in achieving the following, &lt;br /&gt;
# a system should be independent of how its products are created, composed, and represented.&lt;br /&gt;
# a system should be configured with one of multiple families of products.&lt;br /&gt;
# a family of related product objects is designed to be used together, and you need to enforce this constraint.&lt;br /&gt;
# you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Factory Method == &lt;br /&gt;
&lt;br /&gt;
In factory method, a class defines interface for creating an object but lets the subclasses to decide which class to instantiate. Factory methods are used in the following situations. &lt;br /&gt;
# a class can't anticipate the class of objects it must create.&lt;br /&gt;
# a class wants its subclasses to specify the objects it creates.&lt;br /&gt;
# classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate.&lt;br /&gt;
&lt;br /&gt;
In this method, there exists an Abstract Creator class, that is implemented by a ConcreteCreator class. The problem occurs when the ConcreteCreator has to create an object of Product class, but doesn't know the exact type of product is required by the object of ConcreteCreator. Such situations occur when there is no proper relation between the Product and Creator. So, it will not be possible to say that a particular type of Creator always requires a particular type of Product. So a method in ConcreteCreator is used to create an object of the required type and is therefore called a Factory method. &lt;br /&gt;
&lt;br /&gt;
The major difference between Builder pattern and Factory method is that, like Abstract factory there is no step by step process for the creation of an object. Factory method also provides a good way to connect parallel class hierarchies by allowing clients to access the factory methods for creating objects. A major advantage of using this methods is that, the factory methods can be as parameterized methods thus allowing to create a variety of different types of object as required by the Creator.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prototype Method ==&lt;br /&gt;
&lt;br /&gt;
Prototype method allows to specify the kinds of objects to create using a prototypical instance and new objects can be created by copying this prototype. This approach is mainly useful when the type of object will  not be known until runtime. Some areas where prototyping proves useful are,&lt;br /&gt;
# when the classes to instantiate are specified at run-time, for example, by dynamic loading; or&lt;br /&gt;
# to avoid building a class hierarchy of factories that parallels the class hierarchy of products; or&lt;br /&gt;
# when instances of a class can have one of only a few different combinations of state. It may be more convenient to install a corresponding number of prototypes and clone them rather than instantiating the class manually, each time with the appropriate state.&lt;br /&gt;
&lt;br /&gt;
One important aspect of the prototype method is that an object should be able to close itself in order to facilitate copying of the object. So when a clone of an object is obtained, that object can be used to represent more objects of similar type. Thus, the user need not remember more object types and the Concrete classes are hidden from the user. &lt;br /&gt;
Some of the advantages of Prototyping are,&lt;br /&gt;
# Adding and removing products at runtime - this allows the client to create any of the objects of the concrete classes at runtime by just using one prototype. Provides a much greater flexibility. &lt;br /&gt;
# Reduced Subclassing - This reduces the total number of subclasses that need to be created as the prototype method can simply call clone instead of asking a factory method to return an object. So, no creator class hierarchy is required, thus bettering Factory method in that aspect. &lt;br /&gt;
# applications can be configured dynamically.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
[2] http://en.wikipedia.org/wiki/Design_Patterns&lt;br /&gt;
[3] http://www.oodesign.com/&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71274</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71274"/>
		<updated>2012-11-30T22:28:12Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Image_builder_av.png]]&lt;br /&gt;
&lt;br /&gt;
== Abstract Factory ==&lt;br /&gt;
&lt;br /&gt;
Abstract factory method, also known as Kit, provide an interface for creating families of related or dependent objects without specifying their concrete classes. The major difference between Abstract factory and builder pattern is that the focus with builder pattern is on 'step-by-step' object creation but with abstract factory, there is no step by step object creation. The object that is being created is usually created immediately and returned to the caller. The client software creates a concrete implementation of the abstract factory class and then uses the generic interfaces defined by the abstract factory to create the concrete objects according to the requirement&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Abstract_factory_pattern Abstract Factory Wiki]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Consider a case where we need to define a different look and feel for different operating systems or profiles. Hard coding them into each type can result in code duplication and also a poor quality code. This is where abstract factory pattern comes to use. A common factory class can be created for declaring an interface for creating each look and feel. Then, a concrete class can be created for each type of look and feel that we want and just implementing the required effects in the interfaces. An example of using Abstract factory to define different widget interfaces is shown here.&lt;br /&gt;
&lt;br /&gt;
[[File:Abstract.PNG]]&lt;br /&gt;
&lt;br /&gt;
Here in this example, the MotifWidgetFactory has its own implementation of the createScrollBar and createWindow functions that instantiate MotifWindow and MotifScrollBar. This allows any number of newer types of objects to be created by just extending the abstract class and implementing the desired features. The clients call these operations to obtain the widget instances, but they'll never know which concrete classes have been used to create them. All the operations that are done by the client is done using the Abstract factory interface. &lt;br /&gt;
&lt;br /&gt;
Abstract factory pattern helps in achieving the following, &lt;br /&gt;
# a system should be independent of how its products are created, composed, and represented.&lt;br /&gt;
# a system should be configured with one of multiple families of products.&lt;br /&gt;
# a family of related product objects is designed to be used together, and you need to enforce this constraint.&lt;br /&gt;
# you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Factory Method == &lt;br /&gt;
&lt;br /&gt;
In factory method, a class defines interface for creating an object but lets the subclasses to decide which class to instantiate. Factory methods are used in the following situations. &lt;br /&gt;
# a class can't anticipate the class of objects it must create.&lt;br /&gt;
# a class wants its subclasses to specify the objects it creates.&lt;br /&gt;
# classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate.&lt;br /&gt;
&lt;br /&gt;
In this method, there exists an Abstract Creator class, that is implemented by a ConcreteCreator class. The problem occurs when the ConcreteCreator has to create an object of Product class, but doesn't know the exact type of product is required by the object of ConcreteCreator. Such situations occur when there is no proper relation between the Product and Creator. So, it will not be possible to say that a particular type of Creator always requires a particular type of Product. So a method in ConcreteCreator is used to create an object of the required type and is therefore called a Factory method. &lt;br /&gt;
&lt;br /&gt;
The major difference between Builder pattern and Factory method is that, like Abstract factory there is no step by step process for the creation of an object. Factory method also provides a good way to connect parallel class hierarchies by allowing clients to access the factory methods for creating objects. A major advantage of using this methods is that, the factory methods can be as parameterized methods thus allowing to create a variety of different types of object as required by the Creator.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prototype Method ==&lt;br /&gt;
&lt;br /&gt;
Prototype method allows to specify the kinds of objects to create using a prototypical instance and new objects can be created by copying this prototype. This approach is mainly useful when the type of object will  not be known until runtime. Some areas where prototyping proves useful are,&lt;br /&gt;
# when the classes to instantiate are specified at run-time, for example, by dynamic loading; or&lt;br /&gt;
# to avoid building a class hierarchy of factories that parallels the class hierarchy of products; or&lt;br /&gt;
# when instances of a class can have one of only a few different combinations of state. It may be more convenient to install a corresponding number of prototypes and clone them rather than instantiating the class manually, each time with the appropriate state.&lt;br /&gt;
&lt;br /&gt;
One important aspect of the prototype method is that an object should be able to close itself in order to facilitate copying of the object. So when a clone of an object is obtained, that object can be used to represent more objects of similar type. Thus, the user need not remember more object types and the Concrete classes are hidden from the user. &lt;br /&gt;
Some of the advantages of Prototyping are,&lt;br /&gt;
# Adding and removing products at runtime - this allows the client to create any of the objects of the concrete classes at runtime by just using one prototype. Provides a much greater flexibility. &lt;br /&gt;
# Reduced Subclassing - This reduces the total number of subclasses that need to be created as the prototype method can simply call clone instead of asking a factory method to return an object. So, no creator class hierarchy is required, thus bettering Factory method in that aspect. &lt;br /&gt;
# applications can be configured dynamically.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
[2] http://en.wikipedia.org/wiki/Design_Patterns&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012&amp;diff=71220</id>
		<title>CSC/ECE 517 Fall 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012&amp;diff=71220"/>
		<updated>2012-11-22T01:38:19Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE_517_Fall_2012/Table_Of_Contents]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 n xx]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w1 rk]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w20 pp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w5 su]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w6 pp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w4 aj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w7 am]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w8 aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w9 av]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w10 pk]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w11 ap]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1a 1w12 mv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w14 gv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w17 ir]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w18 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w22 an]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w21 aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w21 wi]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w31 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1a 1w16 br]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1a 1w23 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w24 nr]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w15 rt]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w3 pl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w32 cm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w5 dp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w37 ss]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w67 ks]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w27 ms]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w29 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w33 op]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w19 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w34 vd]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w35 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w30 rp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w58 am]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w47 sk]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w69 mv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w44 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w45 is]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w53 kc]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w40 ar]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w39 sn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w54 go]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w56 ms]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w64 nn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w66 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w40 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w42 js]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w46 sm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w71 gs]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w63 dv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w55 ms]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w57 mp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w52 an]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch1b 1w38 nm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w60 ac]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 1w62 rb]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w29 st]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w3_sm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w30 an]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w17 pt]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w31 up]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w9 ms]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w19 is]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w26 aj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w5 dp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w16 dp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w8 vp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w18 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w3 jm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w23 sr]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w11_aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w15 rr]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2a 2w33 pv]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w20_aa]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w14_bb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w21_ap]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w13_sm]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w4_sa]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w25_nr]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w12_sv]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w7_ma]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w6_ar]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w32_mk]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2a_2w10_rc]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w70_sm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w67_sk]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w40_sn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w22_sk]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w-1w65_am]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w59_bc]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w60_ns]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b 2w47 am]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w69_as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w39_ka]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2b_2w35_av]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w36_av]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w37_ms]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w43_iv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w53_iv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w63_sp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b 2w68 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w49_ps]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w52_sj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w28_dh]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1b 2w41 dc]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2b_1w59_nm]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2b_1w61_ps]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2b_2w57]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2b_2w42_aa]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2b_1w61_ns]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2b_2w51_aa]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch2b_2w45_pg]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_2w48_aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b_1w70_nl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b 2w64 bg]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b 2w62 pv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch2b 2w34 mr]]&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71179</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71179"/>
		<updated>2012-11-20T05:16:05Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Image_builder_av.png]]&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71178</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71178"/>
		<updated>2012-11-20T05:15:52Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;br /&gt;
&lt;br /&gt;
[[File:Image_builder_av.png]]&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Image_builder_av.png&amp;diff=71177</id>
		<title>File:Image builder av.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Image_builder_av.png&amp;diff=71177"/>
		<updated>2012-11-20T05:15:24Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71176</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71176"/>
		<updated>2012-11-20T05:14:42Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;br /&gt;
&lt;br /&gt;
[[File:image.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:]]&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71174</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71174"/>
		<updated>2012-11-20T05:13:32Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;br /&gt;
&lt;br /&gt;
[[File:]]&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71168</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71168"/>
		<updated>2012-11-20T04:54:20Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71165</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71165"/>
		<updated>2012-11-20T04:50:28Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;br /&gt;
&lt;br /&gt;
[http://creately.com/diagram/example/h9qitehe1]&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71160</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71160"/>
		<updated>2012-11-20T04:28:26Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us consider an example for builder pattern. Consider a word processing software that should have the ability to convert Microsoft word's DOC to many text formats. The reader might convert *.DOC documents into plain ASCII text or into a PDF. The problem, however, is that the number of possible conversions is open-ended. So it should be easy to add a new conversion without modifying the reader.&lt;br /&gt;
&lt;br /&gt;
A solution is to configure the DOCReader class with a TextConverter object that converts DOC to another textual representation. As the DOCReader parses the DOC document, it uses the TextConverter to perform the conversion. Whenever the DOCReader recognizes an DOC token (either plain text or an RTF control word), it issues a request to the TextConverter to convert the token. TextConverter objects are responsible both for performing the data conversion and for representing the token in a particular format. Subclasses of TextConverter specialize in different conversions and formats. For example, an PlainTextConverter ignores requests to convert anything except plain text. A LaTeXConverter, on the other hand, will implement operations for all requests in order to produce a LaTeX representation that captures all the stylistic information in the text.&lt;br /&gt;
&lt;br /&gt;
Each kind of converter class takes the mechanism for creating and assembling a complex object and puts it behind an abstract interface. The converter is separate from the reader, which is responsible for parsing an DOC document. Converter class designed as discussed above basically defines the builder design pattern.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71150</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71150"/>
		<updated>2012-11-20T04:16:48Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71148</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71148"/>
		<updated>2012-11-20T04:16:34Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &amp;lt;/br&amp;gt;&lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled. &amp;lt;/br&amp;gt;&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed. &amp;lt;/br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71147</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71147"/>
		<updated>2012-11-20T04:16:05Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &lt;br /&gt;
1. The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled.&lt;br /&gt;
2. The construction process must allow different representations for the object that's constructed.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71145</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71145"/>
		<updated>2012-11-20T04:15:26Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder Pattern */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations. According to GOF [http://en.wikipedia.org/wiki/Design_Patterns[1]], the builder pattern can be applied when &lt;br /&gt;
&lt;br /&gt;
 the algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled.&lt;br /&gt;
 the construction process must allow different representations for the object that's constructed.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71140</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71140"/>
		<updated>2012-11-20T04:11:42Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Classes of Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71139</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71139"/>
		<updated>2012-11-20T04:11:20Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Classes of Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
 Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
 Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71138</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71138"/>
		<updated>2012-11-20T04:11:00Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Classes of Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
 Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
 Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
 Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71137</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71137"/>
		<updated>2012-11-20T04:10:19Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Classes of Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
[Creational Pattern], which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
[Structural Pattern], which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
[Behavioral Pattern], which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71136</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71136"/>
		<updated>2012-11-20T04:09:30Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Builder pattern and the related patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Classes of Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Builder Pattern ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71135</id>
		<title>CSC/ECE 517 Fall 2012/ch2b 2w35 av</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch2b_2w35_av&amp;diff=71135"/>
		<updated>2012-11-20T04:08:45Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: Created page with &amp;quot; == Builder pattern and the related patterns ==  Introduction:  One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an o...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Builder pattern and the related patterns ==&lt;br /&gt;
&lt;br /&gt;
Introduction:&lt;br /&gt;
&lt;br /&gt;
One of the most complex tasks in creating a software is designing it to meet the needs of the user. Designing an object-oriented components of software that is reusable is hard. One must find pertinent objects, factor them into classes at the right granularity, define class interfaces and inheritance hierarchies, and establish key relationships among them. It should also be taken care that the design is specific to a problem at hand and also general enough to accommodate future changes. Knowledge of design patterns helps in such scenarios. Essentially, Design patterns describe a problem which occurs over and over again in an environment, and then describes the core of the solution to that problem, in such a way that one can use this solution a million times over, without ever doing it the same way twice&lt;br /&gt;
&lt;br /&gt;
Classes of Design Patterns&lt;br /&gt;
&lt;br /&gt;
Design patterns are generally classified into the one of the following three categories.&lt;br /&gt;
&lt;br /&gt;
Creational Pattern, which help create the objects for the user, instead of having the user to instantiate the object.&lt;br /&gt;
Structural Pattern, which employ interfaces to achieve inheritance to enable objects to obtain new functionality.&lt;br /&gt;
Behavioral Pattern, which are concerned with communication between objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Builder Pattern:&lt;br /&gt;
&lt;br /&gt;
The intent of Builder pattern is to separate the construction of a complex object from its representation so that the same construction process can create different representations.&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64908</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64908"/>
		<updated>2012-09-15T00:19:49Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Car color:string maker:string model:number year:date&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables do not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs.&lt;br /&gt;
&lt;br /&gt;
Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
For example if one wants to create a web application for a bookstore, they need to create a book domain class.&lt;br /&gt;
 &lt;br /&gt;
 class Book {&lt;br /&gt;
    String title&lt;br /&gt;
    Date releaseDate&lt;br /&gt;
    String ISBN&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
&lt;br /&gt;
 class SomeController {&lt;br /&gt;
    static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; A more detailed listing of examples of scaffolding in various other web frameworks can also be found in last year's treatment of the same topic here.&amp;lt;br&amp;gt;http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&amp;lt;br&amp;gt;7. http://grails.org/doc/latest/guide/scaffolding.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64906</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64906"/>
		<updated>2012-09-15T00:19:21Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Other Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Car color:string maker:string model:number year:date&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables do not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs.&lt;br /&gt;
&lt;br /&gt;
Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
For example if one wants to create a web application for a bookstore, they need to create a book domain class.&lt;br /&gt;
 &lt;br /&gt;
 class Book {&lt;br /&gt;
    String title&lt;br /&gt;
    Date releaseDate&lt;br /&gt;
    String ISBN&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
&lt;br /&gt;
 class SomeController {&lt;br /&gt;
    static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&amp;lt;br&amp;gt;7. http://grails.org/doc/latest/guide/scaffolding.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64905</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64905"/>
		<updated>2012-09-15T00:18:41Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* External Sites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Car color:string maker:string model:number year:date&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables do not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs.&lt;br /&gt;
&lt;br /&gt;
Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
For example if one wants to create a web application for a bookstore, they need to create a book domain class.&lt;br /&gt;
 &lt;br /&gt;
 class Book {&lt;br /&gt;
    String title&lt;br /&gt;
    Date releaseDate&lt;br /&gt;
    String ISBN&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
&lt;br /&gt;
 class SomeController {&lt;br /&gt;
    static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&amp;lt;br&amp;gt;7. http://grails.org/doc/latest/guide/scaffolding.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64904</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64904"/>
		<updated>2012-09-15T00:17:16Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Dynamic Scaffolding in Grails */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Car color:string maker:string model:number year:date&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables do not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs.&lt;br /&gt;
&lt;br /&gt;
Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
For example if one wants to create a web application for a bookstore, they need to create a book domain class.&lt;br /&gt;
 &lt;br /&gt;
 class Book {&lt;br /&gt;
    String title&lt;br /&gt;
    Date releaseDate&lt;br /&gt;
    String ISBN&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
&lt;br /&gt;
 class SomeController {&lt;br /&gt;
    static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64897</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64897"/>
		<updated>2012-09-15T00:12:11Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Dynamic Scaffolding in Grails */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Car color:string maker:string model:number year:date&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables do not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs.&lt;br /&gt;
&lt;br /&gt;
Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
For example if one wants to create a web application for a library, the simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
&lt;br /&gt;
class SomeController {&lt;br /&gt;
    static scaffold = Author&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64890</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64890"/>
		<updated>2012-09-15T00:08:38Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Dynamic Scaffolding in Grails */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Car color:string maker:string model:number year:date&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables do not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs.&lt;br /&gt;
&lt;br /&gt;
Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64883</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64883"/>
		<updated>2012-09-15T00:04:23Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Static Scaffolding in Rails Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Car color:string maker:string model:number year:date&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables do not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs.&lt;br /&gt;
&lt;br /&gt;
Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64880</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64880"/>
		<updated>2012-09-15T00:03:24Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Static Scaffolding in Rails Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Car color:string maker:string model:number year:date&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables do not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64876</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64876"/>
		<updated>2012-09-15T00:01:40Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Static Scaffolding in Rails Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Post title: string content:text category_id: integer&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables do not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64874</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64874"/>
		<updated>2012-09-15T00:01:19Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Static Scaffolding in Rails Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Post title: string content:text category_id: integer&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64873</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64873"/>
		<updated>2012-09-15T00:00:46Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Static Scaffolding in Rails Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
 &amp;quot;scaffold Post title: string content:text category_id: integer&amp;quot;&lt;br /&gt;
to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64867</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64867"/>
		<updated>2012-09-14T23:58:11Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Current Scaffolding Scope */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development softwares that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64865</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64865"/>
		<updated>2012-09-14T23:56:49Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Scaffolding Theory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Origin in Web Applications ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64858</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64858"/>
		<updated>2012-09-14T23:54:24Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* MediaSite */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
=== MediaSite ===&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64856</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64856"/>
		<updated>2012-09-14T23:54:14Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* External Sites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
=== External Sites ===&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64855</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64855"/>
		<updated>2012-09-14T23:54:02Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64852</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64852"/>
		<updated>2012-09-14T23:53:31Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;4. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;5. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64849</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64849"/>
		<updated>2012-09-14T23:52:41Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding Theory ===&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== What Scaffolding is Today? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Current Scaffolding Scope ====&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in MVC based Web Frameworks ===&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Static Scaffolding in Rails Framework ====&lt;br /&gt;
&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
==== Dynamic Scaffolding in Grails ====&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. Grails Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;4. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;5. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;6. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64844</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64844"/>
		<updated>2012-09-14T23:49:39Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in General ===&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
=== Scaffolding in Programming ===&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== History of Scaffolding ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding Theory ==&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Scaffolding is Today? ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Current Scaffolding Scope ==&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in MVC based Web Frameworks ==&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
Scaffolding in Rails Framework&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
== Dynamic Scaffolding in Grails ==&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. Grails Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;4. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;5. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;6. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012&amp;diff=64843</id>
		<title>CSC/ECE 517 Fall 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012&amp;diff=64843"/>
		<updated>2012-09-14T23:48:02Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE 517 Fall 2012/ch1 n xx]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w1 rk]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w20 pp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w5 su]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w6 pp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w7 am]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w8 aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w9 av]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w10 pk]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1a 1w12 mv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w14 gv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w17 ir]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w18 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w22 an]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w21 aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w21 wi]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w31 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1a 1w16 br]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1a 1w23 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w24 nr]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w15 rt]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w3 pl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w32 cm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w27 ms]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w29 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w33 op]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w19 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w34 vd]]&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012&amp;diff=64842</id>
		<title>CSC/ECE 517 Fall 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012&amp;diff=64842"/>
		<updated>2012-09-14T23:47:30Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE 517 Fall 2012/ch1 n xx]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w1 rk]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w20 pp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w5 su]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w6 pp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w7 am]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w8 aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w9 av]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w10 pk]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2012/ch1a 1w12 mv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w14 gv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w17 ir]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w18 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w22 an]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w21 aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w21 wi]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w31 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1a 1w16 br]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1a 1w23 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w24 nr]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w15 rt]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w3 pl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w32 cm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w27 ms]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w29 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w33 op]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w19 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2012/ch1 1w34 vd]]&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64831</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64831"/>
		<updated>2012-09-14T23:44:31Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Scaffolding in General */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in General ==&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it.&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in Programming ==&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== History of Scaffolding ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding Theory ==&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Scaffolding is Today? ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Current Scaffolding Scope ==&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in MVC based Web Frameworks ==&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
Scaffolding in Rails Framework&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
== Dynamic Scaffolding in Grails ==&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. Grails Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;4. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;5. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;6. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64830</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64830"/>
		<updated>2012-09-14T23:44:04Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Scaffolding in MVC based Web Frameworks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in General ==&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in Programming ==&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== History of Scaffolding ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding Theory ==&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Scaffolding is Today? ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Current Scaffolding Scope ==&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in MVC based Web Frameworks ==&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
Scaffolding in Rails Framework&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the create_cars.rb file, select the rake menu option and then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
== Dynamic Scaffolding in Grails ==&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. Grails Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;4. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;5. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;6. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64824</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64824"/>
		<updated>2012-09-14T23:42:15Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* Scaffolding in MVC based Web Frameworks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in General ==&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in Programming ==&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== History of Scaffolding ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding Theory ==&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Scaffolding is Today? ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Current Scaffolding Scope ==&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in MVC based Web Frameworks ==&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
Scaffolding in Rails Framework&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the&lt;br /&gt;
&amp;lt;br&amp;gt;	create_cars.rb file,&lt;br /&gt;
&amp;lt;br&amp;gt;	select the rake menu option and&lt;br /&gt;
&amp;lt;br&amp;gt;	then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars (unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
== Dynamic Scaffolding in Grails ==&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. Grails Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;4. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;5. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;6. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64812</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64812"/>
		<updated>2012-09-14T23:39:38Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in General ==&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in Programming ==&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== History of Scaffolding ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding Theory ==&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Scaffolding is Today? ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Current Scaffolding Scope ==&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in MVC based Web Frameworks ==&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
Scaffolding in Rails Framework&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the&lt;br /&gt;
&amp;lt;br&amp;gt;	create_cars.rb file,&lt;br /&gt;
&amp;lt;br&amp;gt;	select the rake menu option and&lt;br /&gt;
&amp;lt;br&amp;gt;	then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars(unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
== Dynamic Scaffolding in Grails ==&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
&amp;lt;br&amp;gt;1. CakePHP Framework&lt;br /&gt;
&amp;lt;br&amp;gt;2. Grails Framework&lt;br /&gt;
&amp;lt;br&amp;gt;3. ASP.NET Framework&lt;br /&gt;
&amp;lt;br&amp;gt;4. Codeigniter&lt;br /&gt;
&amp;lt;br&amp;gt;5. iPhone&lt;br /&gt;
&amp;lt;br&amp;gt;6. NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64803</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64803"/>
		<updated>2012-09-14T23:38:31Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* MediaSite */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in General ==&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in Programming ==&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== History of Scaffolding ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding Theory ==&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Scaffolding is Today? ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Current Scaffolding Scope ==&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in MVC based Web Frameworks ==&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
Scaffolding in Rails Framework&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the&lt;br /&gt;
&amp;lt;br&amp;gt;	create_cars.rb file,&lt;br /&gt;
&amp;lt;br&amp;gt;	select the rake menu option and&lt;br /&gt;
&amp;lt;br&amp;gt;	then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars(unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
== Dynamic Scaffolding in Grails ==&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
1.	CakePHP Framework&lt;br /&gt;
2.	Grails Framework&lt;br /&gt;
3.	ASP.NET Framework&lt;br /&gt;
4.	Codeigniter&lt;br /&gt;
5.	iPhone&lt;br /&gt;
6.	NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64800</id>
		<title>CSC/ECE 517 Fall 2012/ch1a 1w12 mv</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2012/ch1a_1w12_mv&amp;diff=64800"/>
		<updated>2012-09-14T23:38:10Z</updated>

		<summary type="html">&lt;p&gt;Vpadman2: /* External Sites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in General ==&lt;br /&gt;
Scaffold is a temporary platform, either supported from below or suspended from above, on which workers sit or stand when performing tasks at heights above the ground. Because of its nature of its use, it must made sure that it is properly constructed and ensures the safety of those who use it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in Programming ==&lt;br /&gt;
Deriving from the analogy above, scaffolding in web application framework refers to providing a minimal setup for various components that make a web application. These components include but are not limited to databases, application servers and web servers. Such scaffolds are generally standard, bare minimal and reusable components that are automatically generated.&lt;br /&gt;
&lt;br /&gt;
A typical web application contains a database layer for retrieval and storage of information. The basic operations performed to access the database are grouped into the following types, which are commonly referred to as the CRUD functionality.&lt;br /&gt;
&lt;br /&gt;
 Create&lt;br /&gt;
 Read&lt;br /&gt;
 Update&lt;br /&gt;
 Delete&lt;br /&gt;
&lt;br /&gt;
A scaffold for web application will typically provide stubs for performing the above mentioned CRUD functions. This boilerplate code provides the essential infrastructure to develop  a web application in quick time.&lt;br /&gt;
&lt;br /&gt;
MVC framework is a popular web application framework that separates concerns and applications into model, view and controllers. In  MVC, scaffolding will usually create basic model, views and controllers and also the database objects needed.&lt;br /&gt;
&lt;br /&gt;
== History of Scaffolding ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Origin and Evolution ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Scaffolding Theory ==&lt;br /&gt;
&lt;br /&gt;
Scaffolding theory in education came into being in 1950, by, Jerome Bruner, where he described the various scaffolding techniques for oral language and written vocabulary. In Oral scaffolding, parents and adults help the children to make them know how to speak and communicate, how they should develop the base or a temporary framework for their children to walk in the new world. Similarly, in written scaffolding, typical supporting instructions were given by the instructor to the students to learn vocabulary, to calibrate the task, to identify the task and work independently on the task, in this way they built the scaffold for them on which they can lean on while learning.&lt;br /&gt;
Scaffolding Origin in Web Applications&lt;br /&gt;
Scaffolding has been around in various forms for some time. Earlier, certain development environment included application code module generators such as Oracle's CASE generators. They were often the third party generators which offered varying capabilities and mainly acted as database code generators.&lt;br /&gt;
One could also have custom scripts, which could generate the CRUD screens from some database specifications. Often each new project involved writing up some templates to get the basic functionality or writing a template generator script, which created these templates for a project. But these generators and scripts were non-standardized and often viewed as taking time away from the core development of an application. In order to aid in faster application development and also standardize the code generation,  the concept of scaffolding were introduced in web application frameworks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Scaffolding is Today? ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Current Scaffolding Scope ==&lt;br /&gt;
&lt;br /&gt;
With the advancement in technologies such as network, processors, browsers, thin client, software development has moved from a desktop application model to a web application/web services mode. This paradigm shift has caused a need for better server side and client side frameworks that aid in faster application development. Consequently, Scaffolding is now a part of many web application frameworks. We can find a number of development software’s that uses web application scaffolding approach. Frameworks include,&lt;br /&gt;
 Ruby on Rails&lt;br /&gt;
 CakePHP&lt;br /&gt;
 ASP.NET&lt;br /&gt;
 CodeIgniter&lt;br /&gt;
 Phone Web Scaffolding&lt;br /&gt;
 Grails&lt;br /&gt;
These frameworks actually contain some software components that create the skeletal attachments to the application’s database and other external devices.&lt;br /&gt;
&lt;br /&gt;
There are primarily two kinds of scaffolding that are available as a part of web application today,&lt;br /&gt;
&lt;br /&gt;
1) Dynamic Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Dynamic scaffold works by dynamically generating all the views and controllers at runtime so the user won't actually see any new views or controllers as part of their application. It'll also let you make minor customizations to that  user interface via settings in the model itself.&lt;br /&gt;
&lt;br /&gt;
2) Static Scaffolding&lt;br /&gt;
&amp;lt;br&amp;gt;     Static scaffolding works by generating actual views and controllers from the command line so that one can actually change the logic of the scaffolding via the controllers or change the look and feel of it through the views that it generates. Static scaffolding is quite a bit more flexible than dynamic scaffolding.&lt;br /&gt;
&lt;br /&gt;
We will see how scaffolding works in various web application frameworks.&lt;br /&gt;
&lt;br /&gt;
== Scaffolding in MVC based Web Frameworks ==&lt;br /&gt;
&lt;br /&gt;
MVC is a design paradigm that originated from user interface development. MVC basically deals with the separations of concern between model, view and business logic. Several commercial and non commercial application framework have been created to enforce the design. Rails also uses MVC framework to implement web applications, and scaffolding helps to generate this model-view-controller code that we see in detail.&lt;br /&gt;
First we will describe how the scaffolding approach works in Rails framework. Scaffolding gets its popularity with the rails framework only, and it comes as the inbuilt feature of the rails framework.&lt;br /&gt;
Scaffolding in Rails Framework&lt;br /&gt;
Rails implements static scaffolding, where the user specifies the command &lt;br /&gt;
&amp;quot; scaffold Post title: string content:text category_id: integer&amp;quot;  to generate the scaffold. This creates model, view and controller for the entity &amp;quot;Post&amp;quot;. The user can change the functionality of these components.&lt;br /&gt;
&lt;br /&gt;
Now lets see how scaffolding in the rails framework helps to create the database schema at the start of an application by using very simple commands. Follow these steps in the Eclipse IDE to create a scaffolding of a car website. We just define some attributes of a car like its color, year and model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Step -1. Create New Rails Project: New-&amp;gt;New Rails Project&lt;br /&gt;
&amp;lt;br&amp;gt; Step -2. Get the generator view: Window-&amp;gt;Show View-&amp;gt;Generators&lt;br /&gt;
&amp;lt;br&amp;gt; Step -3. Make sure current project for Generator is the project that you want.&lt;br /&gt;
&amp;lt;br&amp;gt; Step -4. Select the scaffold generator from drop down box: Generator-&amp;gt;scaffold&lt;br /&gt;
&amp;lt;br&amp;gt; Step -5. In parameters, specify the model, fields and their type Here we take, Car color:string maker:string year:date&lt;br /&gt;
&amp;lt;br&amp;gt; Step -6. This will run the generate script and create files in View, controllers, model, db etc as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;script/generate scaffold Car color:string maker:string model:number year:date&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists app/controllers/&lt;br /&gt;
 exists app/helpers/&lt;br /&gt;
 create app/views/cars&lt;br /&gt;
 exists app/views/layouts/&lt;br /&gt;
 exists test/functional/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/unit/helpers/&lt;br /&gt;
 exists public/stylesheets/&lt;br /&gt;
 create app/views/cars/index.html.erb&lt;br /&gt;
 create app/views/cars/show.html.erb&lt;br /&gt;
 create app/views/cars/new.html.erb&lt;br /&gt;
 create app/views/cars/edit.html.erb&lt;br /&gt;
 create app/views/layouts/cars.html.erb&lt;br /&gt;
 create public/stylesheets/scaffold.css&lt;br /&gt;
 create app/controllers/cars_controller.rb&lt;br /&gt;
 create test/functional/cars_controller_test.rb&lt;br /&gt;
 create app/helpers/cars_helper.rb&lt;br /&gt;
 create test/unit/helpers/cars_helper_test.rb&lt;br /&gt;
 route  map.resources :cars&lt;br /&gt;
 dependency model&lt;br /&gt;
 exists app/models/&lt;br /&gt;
 exists test/unit/&lt;br /&gt;
 exists test/fixtures/&lt;br /&gt;
 create app/models/car.rb&lt;br /&gt;
 create test/unit/car_test.rb&lt;br /&gt;
 create test/fixtures/cars.yml&lt;br /&gt;
 create db/migrate&lt;br /&gt;
 create db/migrate/20100919144829_create_cars.rb&lt;br /&gt;
&lt;br /&gt;
The framework automatically generates all the database models and code for rendering the views. However at this point the database tables not  exist. It also creates a file containing the schema for the model requested by the user as shown below. &lt;br /&gt;
&lt;br /&gt;
 class CreateCars &amp;lt; ActiveRecord::Migration &lt;br /&gt;
 def self.up&lt;br /&gt;
  create_table :cars do |t|&lt;br /&gt;
  t.string :color&lt;br /&gt;
  t.string :maker&lt;br /&gt;
  t.number :model&lt;br /&gt;
  t.date :year&lt;br /&gt;
  t.timestamps&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def self.down&lt;br /&gt;
  drop_table :cars&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -7 You then run a rake task to actually create the database tables using the migrate file.&lt;br /&gt;
&amp;lt;br&amp;gt;Step -8 Now go to Window-&amp;gt;Show View-&amp;gt;Rake&lt;br /&gt;
&amp;lt;br&amp;gt;Step -9 In the Rake window, select migrate task from the drop down box and run it.&lt;br /&gt;
&lt;br /&gt;
You can also right click the&lt;br /&gt;
&amp;lt;br&amp;gt;	create_cars.rb file,&lt;br /&gt;
&amp;lt;br&amp;gt;	select the rake menu option and&lt;br /&gt;
&amp;lt;br&amp;gt;	then select migrate option.&lt;br /&gt;
&lt;br /&gt;
 rake db:migrate&lt;br /&gt;
&lt;br /&gt;
This command would actually create the tables defined in the schema.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Step -10 You can then go to your sqlite database and check that tables have been created.&lt;br /&gt;
&lt;br /&gt;
Scaffold will always generate the tables in the Development database. With this you now have a functioning application. Start the web server and point your browser to http://localhost:3000/cars(unless you decided to override the defaults). You will be presented with a basic screen showing all the cars and their details. Links to web pages to add, edit and destroy a record are also provided. Using these, you can modify existing records or add new records. Sample auto generated code for the above example is as below.&lt;br /&gt;
Controller for car in cars_controller.rb&lt;br /&gt;
 class CarsController &amp;lt; ApplicationController&lt;br /&gt;
  # GET /cars&lt;br /&gt;
  # GET /cars.xml&lt;br /&gt;
  def index&lt;br /&gt;
    @cars = Car.all&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # index.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @cars }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1&lt;br /&gt;
  # GET /cars/1.xml&lt;br /&gt;
  def show&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # show.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/new&lt;br /&gt;
  # GET /cars/new.xml&lt;br /&gt;
  def new&lt;br /&gt;
    @car = Car.new&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html # new.html.erb&lt;br /&gt;
      format.xml  { render :xml =&amp;gt; @car }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # GET /cars/1/edit&lt;br /&gt;
  def edit&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
  # POST /cars&lt;br /&gt;
  # POST /cars.xml&lt;br /&gt;
  def create&lt;br /&gt;
    @car = Car.new(params[:car])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.save&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully created.') }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car, :status =&amp;gt; :created, :location =&amp;gt; @car }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;new&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PUT /cars/1&lt;br /&gt;
  # PUT /cars/1.xml&lt;br /&gt;
  def update&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      if @car.update_attributes(params[:car])&lt;br /&gt;
        format.html { redirect_to(@car, :notice =&amp;gt; 'Car was successfully updated.') }&lt;br /&gt;
        format.xml  { head :ok }&lt;br /&gt;
      else&lt;br /&gt;
        format.html { render :action =&amp;gt; &amp;quot;edit&amp;quot; }&lt;br /&gt;
        format.xml  { render :xml =&amp;gt; @car.errors, :status =&amp;gt; :unprocessable_entity }&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /cars/1&lt;br /&gt;
  # DELETE /cars/1.xml&lt;br /&gt;
  def destroy&lt;br /&gt;
    @car = Car.find(params[:id])&lt;br /&gt;
    @car.destroy&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.html { redirect_to(cars_url) }&lt;br /&gt;
      format.xml  { head :ok }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
As seen above the controller.rb files contain the controller generated through the scaffolding process. The user is allowed to make changes to the controller to customize the application to his or her needs. Sample view file for EDIT generated in views-&amp;gt;cars-&amp;gt;edit.html.erb&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;/nowiki&amp;gt;Editing car&amp;lt;nowiki&amp;gt;&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;% form_for(@car) do |f| %&amp;gt;&lt;br /&gt;
  &amp;lt;%= f.error_messages %&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :color %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :color %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt; &amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :maker %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :maker %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :model %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.text_field :model %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.label :year %&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.date_select :year %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.submit 'Update' %&amp;gt;&lt;br /&gt;
  &amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Show', @car %&amp;gt; |&lt;br /&gt;
 &amp;lt;%= link_to 'Back', cars_path %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the controllers, the views can also be edited to allow customization.&lt;br /&gt;
&lt;br /&gt;
== Dynamic Scaffolding in Grails ==&lt;br /&gt;
&lt;br /&gt;
Grails supports dynamic and static scaffolding. As we have already seen static scaffolding, we will see how dynamic scaffolding is implemented in grails with a single statement&lt;br /&gt;
 &amp;quot;static scaffold =true&amp;quot;&lt;br /&gt;
The simplest way to get started with scaffolding is to enable it with the scaffold property. Set the scaffold property in the controller to true for the Book domain class:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
   static scaffold = true&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This works because the BookController follows the same naming convention as the Book domain class. To scaffold a specific domain class we could reference the class directly in the scaffold property:&lt;br /&gt;
 &lt;br /&gt;
 class SomeController {&lt;br /&gt;
     static scaffold = Author&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
With this configured, when you start your application the actions and views will be auto-generated at runtime. The following actions are dynamically implemented by default by the runtime scaffolding mechanism:&lt;br /&gt;
 list&lt;br /&gt;
 show&lt;br /&gt;
 edit&lt;br /&gt;
 delete&lt;br /&gt;
 create&lt;br /&gt;
 save&lt;br /&gt;
 update&lt;br /&gt;
&lt;br /&gt;
A CRUD interface will also be generated. To access this open http://localhost:8080/app/book in a browser.&lt;br /&gt;
You can add new actions to a scaffolded controller, for example:&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    def changeAuthor() {&lt;br /&gt;
        def b = Book.get(params.id)&lt;br /&gt;
        b.author = Author.get(params[&amp;quot;author.id&amp;quot;])&lt;br /&gt;
        b.save()&lt;br /&gt;
        // redirect to a scaffolded action&lt;br /&gt;
        redirect(action:show)&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
You can also override the scaffolded actions:&lt;br /&gt;
&lt;br /&gt;
 class BookController {&lt;br /&gt;
    static scaffold = Book&lt;br /&gt;
    // overrides scaffolded action to return both authors and books&lt;br /&gt;
    def list() {&lt;br /&gt;
        [bookInstanceList: Book.list(),&lt;br /&gt;
         bookInstanceTotal: Book.count(),&lt;br /&gt;
         authorInstanceList: Author.list()]&lt;br /&gt;
    }&lt;br /&gt;
    def show() {&lt;br /&gt;
        def book = Book.get(params.id)&lt;br /&gt;
        log.error(book)&lt;br /&gt;
        [bookInstance : book]&lt;br /&gt;
    }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
All of this is what is known as &amp;quot;dynamic scaffolding&amp;quot; where the CRUD interface is generated dynamically at runtime.&lt;br /&gt;
&lt;br /&gt;
== Other Examples ==&lt;br /&gt;
&lt;br /&gt;
Apache Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Tapestry includes some scaffolding components that generate code at runtime thus allowing an application to be dynamically assembled at runtime. The two main scaffolding components are &lt;br /&gt;
&lt;br /&gt;
BeanEditForm - A component that creates an entire form editing the properties of a particular bean. It generates a simple UI for editing the properties of a JavaBean, with the flavor of UI for each property (text field, checkbox, drop down list) determined from the property type (or by other means, such as an annotation), and the order and validation for the properties determined from annotations on the property's getter and setter methods.&lt;br /&gt;
&lt;br /&gt;
Grid - A grid presents tabular data. It is a composite component, created in terms of several sub-components. The sub-components are statically wired to the Grid, as it provides access to the data and other models that they need. A Grid may operate inside a form.&lt;br /&gt;
&lt;br /&gt;
A more detailed listing of examples of scaffolding in various other web frameworks can be found in last year's treatment of the same topic here.&lt;br /&gt;
http://pg-server.csc.ncsu.edu/mediawiki/index.php/CSC/ECE_517_Fall_2009/wiki1b_9_ss&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Thus we have discussed scaffolding in general and how it was realized for web application development. We also discussed the various types of scaffolding and how they are implemented in some of the popular web application frameworks. These bare minimal, reusable, and standard code make web application development a easy task.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
You can go through some of the other frameworks to create scaffold web applications.&lt;br /&gt;
1.	CakePHP Framework&lt;br /&gt;
2.	Grails Framework&lt;br /&gt;
3.	ASP.NET Framework&lt;br /&gt;
4.	Codeigniter&lt;br /&gt;
5.	iPhone&lt;br /&gt;
6.	NetBeans CRUD Generator&lt;br /&gt;
&lt;br /&gt;
== Bibiliography ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. Programming Ruby(2nd Edition): The Pragmatic Programmers' Guide (Pragmatic Programmers Series), by Dave Thomas, &lt;br /&gt;
Andy Hunt, Andrew Hunt, Chad Fowler, Chad Fowler: Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;2. Agile Web Development with Rails, 3rd ed. by Dave Thomas, David Heinemeier Hansson, David Hansson, Publisher: Pragmatic Bookshelf&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://msdn.microsoft.com/en-us/library/cc488469.aspx&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://guides.rubyonrails.org/getting_started.html&lt;br /&gt;
&lt;br /&gt;
== External Sites ==&lt;br /&gt;
&lt;br /&gt;
1. http://en.wikipedia.org/wiki/Scaffolding_Theory&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.wisegeek.com/what-is-web-application-scaffolding.htm&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.developer.com/lang/php/article.php/3636686/Scaffolding-with-CakePHP---Managing-Your-Fantasy-Football-Team.htm&lt;br /&gt;
&amp;lt;br&amp;gt;4. http://cpan.uwinnipeg.ca/htdocs/Scaffold/Scaffold.html&lt;br /&gt;
&amp;lt;br&amp;gt;5. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/BeanEditForm.html&lt;br /&gt;
&amp;lt;br&amp;gt;6. http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/components/Grid.html&lt;br /&gt;
&lt;br /&gt;
== MediaSite ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;1. http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data&lt;br /&gt;
&amp;lt;br&amp;gt;2. http://www.youtube.com/watch?v=zV6aueUh8Bs&lt;br /&gt;
&amp;lt;br&amp;gt;3. http://www.youtube.com/watch?v=LWoCfTyWG_E&lt;/div&gt;</summary>
		<author><name>Vpadman2</name></author>
	</entry>
</feed>