100% found this document useful (2 votes)
2K views

Software Architecture with C# 10 and .NET 6 - Third Edition Gabriel Baptista All Chapters Instant Download

The document promotes the ebook 'Software Architecture with C# 10 and .NET 6 - Third Edition' by Gabriel Baptista, available for download at ebookmeta.com. It includes links to additional recommended digital products related to software architecture and development. The book covers various topics including microservices, DevOps, and design patterns for Azure.

Uploaded by

lightscanosa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
2K views

Software Architecture with C# 10 and .NET 6 - Third Edition Gabriel Baptista All Chapters Instant Download

The document promotes the ebook 'Software Architecture with C# 10 and .NET 6 - Third Edition' by Gabriel Baptista, available for download at ebookmeta.com. It includes links to additional recommended digital products related to software architecture and development. The book covers various topics including microservices, DevOps, and design patterns for Azure.

Uploaded by

lightscanosa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

Software Architecture with C# 10 and .NET 6 -


Third Edition Gabriel Baptista

https://ebookmeta.com/product/software-architecture-
with-c-10-and-net-6-third-edition-gabriel-baptista/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Software Architecture by Example: Using C# and .NET 1st


Edition Paul Michaels

https://ebookmeta.com/product/software-architecture-by-example-using-
c-and-net-1st-edition-paul-michaels-2/

ebookmeta.com

Software Architecture by Example: Using C# and .NET 1st


Edition Paul Michaels

https://ebookmeta.com/product/software-architecture-by-example-using-
c-and-net-1st-edition-paul-michaels/

ebookmeta.com

Pro C# 10 with .NET 6: Foundational Principles and


Practices in Programming 11th Edition Andrew Troelsen

https://ebookmeta.com/product/pro-c-10-with-net-6-foundational-
principles-and-practices-in-programming-11th-edition-andrew-troelsen/

ebookmeta.com

The Stigma Matrix: Gender, Globalization, and the Agency


of Pakistan's Frontline Women 1st Edition Husain

https://ebookmeta.com/product/the-stigma-matrix-gender-globalization-
and-the-agency-of-pakistans-frontline-women-1st-edition-husain/

ebookmeta.com
Toad Tips Tricks Clicks Boosting your Oracle productivity
1st Edition Jeff Smith

https://ebookmeta.com/product/toad-tips-tricks-clicks-boosting-your-
oracle-productivity-1st-edition-jeff-smith/

ebookmeta.com

Emerging Technologies in Meat Processing Production


Processing and Technology 1st Edition Enda J. Cummins

https://ebookmeta.com/product/emerging-technologies-in-meat-
processing-production-processing-and-technology-1st-edition-enda-j-
cummins/
ebookmeta.com

Rights Come to Mind Brain Injury Ethics and the Struggle


for Consciousness 1st Edition Fins Joseph J

https://ebookmeta.com/product/rights-come-to-mind-brain-injury-ethics-
and-the-struggle-for-consciousness-1st-edition-fins-joseph-j/

ebookmeta.com

Fictional Names A Critical Study of Some Theories Not


Committed to the Existence of Fictional Entities 1st
Edition Angelo Napolano
https://ebookmeta.com/product/fictional-names-a-critical-study-of-
some-theories-not-committed-to-the-existence-of-fictional-
entities-1st-edition-angelo-napolano/
ebookmeta.com

Property Law In A Globalizing World 1st Edition Amnon


Lehavi

https://ebookmeta.com/product/property-law-in-a-globalizing-world-1st-
edition-amnon-lehavi/

ebookmeta.com
Autonomous and Connected Vehicles Network Architectures
from Legacy Networks to Automotive Ethernet 1st Edition
Dominique Paret
https://ebookmeta.com/product/autonomous-and-connected-vehicles-
network-architectures-from-legacy-networks-to-automotive-ethernet-1st-
edition-dominique-paret/
ebookmeta.com
Software Architecture with C#
10 and .NET 6
Third Edition

Develop software solutions using


microservices, DevOps, EF Core, and
design patterns for Azure
Gabriel Baptista

Francesco Abbruzzese

BIRMINGHAM—MUMBAI
Software Architecture with C# 10 and .NET 6

Third Edition

Copyright © 2022 Packt Publishing


All rights reserved. No part of this book may be reproduced, stored in
a retrieval system, or transmitted in any form or by any means,
without the prior written permission of the publisher, except in the
case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure
the accuracy of the information presented. However, the information
contained in this book is sold without warranty, either express or
implied. Neither the authors, nor Packt Publishing or its dealers and
distributors, will be held liable for any damages caused or alleged to
have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information
about all of the companies and products mentioned in this book by
the appropriate use of capitals. However, Packt Publishing cannot
guarantee the accuracy of this information.

Producer: Suman Sen

Acquisition Editor – Peer Reviews: Saby Dsilva

Project Editor: Parvathy Nair

Content Development Editors: Alex Patterson, Georgia Daisy van


der Post
Copy Editor: Safis Editing

Technical Editor: Aniket Shetty

Proofreader: Safis Editing

Indexer: Subalakshmi Govindhan

Presentation Designer: Pranit Padwal

First published: November 2019

Second edition: December 2020

Third edition: March 2022

Production reference: 2020622

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80323-525-7

www.packt.com
Contributors

About the authors


