Learn Java for Web Development Modern Java Web Development 1st Edition Vishal Layka - The ebook is ready for instant download and access
Learn Java for Web Development Modern Java Web Development 1st Edition Vishal Layka - The ebook is ready for instant download and access
https://ebookfinal.com/download/learn-java-fundamentals-a-primer-for-
java-development-and-programming-1st-edition-jeff-friesen/
https://ebookfinal.com/download/beginning-jsp-jsf-and-tomcat-java-web-
development-2nd-edition-giulio-zambon/
https://ebookfinal.com/download/java-web-services-1st-ed-edition-
david-a-chappell/
https://ebookfinal.com/download/java-web-services-up-and-running-1st-
edition-martin-kalin/
The Modern Web Multi Device Web Development with HTML5
CSS3 and JavaScript 1st New edition Edition Peter Gasston
https://ebookfinal.com/download/the-modern-web-multi-device-web-
development-with-html5-css3-and-javascript-1st-new-edition-edition-
peter-gasston/
https://ebookfinal.com/download/flask-web-development-1st-edition-
miguel-grinberg/
https://ebookfinal.com/download/arcgis-web-development-1st-edition-
rene-rubalcava/
https://ebookfinal.com/download/flask-web-development-developing-web-
applications-with-python-1st-edition-miguel-grinberg/
https://ebookfinal.com/download/java-ee-development-with-eclipse-2nd-
edition-ram-kulkarni/
Learn Java for Web Development Modern Java Web
Development 1st Edition Vishal Layka Digital Instant
Download
Author(s): Vishal Layka
ISBN(s): 9781430259831, 1430259833
Edition: 1
File Details: PDF, 16.88 MB
Year: 2014
Language: english
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
About the Author���������������������������������������������������������������������������������������������������������������� xv
About the Technical Reviewer������������������������������������������������������������������������������������������ xvii
Introduction����������������������������������������������������������������������������������������������������������������������� xix
Index���������������������������������������������������������������������������������������������������������������������������������435
v
Introduction
This book is for a large cross section of modern Java web developers, with various levels of
experience.
Learning the Java programming language is a noble cause, but learning merely the Java language
is not enough in the real world. Java developers have to learn Java EE, a collection of related
server-side technologies, to put their Java skills to any real use.
But learning Java EE is not enough either. The Java language along with Java EE may suffice to
develop web applications for projects in the same organization, as a means to reusability, but the
diverse landscape of Java on the Web is permeated with several web frameworks, such as Spring
Web MVC, that make development much easier; thus, a Java web developer has to have the
knowledge of these web frameworks.
But this is not enough still. In the very first line of this introduction, I mentioned that this book is for
a modern Java web developer. Modern Java is more than just a language; it is now a fully optimized
platform because several other languages such as Groovy and Scala, called the JVM languages,
now run on the Java Virtual Machine (JVM). All such JVM languages, especially Groovy, have a close
association with Java, and you will come across web applications before long where Java and these
other JVM languages work in tandem. The most ambitious projects will require you to build web
applications using these JVM languages.
This book addresses all the needs of a modern Java web developer. It is designed for beginners up
to intermediate developers and explains the specifics of Java on the Web. For example, this book is
perfect for developers who are aware of technologies like MVC but do not yet understand how and
why they have changed the way web applications are built.
This book is also for developers who want to learn frameworks other than JSF 2 (which is bundled
with Java EE). This book covers four types of web frameworks: request based, component based,
rapid, and reactive. Among these four types, the book covers five proven web frameworks: Struts 2,
Spring Web MVC, JSF 2, Grails 2, and Play 2.
In addition, this book is for developers who have no experience in the Java, Groovy, and Scala
programming languages but who yearn to create web applications. This book provides the essentials
of these three languages in the appendixes.
xix
xx Introduction
Instead of simply pronouncing one web framework the best, Learn Java for Web Development
shows the strengths of the most popular web frameworks by means of a real-world bookstore
application. Developing a complete real application necessitates a seamless collaboration of
dynamic functionalities, and the code for building such components is contrived and too involved.
Instead of focusing on developing such moving parts, this book confines its attention on leveraging
the strengths of each web framework.
An intelligent machine is that which extends the very imagination with which it was built. An example
of this is the instruction called invokeDynamic,1 which was introduced with Java 7 to optimize the
performance of dynamically typed languages on the Java Virtual Machine (JVM). The JVM, originally
intended for Java, can now host a myriad of programming languages, including Groovy2 and Scala.3
This has led to a renaissance of Java web development. This new paradigm of cross-pollination and
diverse, well-founded options carves out a number of niches in the Java ecosystem, resulting in a
richer web landscape than ever before.
The open source community has capitalized on the multiparadigm capabilities offered by the
languages that run on the JVM, by means of web frameworks, to dramatically enhance the
productivity in web development. Java EE4 advanced this momentum, pioneered by Java
frameworks such as Spring,5 by standardizing and improving the API and runtime environment.
Further, functional programming constructs, in the form of lambdas, have been added to Java 8. As
a result, Java is on the rebound to become an übersolution.
This chapter sets the stage for the book by introducing the three key players that join forces in
building modern Java web applications: the JVM languages, Java EE, and the Java web frameworks.
1
http://cr.openjdk.java.net/~jrose/pres/200910-VMIL.pdf
2
http://groovy.codehaus.org/
3
www.scala-lang.org/
4
www.oracle.com/technetwork/java/javaee/overview/index.html
5
http://spring.io/
1
2 CHAPTER 1: Introducing Java Web Development
Note The JVM languages represent a new category of languages that run on the JVM. With the latest
version, Java 8, Java is no longer a privileged JVM language and is now simply one of the many languages
that run on the JVM.
The chapter begins by introducing the JVM languages and then introduces Java EE. The Java
EE platform is the set of API specifications that act as the building blocks for developing web
applications. The chapter then highlights the Java web frameworks, which will be the subject of the
book from Chapter 4 onward.
JVM Languages
The JVM is the runtime environment that provides you with the ability to use different programming
languages for building web applications. The JVM languages can be largely classified into two types:
languages that are designed for the JVM and existing languages that are ported to JVM.
6
http://clojure.org/
CHAPTER 1: Introducing Java Web Development 3
Imperative languages: These are languages in which the state can be mutated
by the instructions in the language.
Functional languages: In functional languages, the functions operate on values
as in procedural languages, but instead of mutating the state, the functions are
purely mathematical functions that return new values.
Figure 1-1 shows where Java 8, Groovy, Scala, and Clojure fall on the functional language
continuum. Java 8 introduces lambdas, which makes it slightly functional, Groovy has had functional
constructs since its inception and is even more functional with Groovy 2.0, and Scala is the most
functional of the three object-oriented (OO) languages. Clojure, on the other hand, is a purely
functional, non-OO language.
Note In Figure 1-1, no version number is mentioned for Groovy, Scala, and Clojure because Java supports
aspects of functional programming starting from Java 8 only.
This book is based on some of the mainstream object-oriented JVM languages that were specifically
designed for the JVM, namely, Java, Groovy, and Scala.
Java EE
Java began life as a programming language designed for building stand-alone applications and grew
rapidly into other spheres. A large part of Java’s popularity can be attributed to its usage in creating
web applications. A web application consists of static and dynamic (interactive) web pages. Static
web pages contain various types of markup languages (HTML, XHTML, and so on) and are used, in
general, to provide information; dynamic web pages, on the other hand, are capable of generating
content with the aid of additional web components (covered in Chapter 2). Thus, a web application
is a collection of web pages and is capable of generating dynamic content in response to requests.
Unlike a web page used merely to provide information, a web application lets you perform some
activity and save the result. Developing a web application, however, is fundamentally different from
building stand-alone applications and requires you to understand the following three key elements:
The Java EE platform: This is the set of API specifications that are the building
blocks of the web application.
The web container: The web container implements the API specifications of
the Java EE platform. Specifically, the web container provides the services
for managing and executing web components such as servlets, JSPs, filters,
listeners, and render responses to the client. The web containers are covered in
Chapter 2.
Note There are several types of containers, but this book will focus on the web container primarily used for
web applications. You have to choose the container based on the kind of application you want to develop.
Web components: These are hosted by the container. These web components,
such as servlets, JSPs, filters, and listeners, are covered in Chapter 2.
7
http://jruby.org/
8
www.jython.org/
9
https://developer.mozilla.org/en-US/docs/Rhino_documentation
CHAPTER 1: Introducing Java Web Development 5
Note Pruning (also known as marked for deletion) consists of a list of proposed features for possible
removal in the next Java EE release in order to reduce the size of the platform or to keep it from bloating.
The goal of Web Profile is to allow developers to create web applications with the appropriate set of
technologies.
The Java EE platform is aimed at standardizing and reducing the complexity of enterprise application
development by providing an application model that defines an architecture for implementing
services as multitiered applications. In a multitiered application, the functionality of the application
is separated into distinct functional areas, called tiers. Figure 1-3 illustrates the typical multitiered
architecture in a Java EE application model.
6 CHAPTER 1: Introducing Java Web Development
10
www.oracle.com/technetwork/java/javaee/tech/index.html
CHAPTER 1: Introducing Java Web Development 7
Each layer in Figure 1-4 is an area of concern, for the application. For instance, the web layer deals
only with employing the web tier components of Java EE. Having different layers in an application
results in what is called a separation of concerns. In terms of implementation, this separation of
concerns is achieved using coarse-grained interfaces.
The concern is the feature, functionality or business functions with which the application’s
developer needs to be concerned. Crosscutting such concerns is inherent in complex systems
and leads to code scattering, which is when code for one concern spans many modules, and
code tangling, which is when code in one module concentrates on addressing multiple concerns.
Code scattering and code tangling lead to a lack of clarity, redundancy, rigidity, and continuous
refactoring. Figure 1-5 illustrates how the system services of logging, transaction, and security
crosscut the business functions of the application.
BookService in Figure 1-5 is too involved with the system services. Each object knows and is
responsible for logging, security, and transaction. A method, for example, to purchase a book in
BookService should be concerned only with how to purchase the book and not with whether it is
CHAPTER 1: Introducing Java Web Development 9
secure or transactional. Separation of concerns, one of the main goals of software engineering, lets
you handle each service on its own and thereby does the following:
Promotes traceability within and across the artifacts in the system, throughout
the life cycle of the system
Controls the impact caused by the change, thereby providing scope for
evolution and noninvasive adaptation
Promotes development of cohesive units, thereby facilitating reuse
SEPARATION OF CONCERNS
The term separation of concerns (SoC) was coined by Edsger W. Dijkstra in his paper “On the role of scientific thought.”11
Dijkstra explains in in the following terms:
Let me try to explain to you, what to my taste is characteristic for all intelligent thinking. It is, that
one is willing to study in depth an aspect of one’s subject matter in isolation for the sake of its own
consistency, all the time knowing that one is occupying oneself only with one of the aspects. We
know that a program must be correct and we can study it from that viewpoint only; we also know
that it should be efficient and we can study its efficiency on another day, so to speak. In another mood
we may ask ourselves whether, and if so: why, the program is desirable. But nothing is gained—on
the contrary!—by tackling these various aspects simultaneously. It is what I sometimes have called
“the separation of concerns,” which, even if not perfectly possible, is yet the only available technique
for effective ordering of one’s thoughts, that I know of. This is what I mean by “focusing one’s attention
upon some aspect”: it does not mean ignoring the other aspects, it is just doing justice to the fact
that from this aspect’s point of view, the other is irrelevant. It is being one- and multiple-track minded
simultaneously.
Web Layer
The web layer of a web application consists of the web tier components of Java EE such as servlets
and JSP. The web layer can access the service layer, but there should not be a tight coupling
between the web layer and the service layer. That is, changing the service layer should not impact
the web layer.
11
www.cs.utexas.edu/users/EWD/transcriptions/EWD04xx/EWD447.html
10 CHAPTER 1: Introducing Java Web Development
Service Layer
The service layer consists of the business tier components of Java EE such as Enterprise JavaBeans
(EJBs). The service layer can access the data access layer, but there should be no tight coupling
between the service layer and the data access layer. In fact, the service layer should not know
anything about the web or data access layer. The service layer provides a coarse-grained interface
for the web layer.
Note The call flow in this architecture is always from the top layer to the bottom layer. In other words, the
service layer should be able to call the data access layer but not vice versa.
In this chapter, you will build the data access layer of the bookstore application and query it via a
stand-alone Java application. In Chapter 2, you will replace this stand-alone Java application with
a web layer using the web tier components of Java EE (specifically, servlets and JSPs). You will
use this data access layer throughout this book, and from Chapter 4 onward you will build a web
application repeatedly by rebuilding the web layer using different web frameworks.
Oracle and the Java Community Process (JCP) provide standardized enterprise components, and if
successful enterprise applications can be built using these components, then why do we need web
frameworks? What are web frameworks for? The next section answers these questions.
Now that you have looked at the three key players that join forces in building modern Java web
applications (the JVM languages, Java EE, and the Java web frameworks), it is time to delve into
some specifics about Java.
The following section introduces Java so you can build your first stand-alone Java application. Since
this book is centered on web development using Java and is not about Java as a programming
language, the introduction to Java is brief—it’s just enough to help newcomers to the language
follow the subsequent chapters.
Because the JVM is available on many different operating systems, the same .class files are
capable of running on Windows, Unix, Linux, or Mac OS. In the section that follows, I will show you
how to compile and run your first Java application. But first you need to set up the development
environment.
12 CHAPTER 1: Introducing Java Web Development
Line 2: The main method in line 2 makes this class an entry-point class. This
method accepts inputs and starts the program.
The name of the Java application should be the name of the entry-point class, and the file that holds
a Java class must have the same name as the class. Therefore, the HelloWorld class in Listing 1-1
must be stored in a file named HelloWorld.java.
CHAPTER 1: Introducing Java Web Development 13
You use the javac program in the bin directory of your JDK installation directory to compile Java
programs. Assuming you have edited the PATH environment variable on your computer, you should
be able to invoke javac from any directory. To compile the HelloWorld class in Listing 1-1, do the
following:
1. Open a command prompt and change to the directory where the HelloWorld.
java file is saved.
2. Type the following command:
javac HelloWorld.java
If everything goes well, javac will create a file named HelloWorld.class in your working directory.
java HelloWorld
Note that you do not include the .class extension when running a Java application. You will see the
following on your console:
Hello World.
§ 4. Of Cipollaccio.
Some sorts of marble are found in Greece and in all parts of the
East, which are white and yellowish, and very transparent. These
were used by the ancients for baths and hot-air chambers and for all
those places which need protection against wind, and in our own
days there are still to be seen in the tribune of San Miniato a Monte,
the abode of the monks of Monte Oliveto, above the gates of
Florence, some windows of this marble, which admit light but not
air.[51] By means of this invention people gave light to their dwellings
and kept out the cold.
§ 9. Of Statuary Marbles.
From the same quarries[52] were taken other marbles free from
veins, but of the same colour, out of which were carved the noblest
statues. These marbles were of a very fine grain and consistency, and
they were continually being made use of by all who carved capitals
and other architectural ornaments. The blocks available for sculpture
were of great size as appears in the Colossi of Montecavallo at Rome,
[53]
in the Nile[54] of the Belvedere and in all the most famous and
noble statues. Apart from the question of the marble, one can
recognize these to be Greek from the fashion of the head, the
arrangement of the hair, and from the nose, which from its juncture
with the eyebrows down to the nostril is somewhat square.[55] This
marble is worked with ordinary tools and with drills, and is polished
with pumice stone, with chalk from Tripoli, and with leather and
wisps of straw.
In the mountains of Carrara in the Carfagnana,[56] near to the
heights of Luni, there are many varieties of marble, some black,[57]
some verging towards grey, some mingled with red and others again
with grey veins.[58] These form an outer crust over the white marbles,
and they take those colours, because they are not refined, but rather
are smitten by time, water and the soil. Again, there are other sorts of
marble, called ‘cipollini,’[59] ‘saligni,’ ‘campanini’ and ‘mischiati.’[60]
The most abundant kind is pure white and milky in tone; it is easy to
work and quite perfect for carving into figures. Enormous blocks lie
there ready to be quarried, and in our own days, pieces measuring
nine braccia have been hewn out for colossal statues. Two of these
colossi have recently been sculptured, each from a single block. The
one is Michelagnolo’s ‘David,’ which is at the entrance of the Ducal
Palace in Florence;[61] the other is the ‘Hercules and Cacus’ from the
hand of Bandinello standing at the other side of the same entrance.
Another block of nine braccia in length was taken out of the quarry a
few years ago, in order that the same Baccio Bandinello should carve
a figure of Neptune for the fountain which the Duke is having erected
on the piazza. But, Bandinello being dead, it has since been given to
Ammannato, an excellent sculptor, for him likewise to carve a
Neptune out of it.[62] But of all these marbles, that of the quarry
named Polvaccio,[63] in the place of that name, has the fewest
blemishes and veins and is free from those knots and nuts which very
often occur in an extended surface of marble—occasioning no little
difficulty to the worker, and spoiling the statues even when they are
finished. From the quarries of Seravezza, near to Pietrasanta, there
have been taken out a set of columns, all of the same height, destined
for the façade of San Lorenzo at Florence, which is now sketched out
in front of the door of that church;[64] one of these columns is to be
seen there, the rest remain, some in the quarry, some at the
seashore.
E, Subbia, a point.
F, Calcagnuolo, a toothed chisel.
G, Gradina, a broader toothed chisel.
H, Scarpello, a chisel.
J, Trapano, a drill.
But returning to the quarries of Pietrasanta,[65] I say that they were
the quarries in which all the ancients worked, and no other marbles
but these were used for their statues by those masters, who were so
excellent. While the masses were being hewn out, they were always at
work, blocking out figures in the rough on the stones while they were
still in the quarry. The remains of many of these can be seen even yet
in that place.[66] This same marble, then, the moderns of to-day use
for their statues, not only in Italy, but in France, England, Spain and
Portugal, as can be seen to-day in the tomb executed in Naples by
Giovanni da Nola, the excellent sculptor, for Don Pietro di Toledo,
viceroy of that kingdom, to whom all the marbles were presented,
and sent to Naples by Duke Cosimo de’ Medici.[67] This kind of
marble has in itself larger available pieces and is more yielding and
softer to work and receives a finer polish than any other marble. It is
true that occasionally the workman meets with flaws called by the
sculptors ‘smerigli’ (emery veins) which usually cause the tools to
break. The blocks are first roughed into shape, by a tool called
‘subbia’ (point)[68] which is pointed like a stake in facets, and is
heavier or lighter as the case may be. At the next stage are used
chisels, named ‘calcagnuoli’ (toothed chisels), which have a notch in
the middle of the edge of the blade; after that finer and finer tools
with more teeth are used to score the marble, after which it is
smoothed with another chisel called ‘gradina,’ (broader toothed
chisel) used to reduce and refine the figures. The tooth marks left in
the marble are removed with iron rasps straight and curved, and
thus at last, by polishing gradually with pumice stone the surface
aimed at is attained. In order not to fracture the marble, all the drill-
holes are made with drills of different sizes weighing from twelve
pounds each even to twenty, according to the size of the hole needed,
[69]
and they serve to finish every sort of work and to bring it to
perfection.
Of certain white marbles, streaked with grey,[70] sculptors and
architects make ornaments for doors and columns for houses and the
same are used also for pavements and for facings of large buildings,
and for all sorts of things. All the marbles called ‘mischiati’[71] are
used for the same purposes.
§ 10. Of Cipollino Marble.[72]
§ 13. Of Slates.
§ 14. Of Peperino.[91]
There only remains now the pietra serena and the grey stone called
‘macigno’[95] and the pietra forte which is much used in the
mountainous parts of Italy, especially in Tuscany, and most of all in
Florence and her territory. The stone that they call pietra serena[96]
draws towards blue or rather towards a greyish tint. There are
quarries of it in many places near Arezzo, at Cortona, at Volterra, and
throughout the Apennines. The finest is in the hills of Fiesole, and it
is obtained there in blocks of very great size, as we see in all the
edifices constructed in Florence by Filippo di Ser Brunellesco, who
had all the stones needed for the churches of San Lorenzo and of
Santo Spirito quarried there, and also an unlimited quantity which
are in every building throughout the city. It is a very beautiful stone
to look at, but it wastes away and exfoliates where it is subjected to
damp, rain, or frost. Under cover however it will last for ever. Much
more durable than this and of finer colour is a sort of bluish stone, in
our day called ‘pietra del fossato.’[97] When quarried, the first layer is
gravelly and coarse, the second is never free from knots and fissures,
the third is admirable being much finer in grain. Michelagnolo used
this, because of its yielding grain, in building the Library and Sacristy
of San Lorenzo for Pope Clement, and he has had the mouldings,
columns, and every part of the work executed with such great care
that even if it were of silver it would not look so well.[98] The stone
takes on a very fine polish, so much so that nothing better in this
kind of material could be wished for. On this account it was
forbidden by law that the stone be used in Florence for other than
public buildings, unless permission had been obtained from the
governing authorities.[99] The Duke Cosimo has had a great quantity
of this stone put into use, as for example, in the columns and
ornaments of the loggia of the Mercato Nuovo, and for the work
begun by Bandinello in the great audience chamber of the palace and
also in the other hall which is opposite to it; but the greatest amount,
more than ever used elsewhere, has been taken by his Excellency for
the Strada de’ Magistrati,[100] now in construction, after the design
and under the direction of Giorgio Vasari of Arezzo. This stone
demands as much time for working it as marble. It is so hard that
water does not affect it and it withstands all other attacks of time.
Besides this there is another sort called pietra serena, found all
over the hill, which is coarser, harder, and not so much coloured, and
contains certain knots in the stone. It resists the influence of water
and frost, and is useful for figures and carved ornaments. Of this is
carved La Dovizia (Abundance), a figure from the hand of Donatello
on the column of the Mercato Vecchio in Florence;[101] and it serves
also for many other statues executed by excellent sculptors, not only
in this city, but throughout the territory.
The work called Rustic[108] is more stunted, and more massive than
that of any other Order, it being the beginning and foundation of all.
The profiles of the mouldings are simpler and in consequence more
beautiful, as are the capitals and bases as well as every other
member. The Rustic socles or pedestals, as we call them, on which
rest the columns, are square in proportion, with a solid moulding at
the foot and another above which binds it like a cornice. The height
of the column measures six heads,[109] in imitation of people who are
dwarfed and adapted to sustain weights. Of this Order there are to be
seen in Tuscany many colonnades both plain and rusticated, with
and also without bosses and niches between the columns: and many
porticoes which the ancients were accustomed to construct in their
villas; and in the country one still sees many tombs of the kind as at
Tivoli and at Pozzuolo. This Order served the ancients for doors,
windows, bridges, aqueducts, treasuries, castles, towers, and
strongholds for storing ammunition and artillery; also for harbours,
prisons and fortresses; in these the stones project in an effective
manner in points like a diamond, or with many facets. The
projections are treated in various ways, either in bosses, flattened, so
as not to act as a ladder on the walls—for it would be easy to climb up
if the bosses jutted out too much—or in other ways, as one sees in
many places, and above all in Florence, in the principal façade of the
chief citadel, built by Alexander, first duke of Florence.[110] This
façade, out of respect to the Medici emblems, is made with
ornaments of diamond points and flattened pellets, but both in low
relief. The wall composed of pellets and diamonds side by side is very
rich and varied and most beautiful to look at. There is abundance of
this work at the villas of the Florentines, the gates and entrances, and
at the houses and palaces where they pass the summer, which not
only beautify and adorn that neighbourhood, but are also of the
greatest use and convenience to the citizens. But much more is the
city itself enriched with magnificent buildings, decorated with
rusticated masonry, as for example the Casa Medici, the façade of the
Pitti Palace, the palace of the Strozzi family and innumerable others.
When well designed, the more solid and simple the building, the
more skill and beauty do we perceive in it, and this kind of work is
necessarily more lasting and durable than all others, seeing that the
pieces of stone are bigger and the assemblage much better, all the
building being in bond, one stone with another. Moreover, because
the members are smooth and massive, the chances of fortune and of
weather cannot injure them so severely as the stones that are carved
and undercut, or, as we say here, ‘suspended in the air’ by the
cleverness of the sculptors.
Fig. 3.—Fortezza da Basso at Florence.
The Doric Order was the most massive known to the Greeks, more
robust both as to strength and mass, and much less open than their
other Orders. And not only the Greeks but the Romans also
dedicated this sort of building to those who were warriors, such as
generals of armies, consuls, praetors—and much more often to their
gods, as Jove, Mars, Hercules and others. According to the rank and
character of these the buildings were carefully distinguished—made
plain or carved, simple or rich—so that all could recognize the grade
and the position of the different dignitaries to whom they were
dedicated,[111] or of him who ordered them to be built. Consequently
one sees that the ancients applied much art in the composition of
their buildings, that the profiles of the Doric mouldings are very
graceful, and the features harmonious and of a high degree of
beauty; and also that the proportion of the shafts of the columns is
very well understood, as they are neither too thick nor too thin. The
form of the columns, as is commonly said, resembles that of
Hercules; it shows a certain solidity capable of sustaining the weight
of the architraves, friezes, cornices and the rest of the upper parts of
the building. Because this Order, as more secure and stable than the
others, has always much pleased Duke Cosimo, he desires that the
building, which he has charged me to construct for thirteen civil
magistrates of his city and dominion, should be of the Doric Order.
This building is to have splendid decoration in stone, and is to be
placed between his own palace and the river Arno.[112] Therefore, in
order to bring back into use the true mode of construction, which
requires the architraves to lie level over the columns, and avoid the
falsity of turning the arches of the arcades above the capital, I have
followed in the principal façade the actual method of the ancients, as
can be seen in the edifice. This fashion of building has been avoided
by architects of the recent past, because stone architraves of every
sort both ancient and modern are all, or the greater part of them,
seen to be broken in the middle, notwithstanding that above the solid
of the columns and of the architraves, frieze, and cornice, there are
flat arches of brick that are not in contact with and do not load the
work below. Now, after much consideration on the whole question, I
have finally found an excellent way of putting into use the true mode
of proceeding so as to give security to the said architraves, by which
they are prevented from suffering in any part and everything remains
as sound and safe as can be desired, as the result has proved. This
then, is the method, that is stated here below for the benefit of the
world at large and of the artificers.
Having set up the columns, and above the capitals the architraves,
which are brought into contact the one with the other above the
middle axis of the column, the builder proceeds to make a square
block or die (D, D, Fig. 5). For example, if the column be a braccio
thick and the architraves the same in width[114] and height, let the die
in the frieze be made equal to them; but in front let there remain an
eighth in the face for the vertical joint, and let another eighth or
more have a sinking into the die on each side, bevelled to an angle of
45°, Fig. 5 (1). Then since the frieze in each intercolumniation is in
three pieces (B, A, B), let the two at the sides (B, B) have bevelled
projections in the opposite sense to the sinkings, increasing from
within outwards, Fig. 5 (2), so that each may be mortised in the die
and be keyed after the manner of an arch, and in the front the
amount of the eighth must bond vertically; while the part on the
other side must do the same to the other die. And so above the
column[115] one must arrange that the piece in the middle of the said
frieze closes within and is recessed in quarter-round form up to the
middle, while the other half must be squared and straight and set
with an empty space below, in order that it may hold as does an arch,
the wall on the external face appearing worked with vertical joints.
[116]
Do not let the stones of the said frieze rest on the architrave, but
let a finger’s breadth be between them; in this way, making an arch,
the frieze comes to support itself and does not burden the architrave.
Afterwards make on the inside, for filling up the said frieze, a flat
arch of bricks as high as the frieze, that stretches from die to die
above the columns. Then make a piece of cornice as wide as the
die[117] above the columns, which has the joints in front like those of
the frieze, and within let the said cornice be keyed like the blocks of
the frieze, care being taken to make the cornice, as the frieze, in three
pieces, of which the two at the sides hold from within the middle
piece of the cornice above the die of the frieze,[118] and mind that the
middle piece of the cornice, C, C, slips down into the sinkings so as to
span the void, and unites the two pieces at the sides so as to lock
them in the form of an arch. In this fashion everyone can see that the
frieze sustains itself, as does the cornice, which rests almost entirely
on the arch of bricks.[119] Thus one thing helping another, it comes
about that the architrave does not sustain any but its own weight, nor
is there danger of its ever being broken by too heavy a load. Because
experience shows this method to be the most sure, I have wished to
make particular mention of it, for the convenience and benefit of all;
especially as I know that when the frieze and the cornice were put
above the architrave as was the practice of the ancients, the latter
broke in course of time, possibly on account of an earthquake or
other accident, the arch of discharge which was introduced above the
cornice not being sufficient to preserve it. But throwing the arches
above the cornices made in this form, and linking them together with
iron, as usual,[120] secures the whole from every danger and makes
the building endure eternally.
Returning to the matter in hand, let us explain then that this
fashion of work may be used by itself alone, or can be employed in
the second floor from the ground level, above the Rustic Order, or it
can be put higher up above another variety of Order such as Ionic,
Corinthian or Composite, in the manner shown by the ancients in the
Colosseum in Rome, in which arrangement they used skill and
judgement. The Romans, having triumphed not only over the Greeks
but over the whole world, put the Composite Order at the top, of
which Order the Tuscans have composed many varieties. They placed
it above all, as superior in force, grace, and beauty, and as more
striking than the others, to be a crown to the building; for to be
adorned with beautiful members gives to the work an honourable
completion and leaves nothing more to be desired.
To return to the Doric Order, I may state that the column is made
seven heads in height. Its pedestal must be a little less than a square
and a half in height and a square in width,[121] then above are placed
its mouldings and beneath its base with torus and two fillets, as
Vitruvius directs. The base and capital are of equal height, reckoning
the capital from the astragal upwards. The cornice with the frieze
and architrave attached projects over every column, with those
grooved features, usually called triglyphs, which have square
spaces[122] interposed between the projections, within which are the
skulls of oxen, or trophies, or masks, or shields, or other fancies. The
architrave, jutting out, binds these projections with a fillet, and
under the fillet are little strips square in section, at the foot of each of
which are six drops, called by the ancients ‘guttae’ (goccie). If the
column in the Doric order is to be seen fluted, there must be twenty
hollow facets instead of flutes,[123] and nothing between the flutes but
the sharp arris. Of this sort of work there is an example in Rome at
the Forum Boarium which is most rich;[124] and of another sort are
the mouldings and other members in the theatre of Marcellus, where
to-day is the Piazza Montanara, in which work there are no bases (to
the Doric columns) and those bases which are visible are Corinthian.
It is thought that the ancients did not make bases, but instead placed
there a pedestal of the same size as the base would have been. This is
to be met with in Rome by the prison of the Tullianum where also are
capitals richer in members than others which appear in the Doric
Order.[125] Of this same order Antonio da San Gallo has made the
inner court of the Casa Farnese in the Campo di Fiore at Rome,
which is highly decorated and beautiful; thus one sees continually
ancient and modern temples and palaces in this style, which for
stability and assemblage of the stones have held together better and
lasted longer than all other edifices.
Fig. 6.—Drawing by Giuliano da San Gallo of a
portion of the Basilica Aemilia in the Roman
Forum, that survived to the time of Vasari.
The Ionic Order, more slender than the Doric, was made by the
ancients in imitation of persons who stand mid-way between the
fragile and the robust; a proof of this is its adoption in works
dedicated to Apollo, Diana, and Bacchus, and sometimes to Venus.
The pedestal which sustains the column is one and a half squares
high and one wide, and the mouldings, above and below, are in
accordance with this Order. Its column measures in height eight
times the head, and its base is double with two tori, as described by
Vitruvius in the third chapter of his third book. Its capital with its
volutes or scrolls or spirals, as anyone may call them, should be well
turned, as one sees in the theatre of Marcellus in Rome, above the
Doric Order; and its cornice adorned with modillions and with
dentils, and its frieze slightly convex
(pulvinated). Should it be desired to
flute the columns, there must be
twenty-four flutes, but divided in such
a manner as to leave between each two
of them a flat piece that measures the
fourth part of the flute. This order has
in itself the most beautiful lightness
and grace and is consequently adopted
by modern architects.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com