Gabriel Baptista is a tech manager who leads a great variety of
teams across a diverse range of projects using the Microsoft platform
for industry and retail. He is an Azure specialist, responsible for
architecting a SaaS platform in partnership with Microsoft. In
addition, he is a computing professor, having published many
papers, and taught subjects concerning software engineering,
development, and architecture. He has also spoken at a great
number of tech conferences all over the world over recent years.
Moreover, he co-founded SMIT, a software development company,
and SmartLoad, the first cargo mobility insurtech in Brazil.

To my kids, Murilo and Heitor, and my beloved wife, Denise, who


have always been by my side. To my friend Francesco, who is always
bringing new ideas to our book! And a special thanks to the Packt
Team, that supported this incredible new edition of the book.

Francesco Abbruzzese dedicates his life to his two great passions:


software and powerlifting. He is the author of the MVC Controls
Toolkit and the Blazor Controls Toolkit libraries. He has contributed to
the diffusion and evangelization of the Microsoft web stack since the
first version of ASP.NET. His company, Mvcct Team, offers web
applications, tools, and services for web technologies. He has moved
from AI systems, where he implemented one of the first decision
support systems for financial institutions, to top-10 video game titles
such as Puma Street Soccer.

To my beloved brother, Luciano, who saved my life during my fight


against a Covid pneumonia. And a special thanks to the entire Packt
team, and to the reviewers who contributed to improving the overall
content.
About the reviewers
João Antunes works as a software engineer, focused on software
architecture, design, and development. With over 10 years of
professional experience, João specializes in .NET and related
technologies, but keeps up with other relevant technologies and
industry trends.

João is active on his blog and YouTube channel (Coding Militia),


where he discusses software development and related topics.
Dave Brock is a development lead with experience in the
architecture, design, and development of distributed, cloud-native
applications. He was awarded a master’s degree in Software
Engineering from DePaul University. With a focus on Microsoft
technologies such as .NET and Azure, Dave writes regularly at
daveabrock.com and has been awarded a Microsoft MVP award for his
community contributions. When not reviewing books, he resides in
Madison, Wisconsin, and enjoys hiking, playing guitar, and, of
course, is a proud dad to his two wonderful children, Emma and
Colin.

Join our book’s Discord space


Join the book’s Discord workspace for a Ask me Anything session
with the authors:
https://packt.link/SAcsharp10dotnet6
Contents
Preface
Who this book is for
What this book covers
To get the most out of this book
Get in touch
1. Understanding the Importance of Software Architecture
What is software architecture?
Creating an Azure account
Software development process models
Reviewing traditional software development process
models
Understanding the waterfall model principles
Analyzing the incremental model
Understanding agile software development process
models
Lean software development
Extreme Programming
Getting into the Scrum model
Scaling agile throughout a company
Gathering the right information to design high-quality
software
Understanding the requirements gathering process
Detecting exact user needs
Analyzing requirements
Writing the specifications
Understanding the principles of scalability,
robustness, security, and performance
Reviewing the specification
Using design techniques as a helpful tool
Design Thinking
Design Sprint
Common cases where the requirements gathering process
impacts system results
Case 1 – my website is too slow to open that page!
Understanding backend caching
Applying asynchronous programming
Dealing with object allocation
Getting better database access
Case 2 – the user’s needs are not properly
implemented
Case 3 – the usability of the system does not meet the
user’s needs
Case study – introducing World Wild Travel Club
Understanding user needs and system requirements
Summary
Questions
Further reading
2. Non-Functional Requirements
Technical requirements
Enabling scalability, availability, and resiliency with Azure
and .NET 6
Creating a scalable web app in Azure
Vertical scaling (scaling up)
Horizontal scaling (scaling out)
Creating a scalable web app with .NET 6
Performance issues that need to be considered when
programming in C#
String concatenation
Exceptions
Multithreading environments for better results – dos
and don’ts
Usability – why inserting data takes too much time
Designing fast selection logic
Selecting from a huge number of items
The fantastic world of interoperability with .NET 6
Creating a service in Linux
Achieving security by design
List of practices for achieving a safe architecture
Authentication
Sensitive data
Web security
Book use case – understanding the main types of .NET
projects
Summary
Questions
Further reading
3. Documenting Requirements with Azure DevOps
Technical requirements
Introducing Azure DevOps
Organizing your work using Azure DevOps
Azure DevOps repository
Package feeds
Test Plans
Pipelines
Managing system requirements in Azure DevOps
Epic work items
Feature work items
Product Backlog items/User Story work items
Use case – presenting use cases in Azure DevOps
Summary
Questions
Further reading
4. Deciding on the Best Cloud-Based Solution
Technical requirements
Different software deployment models
IaaS and Azure opportunities
Security responsibility in IaaS
PaaS – a world of opportunities for developers
Web apps
SQL databases
Azure Cognitive Services
SaaS – just sign in and get started!
Understanding what serverless means
Why are hybrid applications so useful in many cases?
Book use case – which is the best cloud solution?
Summary
Questions
Further reading
5. Applying a Microservice Architecture to Your Enterprise
Application
Technical requirements
What are microservices?
Microservices and the evolution of the concept of
modules
Microservices design principles
The independence of design choices
Independence from the deployment environment
Loose coupling
No chained requests/responses
Containers and Docker
When do microservices help?
Layered architectures and microservices
The presentation layer
When is it worth considering microservice
architectures?
How does .NET deal with microservices?
.NET communication facilities
Resilient task execution
Using generic hosts
Visual Studio support for Docker
Analyzing the Docker file
Publishing the project
Azure and Visual Studio support for microservice
orchestration
Which tools are needed to manage microservices?
Defining your private Docker registry in Azure
Summary
Questions
Further reading
6. Azure Kubernetes Service
Technical requirements
Kubernetes basics
.yaml files
ReplicaSets and Deployments
StatefulSets
Services
Ingresses
Interacting with Azure Kubernetes clusters
Using Kubectl
Deploying the demo Guestbook application
Advanced Kubernetes concepts
Requiring permanent storage
Kubernetes secrets
Liveness and readiness checks
Autoscaling
Helm – Installing an Ingress Controller
Summary
Questions
Further reading
7. Interacting with Data in C# – Entity Framework Core
Technical requirements
Understanding ORM basics
Configuring Entity Framework Core
Defining DB entities
Defining the mapped collections
Completing the mapping configuration
Entity Framework Core migrations
Understanding stored procedures and direct SQL
commands
Compiled models
Querying and updating data with Entity Framework Core
Returning data to the presentation layer
Issuing direct SQL commands
Handling transactions
Deploying your data layer
Understanding Entity Framework Core advanced features
Summary
Questions
Further reading
8. How to Choose Your Data Storage in the Cloud
Technical requirements
Understanding the different repositories for different
purposes
Relational databases
NoSQL databases
Redis
Azure storage accounts
Choosing between SQL or NoSQL document-oriented
databases
Azure Cosmos DB – an opportunity to manage a multi-
continental database
Creating an Azure Cosmos DB account
Creating an Azure Cosmos container
Accessing Azure Cosmos data
Defining database consistency
The Cosmos DB client
The Cosmos DB Entity Framework Core provider
Use case – storing data
Implementing the destinations/packages database with
Cosmos DB
Summary
Questions
Further reading
9. Working with Azure Functions
Technical requirements
Understanding the Azure Functions app
Consumption plan
Premium plan
App Service plan
Programming Azure Functions using C#
Listing Azure Functions templates
Maintaining Azure Functions
Azure Durable Functions
Azure Functions roadmap
Use case – Implementing Azure Functions to send emails
First step – Creating Azure queue storage
Second step – Creating the function to send emails
Third step – Creating the queue trigger function
Summary
Questions
Further reading
10. Design Patterns and .NET 6 Implementation
Technical requirements
Understanding design patterns and their purpose
Builder pattern
Factory pattern
Singleton pattern
Proxy pattern
Command pattern
Publisher/Subscriber pattern
Dependency Injection pattern
Understanding the available design patterns in .NET 6
Summary
Questions
Further reading
11. Understanding the Different Domains in Software Solutions
Technical requirements
What are software domains?
Understanding domain-driven design
Entities and value objects
Layers and the Onion architecture
Aggregates
The repository and Unit of Work patterns
DDD entities and Entity Framework Core
Command Query Responsibility Segregation (CQRS) pattern
Command handlers and domain events
Event sourcing
Random documents with unrelated
content Scribd suggests to you:
VI.

My supposition that the artists imitated the poet is no


disparagement to them. On the contrary the manner of their
imitation reflects the greatest credit on their wisdom. They followed
the poet without suffering him in the smallest particular to mislead
them. A model was set them, but the task of transferring it from one
art into another gave them abundant opportunity for independent
thought. The originality manifested in their deviations from the
model proves them to have been no less great in their art than the
poet was in his.
Now, reversing the matter, I will suppose the poet to be working
after the model set him by the artists. This is a supposition
maintained by various scholars.[44] I know of no historical arguments
in favor of their opinion. The work appeared to them of such
exceeding beauty that they could not believe it to be of comparatively
recent date. It must have been made when art was at its perfection,
because it was worthy of that period.
We have seen that, admirable as Virgil’s picture is, there are yet
traits in it unavailable for the artist. The saying therefore requires
some modification, that a good poetical description must make a
good picture, and that a poet describes well only in so far as his
details may be used by the artist. Even without the proof furnished
by examples, we should be inclined to predicate such limitation from
a consideration of the wider sphere of poetry, the infinite range of
our imagination, and the intangibility of its images. These may stand
side by side in the greatest number and variety without concealment
or detriment to any, just as the objects themselves or their natural
symbols would in the narrow limits of time or space.
But if the smaller cannot contain the greater it can be contained in
the greater. In other words, if not every trait employed by the
descriptive poet can produce an equally good effect on canvas or in
marble, can every trait of the artist be equally effective in the work of
the poet? Undoubtedly; for what pleases us in a work of art pleases
not the eye, but the imagination through the eye. The same picture,
whether presented to the imagination by arbitrary or natural signs,
must always give us a similar pleasure, though not always in the
same degree.
But even granting this, I confess that the idea of Virgil’s having
imitated the artists is more inconceivable to me than the contrary
hypothesis. If the artists copied the poet, I can account for all their
deviations. Differences would necessarily have arisen, because many
traits employed by him with good effect would in their work have
been objectionable. But why such deviations in the poet? Would he
not have given us an admirable picture by copying the group
faithfully in every particular?[45]
I can perfectly understand how his fancy, working independently,
should have suggested to him this and that feature, but I see no
reason why his judgment should have thought it necessary to
transform the beauties that were before his eyes into these differing
ones.
It even seems to me that, had Virgil used this group as his model,
he could hardly have contented himself with leaving the general
embrace of the three bodies within the serpents’ folds to be thus
guessed at. The impression upon his eye would have been so vivid
and admirable, that he could not have failed to give the position
greater prominence in his description. As I have said, that was not
the time to dwell upon its details; but the addition of a single word
might have put a decisive emphasis upon it, even in the shadow in
which the poet was constrained to leave it. What the artist could
present without that word, the poet would not have failed to express
by it, had the work of art been before him.
The artist had imperative reasons for not allowing the sufferings of
his Laocoon to break out into cries. But if the poet had had before
him in the marble this touching union of pain with beauty, he would
certainly have been under no necessity of disregarding the idea of
manly dignity and magnanimous patience arising from it and making
his Laocoon suddenly startle us with that terrible cry. Richardson
says that Virgil’s Laocoon needed to scream, because the poet’s
object was not so much to excite compassion for him as to arouse
fear and horror among the Trojans. This I am ready to grant,
although Richardson appears not to have considered that the poet is
not giving the description in his own person, but puts it into the
mouth of Æneas, who, in his narration to Dido, spared no pains to
arouse her compassion. The cry, however, is not what surprises me,
but the absence of all intermediate stages of emotion, which the
marble could not have failed to suggest to the poet if, as we are
supposing, he had used that as his model. Richardson goes on to say,
that the story of Laocoon was meant only as an introduction to the
pathetic description of the final destruction of Troy, and that the poet
was therefore anxious not to divert to the misfortunes of a private
citizen the attention which should be concentrated on the last
dreadful night of a great city.[46] But this is a painter’s point of view,
and here inadmissible. In the poem, the fate of Laocoon and the
destruction of the city do not stand side by side as in a picture. They
form no single whole to be embraced at one glance, in which case
alone there would have been danger of having the eye more attracted
by the Laocoon than by the burning city. The two descriptions
succeed each other, and I fail to see how the deepest emotion
produced by the first could prejudice the one that follows. Any want
of effect in the second must be owing to its inherent want of pathos.
Still less reason would the poet have had for altering the serpents’
coils. In the marble they occupy the hands and encumber the feet, an
arrangement not less impressive to the imagination than satisfactory
to the eye. The picture is so distinct and clear that words can scarcely
make it plainer than natural signs.
Micat alter et ipsum
Laocoonta petit, totumque infraque supraque
Implicat et rabido tandem ferit ilia morsu.

· · · · ·

At serpens lapsu crebro redeunte subintrat


Lubricus, intortoque ligat genua infima nodo.

These lines are by Sadolet. They would doubtless have come with
greater picturesqueness from Virgil, had his fancy been fired by the
visible model. Under those circumstances he would certainly have
written better lines than those we now have of him.
Bis medium amplexi, bis collo squamea circum
Terga dati, superant capite et cervicibus altis.

These details satisfy the imagination, it is true; but not if we dwell


upon them and try to bring them distinctly before us. We must look
now at the serpents, and now at Laocoon. The moment we try to
combine them into one picture, the grouping begins to displease, and
appear in the highest degree unpicturesque.
But these deviations from his supposed model, even if not
unfortunate, were entirely arbitrary. Imitation is intended to produce
likeness, but how can likeness result from needless changes? Such
changes rather show that the intention was not to produce likeness,
consequently that there has been no imitation.
Perhaps not of the whole, some may urge, but of certain parts.
Good; but what are the parts so exactly corresponding in the marble
and in the poem, that the poet might seem to have borrowed them
from the sculptor? The father, the children, and the serpents, both
poet and sculptor received from history. Except what is traditional in
both, they agree in nothing but the single circumstance that father
and sons are bound by the serpents’ coils into a single knot. But this
arose from the new version, according to which father and sons were
involved in a common destruction,—a version, as already shown, to
be attributed rather to Virgil, since the Greek traditions tell the story
differently. If, then, there should have been any imitation here, it is
more likely to have been on the side of the artist than of the poet. In
all other respects their representations differ, but in such a way that
the deviations, if made by the artist, are perfectly consistent with an
intention to copy the poet, being such as the sphere and limitations
of his art would impose on him. They are, on the contrary, so many
arguments against the supposed imitation of the sculptor by the
poet. Those who, in the face of these objections, still maintain this
supposition, can only mean that the group is older than the poem.
VII.

When we speak of an artist as imitating a poet or a poet an artist,


we may mean one of two things,—either that one makes the work of
the other his actual model, or that the same original is before them
both, and one borrows from the other the manner of copying it.
When Virgil describes the shield of Æneas, his imitation of the
artist who made the shield is of the former kind. The work of art, not
what it represents, is his model. Even if he describe the devices upon
it they are described as part of the shield, not as independently
existing objects. Had Virgil, on the other hand, copied the group of
the Laocoon, this would have been an imitation of the second kind.
He would then have been copying, not the actual group, but what the
group represents, and would have borrowed from the marble only
the details of his copy.
In imitations of the first kind the poet is an originator, in those of
the second a copyist. The first is part of the universal imitation which
constitutes the very essence of his art, and his work is that of a
genius, whether his model be nature or the product of other arts. The
second degrades him utterly. Instead of the thing itself, he imitates
its imitations, and gives us a lifeless reflection of another’s genius for
original touches of his own.
In the by no means rare cases where poet and artist must study
their common original from the same point of view, their copies
cannot but coincide in many respects, although there may have been
no manner of imitation or emulation between them. These
coincidences among contemporaneous artists and poets may lead to
mutual illustrations of things no longer present to us. But to try to
help out these illustrations by tracing design where was only chance,
and especially by attributing to the poet at every detail a reference to
this statue or that picture, is doing him very doubtful service. Nor is
the reader a gainer by a process which renders the beautiful passages
perfectly intelligible, no doubt, but at the sacrifice of all their life.
This is the design and the mistake of a famous English work by the
Rev. Mr. Spence, entitled, “Polymetis; or, An inquiry concerning the
agreement between the works of the Roman poets and the remains of
the ancient artists, being an attempt to illustrate them mutually from
one another.”[47] Spence has brought to his work great classical
learning and a thorough knowledge of the surviving works of ancient
art. His design of using these as means to explain the Roman poets,
and making the poets in turn throw light on works of art hitherto
imperfectly understood, has been in many instances happily
accomplished. But I nevertheless maintain that to every reader of
taste his book must be intolerable.
When Valerius Flaccus describes the winged thunderbolts on the
shields of the Roman soldiers,—
Nec primus radios, miles Romane, corusci
Fulminis et rutilas scutis diffuderis alas,

the description is naturally made more intelligible to me by seeing


the representation of such a shield on an ancient monument.[48] It is
possible that the old armorers represented Mars upon helmets and
shields in the same hovering attitude that Addison thought he saw
him in with Rhea on an ancient coin,[49] and that Juvenal had such a
helmet or shield in mind in that allusion of his which, till Addison,
had been a puzzle to all commentators.
The passage in Ovid where the wearied Cephalus invokes Aura, the
cooling zephyr,—
“Aura ... venias ...
Meque juves, intresque sinus, gratissima, nostros,”

and his Procris takes this Aura for the name of a rival,—this passage,
I confess, seems to me more natural when I see that the ancients in
their works of art personified the gentle breezes, and, under the
name Auræ, worshipped certain female sylphs.[50]
I acknowledge that when Juvenal compares an idle patrician to a
Hermes-column, we should hardly perceive the point of the
comparison unless we had seen such a column and knew it to be a
poorly cut pillar, bearing the head, or at most the trunk, of the god,
and, owing to the want of hands and feet, suggesting the idea of
inactivity.[51]
Illustrations of this kind are not to be despised, though neither
always necessary nor always conclusive. Either the poet regarded the
work of art not as a copy but as an independent original, or both
artist and poet were embodying certain accepted ideas. Their
representations would necessarily have many points of resemblance,
which serve as so many proofs of the universality of the ideas.
But when Tibullus describes Apollo as he appeared to him in a
dream,—the fairest of youths, his temples wreathed with the chaste
laurel, Syrian odors breathing from his golden hair that falls in
ripples over his long neck, his whole body as pink and white as the
cheek of the bride when led to her bridegroom,—why need these
traits have been borrowed from famous old pictures? Echion’s “nova
nupta verecundia notabilis” may have been in Rome and been copied
thousands of times: did that prove virgin modesty itself to have
vanished from the world? Since the painter saw it, was no poet to see
it more save in the painter’s imitation?[52] Or when another poet
speaks of Vulcan as wearied and his face reddened by the forge, did
he need a picture to teach him that labor wearies and heat reddens?
[53]
Or when Lucretius describes the alternations of the seasons and
brings them before us in the order of nature, with their whole train of
effects on earth and air, was Lucretius the creature of a day? had he
lived through no entire year and seen its changes, that he must needs
have taken his description from a procession of statues representing
the seasons? Did he need to learn from statues the old poetic device
of making actual beings out of such abstractions?[54] Or Virgil’s
“pontem indignatus Araxes,” that admirable poetic picture of a river
overflowing its banks and tearing down the bridge that spans it,—do
we not destroy all its beauty by making it simply a reference to some
work of art, wherein the river god was represented as actually
demolishing a bridge?[55] What do we want of such illustrations
which banish the poet from his own clearest lines to give us in his
place the reflection of some artist’s fancy?
I regret that this tasteless conceit of substituting for the creations
of the poet’s own imagination a familiarity with those of others
should have rendered a book, so useful as the Polymetis might have
been made, as offensive as the feeblest commentaries of the
shallowest quibblers, and far more derogatory to the classic authors.
Still more do I regret that Addison should in this respect have been
the predecessor of Spence, and, in his praiseworthy desire to make
the old works of art serve as interpreters, have failed to discriminate
between those cases where imitation of the artist would be becoming
in the poet, and those where it would be degrading to him.[56]
VIII.

Spence has the strangest notions of the resemblance between


painting and poetry. He believes the two arts to have been so closely
connected among the ancients that they always went hand in hand,
the poet never losing sight of the painter, nor the painter of the poet.
That poetry has the wider sphere, that beauties are within her reach
which painting can never attain, that she may often see reason to
prefer unpicturesque beauties to picturesque ones,—these things
seem never to have occurred to him. The slightest difference,
therefore, between the old poets and artists throws him into an
embarrassment from which it taxes all his ingenuity to escape.
The poets generally gave Bacchus horns. Spence is therefore
surprised that we seldom see these appendages on his statues.[57] He
suggests one reason and another; now the ignorance of the
antiquarians, and again “the smallness of the horns themselves,
which were very likely to be hid under the crown of grapes or ivy
which is almost a constant ornament of the head of Bacchus.” He
goes all round the true cause without ever suspecting it. The horns of
Bacchus were not a natural growth like those of fauns and satyrs.
They were ornaments which he could assume or lay aside at
pleasure.
Tibi, cum sine cornibus adstas,
Virgineum caput est, ...

says Ovid in his solemn invocation to Bacchus.[58] He could therefore


show himself without horns, and did, in fact, thus show himself when
he wished to appear in his virgin beauty. In this form artists would
choose to represent him, and necessarily omitted all disagreeable
accompaniments. Horns fastened to the diadem, as we see them on a
head in the royal museum in Berlin,[59] would have been a
cumbersome appendage, as would also the diadem itself, concealing
the beautiful brow. For this reason the diadem appears as rarely as
the horns on the statues of Bacchus, although, as its inventor, he is
often crowned with it by the poets. In poetry both horns and diadem
served as subtle allusions to the deeds and character of the god: in a
picture or statue they would have stood in the way of greater
beauties. If Bacchus, as I believe, received the name of Biformis,
Δίμορφος, from having an aspect of beauty as well as of terror, the
artists would naturally have chosen the shape best adapted to the
object of their art.
In the Roman poets Minerva and Juno often hurl the thunderbolt.
Why are they not so represented in art? asks Spence.[60] He answers,
“This power was the privilege of these two goddesses, the reason of
which was, perhaps, first learnt in the Samothracian mysteries. But
since, among the ancient Romans, artists were considered as of
inferior rank, and therefore rarely initiated into them, they would
doubtless know nothing of them; and what they knew not of they
clearly could not represent.” I should like to ask Spence whether
these common people were working independently, or under the
orders of superiors who might be initiated into the mysteries;
whether the artists occupied such a degraded position among the
Greeks; whether the Roman artists were not for the most part Greeks
by birth; and so on.
Statius and Valerius Flaccus describe an angry Venus with such
terrible features that we should take her at the moment for a fury
rather than for the goddess of love. Spence searches in vain for such
a Venus among the works of ancient art. What is his conclusion?
That more is allowed to the poet than to the sculptor and painter?
That should have been his inference. But he has once for all
established as a general rule that “scarce any thing can be good in a
poetical description which would appear absurd if represented in a
statue or picture.”[61] Consequently the poets must be wrong. “Statius
and Valerius Flaccus belong to an age when Roman poetry was
already in its decline. In this very passage they display their bad
judgment and corrupted taste. Among the poets of a better age such
a repudiation of the laws of artistic expression will never be
found.”[62]
Such criticism shows small power of discrimination. I do not
propose to undertake the defence of either Statius or Valerius, but
will simply make a general remark. The gods and other spiritual
beings represented by the artist are not precisely the same as those
introduced by the poet. To the artist they are personified abstractions
which must always be characterized in the same way, or we fail to
recognize them. In poetry, on the contrary, they are real beings,
acting and working, and possessing, besides their general character,
qualities and passions which may upon occasion take precedence.
Venus is to the sculptor simply love. He must therefore endow her
with all the modest beauty, all the tender charms, which, as
delighting us in the beloved object, go to make up our abstract idea
of love. The least departure from this ideal prevents our recognizing
her image. Beauty distinguished more by majesty than modesty is no
longer Venus but Juno. Charms commanding and manly rather than
tender, give us, instead of a Venus, a Minerva. A Venus all wrath, a
Venus urged by revenge and rage, is to the sculptor a contradiction in
terms. For love, as love, never is angry, never avenges itself. To the
poet, Venus is love also, but she is the goddess of love, who has her
own individuality outside of this one characteristic, and can therefore
be actuated by aversion as well as affection. What wonder, then, that
in poetry she blazes into anger and rage, especially under the
provocation of insulted love?
The artist, indeed, like the poet, may, in works composed of
several figures, introduce Venus or any other deity, not simply by her
one characteristic, but as a living, acting being. But the actions, if not
the direct results of her character, must not be at variance with it.
Venus delivering to her son the armor of the gods is a subject equally
suitable to artist and poet. For here she can be endowed with all the
grace and beauty befitting the goddess of love. Such treatment will be
of advantage as helping us the more easily to recognize her. But
when Venus, intent on revenging herself on her contemners, the men
of Lemnos, wild, in colossal shape, with cheeks inflamed and
dishevelled hair, seizes the torch, and, wrapping a black robe about
her, flies downward on the storm-cloud,—that is no moment for the
painter, because he has no means of making us recognize her. The
poet alone has the privilege of availing himself of it. He can unite it
so closely with some other moment when the goddess is the true
Venus, that we do not in the fury forget the goddess of love. Flaccus
does this,—
Neque enim alma videri
Jam tumet; aut tereti crinem subnectitur auro,
Sidereos diffusa sinus. Eadem effera et ingens
Et maculis suffecta genas; pinumque sonantem
Virginibus Stygiis, nigramque simillima pallam.[63]

And Statius also,—


Illa Paphon veterem centumque altaria linquens,
Nec vultu nec crine prior, solvisse jugalem
Ceston, et Idalias procul ablegasse volucres
Fertur. Erant certe, media qui noctis in umbra
Divam, alios ignes majoraque tela gerentem,
Tartarias inter thalamis volitasse sorores
Vulgarent: utque implicitis arcana domorum
Anguibus, et sæva formidine cuncta replerit
Limina.[64]

Or, we may say, the poet alone possesses the art of so combining
negative with positive traits as to unite two appearances in one. No
longer now the tender Venus, her hair no more confined with golden
clasps, no azure draperies floating about her, without her girdle,
armed with other flames and larger arrows, the goddess hastes
downward, attended by furies of like aspect with herself. Must the
poet abstain from the use of this device because artists are debarred
from it? If painting claim to be the sister of poetry, let the younger at
least not be jealous of the elder, nor seek to deprive her of ornaments
unbecoming to herself.
IX.

When we compare poet and painter in particular instances, we


should be careful to inquire whether both have had entire freedom,
and been allowed to labor for the highest results of their art without
the exercise of any constraint from without.
Religion often exercised such constraint upon the old artists. A
work, devotional in character, must often be less perfect than one
intended solely to produce pleasure. Superstition loaded the gods
with symbols which were not always reverenced in proportion to
their beauty.
In the temple of Bacchus at Lemnos, from which the pious
Hypsipyle rescued her father under the guise of the deity,[65] the god
was represented horned. So he doubtless appeared in all his temples,
the horns being symbols typical of his nature and functions. The
unfettered artist, whose Bacchus was not designed for a temple,
omitted the symbol. If, among the statues of the god that remain to
us, we find none with horns,[66] that circumstance perhaps proves
that none of them were sacred statues, representing the god in the
shape under which he was worshipped. We should naturally expect,
too, that against such the fury of the pious iconoclasts in the first
centuries of Christianity would have been especially directed. Only
here and there a work of art was spared, because it had never been
desecrated by being made an object of worship.
But since, among the antiques that have been unburied, there are
specimens of both kinds, we should discriminate and call only those
works of art which are the handiwork of the artist, purely as artist,
those where he has been able to make beauty his first and last object.
All the rest, all that show an evident religious tendency, are unworthy
to be called works of art. In them Art was not working for her own
sake, but was simply the tool of Religion, having symbolic
representations forced upon her with more regard to their
significance than their beauty. By this I do not mean to deny that
religion often sacrificed meaning to beauty, or so far ceased to
emphasize it, out of regard for art and the finer taste of the age, that
beauty seemed to have been the sole end in view.
If we make no such distinction, there will be perpetual strife
between connoisseurs and antiquarians from their failure to
understand each other. When the connoisseur maintains, according
to his conception of the end and aim of art, that certain things never
could have been made by one of the old artists, meaning never by
one working as artist from his own impulse, the antiquarian will
understand him to say that they could never have been fashioned by
the artist, as workman, under the influence of religion or any other
power outside the domain of art. He will therefore think to confute
his antagonist by showing some figure which the connoisseur,
without hesitation, but to the great vexation of the learned world,
will condemn back to the rubbish from which it had been dug.[67]
But there is danger, on the other hand, of exaggerating the
influence of religion on art. Spence furnishes a remarkable instance
of this. He found in Ovid that Vesta was not worshipped in her
temple under any human image, and he thence drew the conclusion
that there had never been any statues of the goddess. What had
passed for such must be statues, not of Vesta, but of a vestal virgin.
[68]
An extraordinary conclusion! Because the goddess was
worshipped in one of her temples under the symbol of fire, did artists
therefore lose all right to personify after their fashion a being to
whom the poets give distinct personality, making her the daughter of
Saturn and Ops, bringing her into danger of falling under the ill
treatment of Priapus, and narrating yet other things in regard to her?
For Spence commits the further error of applying to all the temples
of Vesta and to her worship generally what Ovid says only of a
certain temple at Rome.[69] She was not everywhere worshipped as in
this temple at Rome. Until Numa erected this particular sanctuary,
she was not so worshipped even in Italy. Numa allowed no deity to
be represented in the shape of man or beast. In this prohibition of all
personal representations of Vesta consisted, doubtless, the
reformation which he introduced into her rites. Ovid himself tells us
that, before the time of Numa, there were statues of Vesta in her
temple, which, when her priestess Sylvia became a mother, covered
their eyes with their virgin hands.[70] Yet further proof that in the
temples of the goddess outside the city, in the Roman provinces, her
worship was not conducted in the manner prescribed by Numa, is
furnished by various old inscriptions, where mention is made of a
priest of Vesta (Pontificis Vestæ).[71] At Corinth, again, was a temple
of Vesta without statues, having only an altar whereon sacrifices
were offered to the goddess.[72] But did the Greeks, therefore, have no
statues of Vesta? There was one at Athens in the Prytaneum, next to
the statue of Peace.[73] The people of Iasos boasted of having one in
the open air, upon which snow and rain never fell.[74] Pliny mentions
one in a sitting posture, from the chisel of Scopas, in the Servilian
gardens at Rome, in his day.[75] Granting that it is difficult for us now
to distinguish between a vestal virgin and the goddess herself, does
that prove that the ancients were not able or did not care to make the
distinction? Certain attributes point evidently more to one than the
other. The sceptre, the torch, and the palladium would seem to
belong exclusively to the goddess. The tympanum, attributed to her
by Codinus, belongs to her, perhaps, only as the Earth. Or perhaps
Codinus himself did not know exactly what it was he saw.[76]
X.

Spence’s surprise is again aroused in a way that shows how little he


has reflected on the limits of poetry and painting.
“As to the muses in general,” he says, “it is remarkable that the
poets say but little of them in a descriptive way; much less than
might indeed be expected for deities to whom they were so
particularly obliged.”[77]
What is this but expressing surprise that the poets, when they
speak of the muses, do not use the dumb language of the painter? In
poetry, Urania is the muse of astronomy. Her name and her
employment reveal her office. In art she can be recognized only by
the wand with which she points to a globe of the heavens. The wand,
the globe, and the attitude are the letters with which the artist spells
out for us the name Urania. But when the poet wants to say that
Urania had long read her death in the stars,—
Ipsa diu positis lethum prædixerat astris
Urania.[78]

Why should he add, out of regard to the artist,—Urania, wand in


hand, with the heavenly globe before her? Would that not be as if a
man, with the power and privilege of speech, were to employ the
signs which the mutes in a Turkish seraglio had invented to supply
the want of a voice?
Spence expresses the same surprise in regard to the moral beings,
or those divinities who, among the ancients, presided over the
virtues and undertook the guidance of human life.[79] “It is
observable,” he says, “that the Roman poets say less of the best of
these moral beings than might be expected. The artists are much
fuller on this head; and one who would know how they were each set
off must go to the medals of the Roman emperors. The poets, in fact,
speak of them very often as persons; but of their attributes, their
dress, and the rest of their figure they generally say but little.”
When a poet personifies abstractions he sufficiently indicates their
character by their name and employment.
These means are wanting to the artist, who must therefore give to
his personified abstractions certain symbols by which they may be
recognized. These symbols, because they are something else and
mean something else, constitute them allegorical figures.
A female figure holding a bridle in her hand, another leaning
against a column, are allegorical beings. But in poetry Temperance
and Constancy are not allegorical beings, but personified
abstractions.
Necessity invented these symbols for the artist, who could not
otherwise indicate the significance of this or that figure. But why
should the poet, for whom no such necessity exists, be obliged to
accept the conditions imposed upon the artist?
What excites Spence’s surprise should, in fact, be prescribed as a
law to all poets. They should not regard the limitations of painting as
beauties in their own art, nor consider the expedients which painting
has invented in order to keep pace with poetry, as graces which they
have any reason to envy her. By the use of symbols the artist exalts a
mere figure into a being of a higher order. Should the poet employ
the same artistic machinery he would convert a superior being into a
doll.
Conformity to this rule was as persistently observed by the
ancients as its studious violation is by the viciousness of modern
poets. All their imaginary beings go masked, and the writers who
have most skill in this masquerade generally understand least the
real object of their work, which is to let their personages act, and by
their actions reveal their character.
Among the attributes by which the artist individualizes his
abstractions, there is one class, however, better adapted to the poet
than those we have been considering, and more worthy of his use. I
refer to such as are not strictly allegorical, but may be regarded as
instruments which the beings bearing them would or could use,
should they ever come to act as real persons. The bridle in the hand
of Temperance, the pillar which supports Constancy are purely
allegorical, and cannot therefore be used by the poet. The scales in
the hand of Justice are less so, because the right use of the scales is
one of the duties of Justice. The lyre or flute in the hand of a muse,
the lance in the hand of Mars, hammer and tongs in the hands of
Vulcan, are not symbols at all, but simply instruments without which
none of the actions characteristic of these beings could be performed.
To this class belong the attributes sometimes woven by the old poets
into their descriptions, and which, in distinction from those that are
allegorical, I would call the poetical. These signify the thing itself,
while the others denote only some thing similar.[80]
XI.

Count Caylus also seems to require that the poet should deck out
the creatures of his imagination with allegorical attributes.[81] The
Count understood painting better than poetry.
But other points more worthy of remark have struck me in the
same work of his, some of the most important of which I shall
mention here for closer consideration.
The artist, in the Count’s opinion, should make himself better
acquainted with Homer, that greatest of all word painters,—that
second nature, in fact. He calls attention to the rich and fresh
material furnished by the narrative of the great Greek, and assures
the painter that the more closely he follows the poet in every detail,
the nearer his work will approach to perfection.
This is confounding the two kinds of imitation mentioned above.
The painter is not only to copy the same thing that the poet has
copied, but he is to copy it with the same touches. He is to use the
poet not only as narrator, but as poet.
But why is not this second kind of imitation, which we have found
to be degrading to the poet, equally so to the artist? If there had
existed previous to Homer such a series of pictures as he suggests to
Count Caylus, and we knew that the poet had composed his work
from them, would he not lose greatly in our estimation? Why should
we not in like manner cease to admire the artist who should do no
more than translate the words of the poet into form and color?
The reason I suppose to be this. In art the difficulty appears to lie
more in the execution than in the invention, while with poetry the
contrary is the case. There the execution seems easy in comparison
with the invention. Had Virgil copied the twining of the serpents
about Laocoon and his sons from the marble, then his description
would lose its chief merit; for what we consider the more difficult
part had been done for him. The first conception of this grouping in
the imagination is a far greater achievement than the expression of it
in words. But if the sculptor have borrowed the grouping from the
poet, we still consider him deserving of great praise, although he
have not the merit of the first conception. For to give expression in
marble is incalculably more difficult than to give it in words. We
weigh invention and execution in opposite scales, and are inclined to
require from the master as much less of one as he has given us more
of the other.
There are even cases where the artist deserves more credit for
copying Nature through the medium of the poet’s imitation than
directly from herself. The painter who makes a beautiful landscape
from the description of a Thomson, does more than one who takes
his picture at first hand from nature. The latter sees his model before
him; the former must, by an effort of imagination, think he sees it.
One makes a beautiful picture from vivid, sensible impressions, the
other from the feeble, uncertain representations of arbitrary signs.
From this natural readiness to excuse the artist from the merit of
invention, has arisen on his part an equally natural indifference to it.
Perceiving that invention could never be his strong point, but that his
fame must rest chiefly on execution, he ceased to care whether his
theme were new or old, whether it had been used once or a hundred
times, belonged to himself or another. He kept within the narrow
range of a few subjects, grown familiar to himself and the public, and
directed all his invention to the introducing of some change in the
treatment, some new combination of the old objects. That is actually
the meaning attached to the word “invention” in the old text-books
on painting. For although they divide it into the artistic and the
poetic, yet even the poetic does not extend to the originating of a
subject, but solely to the arrangement or expression.[82] It is
invention, not of the whole, but of the individual parts and their
connection with one another; invention of that inferior kind which
Horace recommended to his tragic poet:
Tuque
Rectius Iliacum carmen deducis in actus,
Quam si proferres ignota indictaque primus.[83]

You might also like