Instant download Decoupling drupal: a decoupled design approach for web applications 1st edition dee
Visit to download the full and correct content document: https://textbookfull.com/product/decoupling-drupal-a-decoupled-design-approach-forweb-applications-1st-edition-deepali-mayekar-auth/
More products digital (pdf, epub, mobi) instant download maybe you interests ...
Decoupled Drupal in Practice Architect and Implement
Decoupled Drupal Architectures Across the Stack 1st Edition Preston So
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image, we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Cover image by Freepik (www.freepik.com)
Managing Director: Welmoed Spahr
Editorial Director: Todd Green
Acquisitions Editor: Celestin Suresh John
Development Editor: Matthew Moodie
Technical Reviewer: Gaurav Mishra
Coordinating Editor: Sanchita Mandal
Copy Editor: Sharon Wilkey
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science+Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For information on translations, please e-mail rights@apress.com, or visit www.apress.com/ rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/. For more detailed information, please visit www.apress.com/source-code
Printed on acid-free paper
About the Author
Deepali Mayekar has been in the technology field for 17 years and has worked on various technologies. She is an avid reader and writer of books on technologies she has used. She is an electronics engineer from Mumbai University and an Oracle-certified Java programmer. She has been working on providing solutions using Drupal for a few years. Her interests include the Internet of Things, and she specializes in lightweight applications using separation of concerns.
About the Technical Reviewer
Gaurav Mishra is an expert in user-interface development and user-experience design, with more than 10 years of experience. He provides workshops and training in UI development, UX design, and Drupal. Gaurav have played a key role in the success of many organizations and likes to build products and services from scratch. He lives in New Delhi, India, and likes to spend his leisure time with his baby, Yuvika, and his wife, Neeti. He likes all genres of music, from Indian classical to club music. Gaurav can be reached at mr.gauravmishr@gmail.com and he tweets at @gauravmishr.
Introduction
When I started working on Drupal, I experienced the modular Drupal platform, which could do anything that a modern content management system can do— and much more. “What else can you do with Drupal?” I always thought whenever I worked with it. Drupal is popular for its content management application code that has been used across various industries.
As a web content management system (CMS), Drupal has enabled the creation of feature- and content-rich web sites for organizations large and small. The strength of Drupal code and its popularity means that Drupal and headless Drupal can help you build better applications. Drupal has a very thriving developer community that is developing new and interesting contributed modules. However, even with the simplicity of Drupal 8, similar results can be achieved for decoupling the front end and the back end. You can read about the various levels of decoupling further in this book.
This book focuses specifically on headless, or decoupled, Drupal. I’ll walk you through the content management system as well as the decoupled architecture and its advantages across the various aspects of web application building. Finally, this book answers the question of why decoupled Drupal? I hope this book helps you build decoupled web applications and reap the benefits of headless Drupal.
Drupal on My Mind
I was introduced to Drupal in this decade. During this time, I have seen the Drupal community getting stronger, building new features, and frequently releasing major versions of the package. After evaluating several tools for content management systems (CMSs), my connection with Drupal has continued to stay strong and has made me wonder, what else can we do with Drupal?
The Drupal interface has made building services easy from the very beginning, and so it’s been very adaptable to stand-alone services as well as lightly coupled applications. Services such as content authoring, content version management, and content publishing can all be used independently. Ideally, content management systems are a bundle of these services interacting within a given context and time. Drupal’s functioning is oblivious to the database used or to the container and cloud used to deploy the source. Drupal’s core functionality is sturdy and functions well for use in enterprise systems. Enterprises including government web sites (for example, whitehouse.gov), college web sites (University of Minnesota), and media web sites (The Beatles official site) have embraced Drupal for their content management needs. Many have used Drupal for their complete web-site management, whereas others have chosen Drupal modules for critical tasks in the back end. These choices made by IT departments within these companies may change in the future, but Drupal easily adapts to these changing needs. Drupal’s entire setup takes no more than a few minutes, and its upgrades are easy and cost-efficient.
A typical enterprise-level web site will not be just a singled-out xyz.com with a model-view-controller architecture, but will have multiple back-end web applications to provide for the content's life cycle. This is the modern way of creating a web site, and we can be sure that the complex back-end systems are not going to be any simpler in the future. Just as the human mind is able to process various feeds simultaneously and to make references to the future and the past, the user experience on the World Wide Web is getting much more complex. The best we can do is to make our internal components of complex systems simpler and less coupled.
Mobile applications and single-page applications (SPAs) also use Drupal to meet their content management needs. Such is the reach of Drupal that thriving communities have ensured that Drupal has touched every possible industry you can think of in the past decade. From its very beginning, Drupal has had the intrinsic capability to provide services as Drupal as platform, and that has been the reason for its success in this era of microservices and REST.
D. Mayekar, Decoupling Drupal, https://doi.org/10.1007/978-1-4842-3321-4_1
Because this book is not an introduction to Drupal, I presume that you are already familiar with it. If you haven’t worked with it, I expect that you have at considered replacing your current content management system with Drupal, WordPress, Joomla, or any other open source package.
In this chapter, you will read about the content management system workflow, its evolution, and a comparison of monolithic and decoupled design. Drupal has been one of the first players to embrace decoupled design, and this chapter will take you through its details.
Modern Web Applications
Whenever stakeholders of large organizations decide to reduce the cost of buying software (because of the sheer pain of costs rising in proprietary systems with every new feature— big or small—added to the package), this is an ideal time to consider Drupal. Those involved in such big decisions should evaluate the power, enterprise-level security, and features possible within the Drupal world. Drupal is built using PHP, and new modules are constantly being created with the latest WebJars or Node.js, for example—just as in other leading open source content management systems such as WordPress or Joomla. The nature of PHP, a server-side scripting language, is to churn out a feature as quickly as possible. Drupal has stayed true to its intrinsic nature of building code packages, which makes the Drupal engine (core) stronger but also pliable enough to add new features.
Many leading content management systems have stood the test of time and continuously upgraded their systems; most notable are Adobe Experience Manager and TeamSite. TeamSite has provided strong support via Erlang and XML to the website modernization needs of many companies. But the behavior that irks most people using monolithic and proprietary content management systems is the long debugging time required when an issue occurs. Content management systems should play a critical role in reducing the time required for content to be live and for the content to be arranged in the web context. This combination of time and space accuracy needs to be 100 percent correct for any site user, in any locale, at any time. This accuracy that the content management system delivers helps uphold a company’s brand value, trademarks, and copyrights as well as its ability to execute marketing strategies on the Web. If either the timely appearance of the online content or its spatial arrangement does not get implemented as expected, the organization’s brand image and value are directly affected. Whoever said that “a picture speaks a thousand words” must have been well versed in content management systems, because on a web site, for an image to make sense, it has to be placed in the correct context.
For these reasons, the CMS workflow is designed to be accurate, to deliver online content on time and within the correct spatial coordinates of your web page or app. A lot of application engineering is done to make this happen programmatically, requiring a distribution of responsibilities across the content management team and the information technology team within a given organization.
For example, many leading content management systems enable users to create beautiful web pages by using interfaces made from Java code that can be easily deployed to a live site. An expert skill level in the respective tool is needed to curate such pages, and the team should possess a good understanding of the Java code that runs beneath. Such teams thus have to master delivering content quickly by avoiding any loss of communication time between the front end and the back end. Adobe Experience Manager is a good example of a provider of such heavy applications. The UX features provided by these types of packages is outstanding, but the features are not always up-to-date, and many times IT teams have to wait until the features are available in the tool's product release plan. For example, early in the decade, some content management system packages were not REST compliant or compatible with leading social sites, and this was a setback for companies using these older versions of tools to render content. With Drupal, such delays in feature releases are minimal, and Drupal upgrades are quick. Product companies building content management systems were working hard to make their products that were using the monolithic design focused on adding more control to the controller of such applications, while not effectively providing a continuous evolution of the user experience and microservices. The features and modals that Bootstrap (www.webjars.org) has been able to offer recently are admirable, and many web sites wanted to take advantage of these developments. These WebJars are client-side libraries (for example, jQuery and Bootstrap) packaged into JAR files. Drupal is different, and its architecture provides an all-encompassing change: microservices and REST-based services are encouraged within the Drupal community, and it’s possible to use Drupal in a decoupled manner for content management. Drupal has well-separated modules, and each module can work independently, with few (or acceptable) dependencies on the core modules. One of the sturdy modules we will discuss in this book is the Workflow module, which is the backbone of Drupal’s content management workflow.
If needed, Drupal can also be designed and programmed to run monolithically. However this is not mandatory, and depends on the discretion of the enterprise application design team. As in other monolithic applications, debugging Drupal errors is difficult. After configurations/code is fixed, a test run is needed that can be costly, because organizations must regressively test many modules before and after the impacted code. In a monolithic Drupal environment, the efforts will pile up on this design flaw, and the ability of programmers to churn out new modules and be up-to-date with newer and trendier user experiences will gradually diminish.
Such delays in the development of web sites and user interfaces create an environment of anxiety for senior management in the IT department. Alternatives to proprietary and formerly favorite CMSs are put on the table for consideration of an upgrade or replacement. Drupal, an open source package for content management systems, has proven a savior; without resting on its past laurels, it has also been promoting headless, or decoupled, Drupal.
Figure 1-1 compares monolithic and decoupled design.
Figure 1-1. Decoupled vs. monolithic
Figure 1-1. (continued)
Decoupled design in Drupal is encouraged because it is not enough to reuse code; organizations should focus on reusing content as well. This concept of reusing content is possible with decoupled Drupal. Sometimes decoupled Drupal is also referred to as headless Drupal. The concept is the same.
The organization you represent may be global and spread across locales, but a certain percentage of its enterprise application’s elements will be shared. For example, when you start writing a new enterprise application, 20 percent of the content (including the logo, header, and footer) may be common among different sites hosted and supported by your enterprise. However, with time, this percentage of shared content may increase to 60 percent, and the need will arise to provide for the content life cycle in a more efficient
manner. Organizations make hosting decisions for their new business sites based on how much shared content needs to be maintained. In these cases, Drupal has the advantage with its adept workflows and content versioning.
By using decoupled Drupal, three critical risks can be reduced or completely eliminated: the cost of setting up new content management, the manual effort of entering content (this can sometimes be automated, though that’s not always recommended), and the possible loss or hacking of content
Decoupled Drupal has a single point of entry and exit for the content during the content's life cycle. The content does not exist unless it is entered into the Drupal content management system. When it is deleted or unpublished from the CMS, it ceases to exist in the context of the web application. Thus Drupal provides a secure and time-to-live-based environment for the content during its life cycle. Due to this secure advantage (a single point of entry and context-based storage), many organizations use decoupled Drupal for content storage and version management. In addition, Drupal stands out by providing something more: with its ability to store metadata, it can store the organization’s trademarks, copyrights, and other intellectual property. These intellectual property libraries can be made searchable and easily accessible through their organization in decoupled Drupal. This kind of outreach to various industries, from personal blogging to patent management, is possible only with decoupled design.
The Drupal platform is built such that it allows innumerable facets of content to be stored, and it is up to the Drupal architects and designers to pick and choose which attributes of the content they want to store as well as the publishing timeline. The data between content can also be linked with few configuration changes. The workflow for the content life cycle is built around the specifics chosen during design. Workflows should be designed by taking the business needs into consideration as well as the Drupal coverage of those needs. Workflows evolve like any other process and are not set in stone. So, the provision to bypass certain steps in the workflow should be made using administrative rights. You will read more about a typical content management workflow in this chapter, but content management and decoupled Drupal are not limited to a single workflow.
■ Note Monolithic design is not a good design to build if you have frequent new additions to the user experience. on important junctures—movement to the cloud, application containerization, and upgrades, for example—having a monolithic design may help to answer a few questions, but testing the main controller flow for all conditions is expensive for it departments. use this book to weigh the pros and cons using Drupal’s decoupled design.
Content Management Systems
Content management systems (CMSs) have been around for more than a decade. In the early days of mainframe computers and UNIX, content for order processing, data warehouses, and other applications was mainly text characters; during login and major junctures of the application, users would see text characters arranged to form the interface.
With the Hypertext Transfer Protocol (HTTP) and the Web gaining precedence over deeply connected systems, an era of web sites began in which images, decorated text, animation, and videos became an integral part of web site existence. Fault-tolerance was elevated, and replication was no longer a sin. Classified generally as content data, this was initially built inside the application server.
But as the application server started becoming overloaded and the content evolved, content creation tasks were isolated from content management. Furthermore, imageediting tools and audio/video-editing tools were used to create rich, interactive content. And now this content needed to be adapted to various locales and to numerous devices that would be used to interact with it. Responsive content was needed by everyone. Thus began the era of characterized by an indomitable need to use content management systems for any global site.
Figure 1-2 shows one of the first videos that was uploaded on YouTube in 2005. Notice the quality of the video and the thought process compared to more recent videos. This example is presented just to bring home the point that we have made huge advancements in the types of content we view today as compared to a decade ago. The change has been drastic, and content management systems evolved to adapt to the changes.
Figure 1-2. One of the first videos on YouTube (www.youtube.com/watch?v=jNQXAC9IVRw)
This video was hardly 18 seconds long. This and many other videos uploaded at that time were short, and the video was blurry. YouTube launched a new era of video content becoming bigger and better. The earlier Flash and HTML animations slowly bowed out of the Web.
How a Content Management System Works
Just as a book needs chapters, indexes, and an engaging book cover, a content management system is many such books sewn together, each making a reference to the other. Because of this interconnectivity and complexity, the number of features, functional and nonfunctional, increases, and these features cannot be developed through just a model-view-controller application.
The functional features are as follows:
• Content related
• Content creation
• Content entry
• Content review
• Content approval
• Content publishing
• API related (Service layer)
• Creation of content API over HTTP
The nonfunctional aspects of a content management system are as follows:
• Logging: Leaving an audit trail of who changed the content, or digital rights management (for example, copyrights)
• Security: In a distributed environment, managing security and preventing denial-of-service attacks to the subscribing applications
1. Point cuts: Monitoring endpoints and providing and maintenance
Content Creation
Content should make an impact on the viewer. In this first content-related step, content leaps out as an idea. Eventually, content goes through a complete idea-designimplementation cycle, but it starts as an idea. During the idea phase, we imagine the impact of the content by considering its potential success as part of a marketing strategy, the environmental changes that the content could bring, and the sales targets that it could help meet. Many companies outsource this activity to external creative agencies. The IT team handling content management in your organization needs to work closely with these agencies and marketing teams in order to understand the content idea and to launch clear timelines. It helps to be involved in the idea stage of content creation.
Content Entry
After content is received by the organization (often as delivered by the creative agency), the content management team needs to add that content into the CMS tool (Drupal, in this case). The content is entered based on the certain specifications (indicated by a template ort style guide) that were agreed upon by the collaborating teams before the content’s creation. The spatial arrangement of the content needs to be verified in a production-like environment according to the specifications. This task of checking the correctness is called content review
The people who enter the content during this stage are called content entry actors. Generally, these are internal members of the organization who specialize in lightweight HTML, CSS, and video content. They should be able to work with internal and external teams.
Content Review
During content review, the CMS team can send the content back to previous steps with objections. However, the objections should be stated precisely, with clear mention of the problematic content name, content type, content location (expected), and the actual issue/s. Sometimes the creative agencies may not consider the importance of the content’s reusability. However, the reviewer needs to be keep the focus on the organization’s needs and should build a strategy around reusing and building continuity in content.
The content review team always comprise internal organizational staff assigned to this task who work closely with the marketing and information technology teams.
Content Approval
Content approvers are senior supervisory staff responsible for approving the look and feel of the content as well as its timing. In addition, this team communicates the verity of the content. They work on the workflow, and each day may approve much of the content coming from their teams—generally, content entry personnel in different product categories. This workflow approval is traceable through audits, to ensure that the content is not passed on without verification to the higher environment.
These content approver actors are supervisors who have similar responsibilities as the content review team, but with the additional authority to reject or approve content in the context of the web site or web page. These people also have command over the product category, as they are accountable for it. Content approvers can take on the additional responsibility of digital rights management of the content.
Content Publishing
After content is approved, it can be published to the next ordinal environment by using a simple publish script that runs in the background or by using manual intervention. This choice of publishing component remains in the hands of the content management system team. They should consult the marketing teams to check how frequently the publishing and refreshing of content is needed by each unit. Such detailed publishing scenarios can be laid out to increase the productivity of the content management team; the application processing time is well-utilized in this way as well.
Along with content publishing, content can also be unpublished if the stakeholders have any special concerns or if there is new content that makes the existing content obsolete. Unpublishing content is generally based on the organization’s preferences and marketing strategy.
Content publishers could be more inclined toward release management and work as part of the IT team within the organization. Based on the organization’s needs and focus, this job of publishing could be handled by other members within the IT department and could be automated with deployment scripts.
Figure 1-3 shows the content management team’s personnel placement and handshake, or transfer of responsibility.
Content management teams follow the workflow multiple times a day, and many times for a single piece of content. The entry and review process may require sending multiple versions of an image or video to the next stage. This content should be forwarded sequentially to the approver without a glitch. Many teams have used e-mail for this workflow, to let the next action be known within the team. Sometimes a dashboard is effective as well. The content management system should be able to handle this configuration, messaging, and approval management.
Figure 1-3. Content management team
Creation of Content API over HTTP
API-based communication between the WebJar (front end) and the Drupal engine (back end) is the glue that keeps the two discrete systems in tandem. The past few major versions of Drupal have provided support for a REST-based API. Querying using the Drupal application node allows the service caller to receive the information in JSON format. This feature has been widely used for social media integration (for example, with Open Graph).
In decoupled Drupal, we use this feature a lot to make complete use of REST APIs. The end user and the content creators are oblivious to these APIs, because they just need to enter the content in Drupal and view it on the Web. They do not need to know the internal functioning of the APIs. The developers who have designed decoupled Drupal and support for this service layer need to be aware of the all the APIs. They need to run tests to ensure that the APIs are always functioning, especially because web applications these days are committed to the promise of high availability and performance.
In addition to the web site being the primary user of the APIs and Drupal being the back end, other origin sites could have been promised access to your organization’s content by a service subscribed by your organization. A typical example is a store locator that can access your product database or content library on Drupal by using an agreedupon API to provide your web page with stores when accessed with a combination key of location and product. These are just some of the ways content management systems are being used on the Web. These demands for third-party integration with web sites has been increasing because of the various SaaS-based products available, with less development needed for integration when used with decoupled Drupal. Figure 1-4 shows a common example of using decoupled Drupal with third-party integrations.
Figure 1-4. Easy integration with third-party hosted content
Nonfunctional Aspects
The nonfunctional aspects of a web site in decoupled Drupal present major concerns for security vulnerabilities (for example, a denial of service or an insufficient transport layer protocol), lossy data transmission, and access to secret information. In this section, you will learn about fixing these vulnerabilities by using other tools or systems in the Drupal ecosystem.
A denial of service (DoS) is a vulnerability that has been widely fixed by using higher-order caches or content delivery networks such as Akamai and CloudFront. Using these third-party tools requires a subscription or fees. Using decoupled Drupal does not increase this vulnerability; a web site that is already using a WebJar will continue to face the same level of DoS risk as it faces before changing to decoupled Drupal. If a new site has to be migrated from a complex but advanced Adobe Experience Manager to a WebJar, Angular, decoupled Drupal, the vulnerability needs to be tested before implementation and fixed as required. The REST API is widely used, and the initial risks that concerned developers and organizations in the past have now been allayed.
Drupal is also an amazing tool for reconciling during audits. Leaving audit trails indicating the insertion, review, and approval of content is important for teams that support large content management systems. It has been found that although content has a shelf life— during which it is created, used, and in the end fades out—the content on the site has an exponential rise in number of contents on site and the internal categories. Contrary to the product category, content also form their own categories which help them distinguish their space on the page. For example, the Header-Footer category includes the header and footer, which ideally should be the same across the site. The Interactive and Banner Page category includes occasion-based content. Later in this section, you will read more about the classification of content.
As we build content categories, the content’s hierarchy gets formed for your site. This taxonomy helps keep the web site organized and free of errors. The folder structure in the taxonomy also maintains the life of the content. The content life can be extended based on decisions by the creative agencies and marketing team. To extend this lifetime, a parameter can be set on each piece of content that will determine its expiration date and time. Content management is an ongoing process that never stops as long as we have content to share.
These content management tasks include reviewing the taxonomy, reviewing the expiration of visible content, evaluating content, deciding which content should be the most important and visible, and reviewing the publishing status. These tasks need to be done regularly by the content management team, mainly the content approvers and the IT team. During these discussions, team members may use reports generated by an analytics tool that points out the most viewed content/products, videos, images, and interactive pages.
The publishing status and reports can be derived from the Drupal Workflow module. The e-mail feature can be enabled to inform the publisher of any failure that occurs between two environments or of any other PHP error.
These reviews should happen in addition to the daily tasks completed within the content workflow described previously in Figure 1-3.
Over the years, the location of content and the space it needs has evolved. Content dwells in files on shared storage, on shared space in the cloud (for example, Amazon S3), and in database fields. A strategy to extract the content and render it onscreen requires the help of a framework. Templates act as a framework for the content. The framework should support requests from different countries or from different sites and render the exact page template and the content to the WebJar. The JAR will then render the content as expected to the user. An average a web site whose main purpose is marketing will have no more than 10 to 15 templates. A web-site style guide should detail the various design aspects of the web site and its templates. Because JavaScript Object Notation (JSON) has become a standard for sharing content over browsers and servers alike, we will see greater use of JSON in accessing content.
Using JSON to Access Content
The last few major versions of Drupal have offered REST-based access to the content nodes. The JavaScript in the front end needs to access the nodes and should be able to easily convert the JSON into the required JavaScript object. An example of JSON reading code can be seen here:
var myCarousel = '{ "name":"Page_Homepage", "description":"My company - Latest Deals", "url1":"//url of the image 1 of the carousel in cloud"}', "url2":"//url of the image 2 of the carousel in cloud"}
var myObj = JSON.parse(myJSON);
Similar fields in the Drupal content entry screen can be stored with names such as Name, Description, and URL, for ease of understanding.
A carousel, a common user experience feature, can be implemented using decoupled Drupal. Maintenance of this feature generally involves changing images in Drupal by using the content entry module. Once the images or the corresponding URLs are changed, the module needs to be published to the succeeding environments and made live.
An example of a carousel using Bootstrap is shown in Figure 1-5.
Figure 1-5. Using carousel with Bootstrap (https://www.w3schools.com/bootstrap/ bootstrap_carousel.asp)
■ Note headers, carousels, sliders, and many other features that elevate the user experience can be broken down into individual components such as text, image (various sizes), videos (links, snippets), placeholders, fallback images, and metadata. Content can be stored in the Drupal template or content entry form and can be published to a live site by using the preceding content management process.
Testing
Testing in decoupled Drupal is proportional to the development of services and hence is easy to estimate. The team would need to write one-time test cases in PHP to test the workflow or use web-based Selenium. There are no restrictions on how the content management workflow can be tested; sometimes even e-mail confirmations are enough to ensure a complete test. Every module in Drupal comes with its own test folder, and the test cases can be placed in that folder. During the design of a decoupled Drupal application, a test plan needs to be created, and test cases need to be identified for all back-end operations in Drupal (for example, content authoring, content review/approval, and publishing tasks). As in a software testing life cycle for any test case, tests need to be modified with every release to confirm and match the latest configurations.
Connectivity tests between the Drupal back end, third-party service endpoints, and the front-end servers need to be monitored, and any errors need to be reported to the support or operations team in a timely manner.
The following types of tests can be planned:
• Manual tests: Before a major release of your enterprise application, run a content management user experience test to understand and document any errors or exceptions faced by a content management system user.
• Automated tests: Ping tests/Curl to check the connectivity between Drupal and the front end or third-party services to ensure that systems are communicating as expected.
• Regression tests: Identify critical components (images, texts, and video) for your site and run a visual comparison to confirm that the critical components do not change with the release (or confirm that the change is part of the release).
The test suite for decoupled Drupal is not extensive, but it is critical to test all the interfaces in order to ensure proper functioning of the content management workflow and the integration between front end and back end.
Drupal modules are well tested within the Drupal community. If any errors occur, you can report those errors on the Drupal site and get it fixed in due time on the portal.
Content Preparation Is Key
Content has a dual purpose. It’s like a play: you have a dress rehearsal and then the final play. The dress rehearsal and practice sessions are as important as the final display. In the context of content management systems, this preparation happens on a robust system consisting of user management, data persistence management, security, content review capability, and deployment tools all rolled into one. This is what makes Drupal and other content management systems so special.
User Management Is Integral to CMS
In our perspective for this book, users exists only in the hierarchy and operate under the formal process of content removal and additions when the organization chooses. The code that administers this user management feature is isolated from the outside world. The users are mostly internal, and very few content creators (probably external, thirdparty agencies) get access to the content management systems of an organization. The third-party users would need whitelisting of their IPs or may have short contracts with your organization and would walk in to your office for content delivery.
Marketing Sites and CMS
Let’s say you’re working on a marketing site and need to increase the number of viewers during the peak season. The time required, from entering content to publishing to the production server, should happen seamlessly and with the content management process described previously in Figure 2.
On a similar note, if your site is mainly for critical information (for example, whitehouse.gov), it is even more imperative that critical information is accurate, reviewed, and then published to the Web. Keeping the sacred information on a distributed environment and not on the same application server helps keep the theory of separation of concerns afloat.
The key differences between a government site and a marketing site are shown in Table 1-1
Content workflowCritically importantImportant Not so important
Content schedulingImportant Important Important
Digital rights management Important Very importantImportant
Content validityRequired Essential Not so essential
EXERCISE FOR CHAPTER 1
Download Drupal 8. at the time this book was written, 8.3.7 was the latest release available for download. you may download from www.drupal.org/project/ drupal/releases/8.3.7. then follow these steps:
1. orchestrate the scheduler for the content management workflow (refer to Figure 1-3).
2. note the differences between Drupal 8 and previous versions. exploring Drupal 8 is worthwhile so you can know which features are readily available in this version.
3. understand and document the content management workflow in your organization.
2
Decoupled Drupal
Companies don’t want to start developing a site from scratch. They want to use existing sites and the data (database) and content already created. A multisite environment, in which the front end uses the existing DB structure and other resources to deliver web pages, has been of prime importance to IT architects. Organizations evolve over time. Sometimes a new organization is built by combining with another organization, eliminating an existing division in order to focus on other areas, for example. A medical services organization might buy a new hospital, for instance; however, the hospital will continue to provide services from the same master list. This will not change over time. In such situations, a multisite environment allows different sites to exist from the same codebase but with a different domain names, logos, contact pages, and so forth. This chapter covers using Drupal for multisite hosting, followed by other decoupled Drupal advantages.
Multisite
An example of multisite national newspaper is shown in Figure 2-1. The newspaper has monthly releases for new features and general technology maintenance. Reporter teams from different locations enter content into the site as they would in any other content management system. The preferences and suggestions of regional users are thoroughly considered and then entered as change requests for the releases. The content entry team can focus on improving content while the multisite application provides all the support that can be rendered to make the news reporting process efficient and accurate (timely).
The administration login and process can be complex at the start. A super admin with very high-level access and then regional admins, content approvers, content reviewers, and content creators log in, and their credentials can be created in the previously mentioned user hierarchy.
Multisite decoupled Drupal could be the most efficient use of Drupal or any other content management system (for example, WordPress),. However, as developers or architects, we do not always have a level playing field; often organizations are already using a favorite flavor of CMS, and you should assume they like it a lot.
Advantages of Decoupled Design
To leverage an existing site, you must dissect and analyze the various web components separately. Developing a monolithic enterprise application should be set aside. Observations of the nonfunctional requirements of the site (for example, security, logging, reporting, performance, response time, cloud delivery network, and infrastructure) should be analyzed, and a report should be provided to the team of solution architects redesigning the application.
Figure 2-1. Multisite Drupal
Another random document with no related content on Scribd:
THE CAXTONS—A FAMILY PICTURE.
CHAPTER I.
“Sir—sir—it is a boy!”
“A boy,” said my father, looking up from his book, and evidently much puzzled; “what is a boy?”
Now, my father did not mean by that interrogatory to challenge philosophical inquiry, nor to demand of the honest but unenlightened woman who had just rushed into his study, a solution of that mystery, physiological and psychological, which has puzzled so many curious sages, and lies still involved in the question, “What is man?” For, as we need not look farther than Dr Johnson’s Dictionary to know that a boy is “a male child”—i. e., the male young of man; so he who would go to the depth of things, and know scientifically what is a boy, must be able first to ascertain “what is a man?” But, for aught I know, my father may have been satisfied with Buffon on that score, or he may have sided with Monboddo. He may have agreed with Bishop Berkeley—he may have contented himself with Professor Combe—he may have regarded the genus spiritually, like Zeno, or materially, like Epicurus. Grant that boy is the male young of man, and he would have had plenty of definitions to choose from. He might have said, “Man is a stomach—ergo, boy a male young stomach. Man is a brain,—boy a male young brain. Man is a bundle of habits—boy a male young bundle of habits. Man is a machine—boy a male young machine. Man is a tail-less monkey—boy a male young tail-less monkey. Man is a combination of gases—boy a male young combination of gases. Man is an appearance—boy a male young appearance,” &c. &c., and etcetera, ad infinitum! And if none of these definitions had entirely satisfied my father, I am perfectly
persuaded that he would never have come to Mrs Primmins for a new one.
But it so happened that my father was at that moment engaged in the important consideration whether the Iliad was written by one Homer—or was rather a collection of sundry ballads, done into Greek by divers hands, and finally selected, compiled, and reduced into a whole by a Committee of Taste, under that elegant old tyrant Pisistratus; and the sudden affirmation “It is a boy,” did not seem to him pertinent to the thread of the discussion. Therefore he asked, “What is a boy?”—vaguely, and, as it were, taken by surprise.
“Lord, sir!” said Mrs Primmins, “what is a boy? Why, the baby!”
“The baby!” repeated my father, rising. “What, you don’t mean to say that Mrs Caxton is—eh—?”
“Yes I do,” said Mrs Primmins, dropping a curtsey; “and as fine a little rogue as ever I set eyes upon.”
“Poor, dear woman!” said my father with great compassion. “So soon too—so rapidly!” he resumed in a tone of musing surprise. “Why, it is but the other day we were married!”
“Bless my heart, sir,” said Mrs Primmins, much scandalised, “it is ten months and more.”
“Ten months!” said my father with a sigh. “Ten months! and I have not finished fifty pages of my refutation of Wolfe’s monstrous theory! In ten months a child!—and I’ll be bound complete—hands, feet, eyes, ears, and nose!—and not like this poor Infant of Mind (and my father pathetically placed his hand on the treatise)—of which nothing is formed and shaped—not even the first joint of the little finger! Why, my wife is a precious woman! Well, keep her quiet. Heaven preserve her, and send me strength—to support this blessing!”
“But your honour will look at the baby?—come, sir!” and Mrs Primmins laid hold of my father’s sleeve coaxingly.
“Look at it—to be sure,” said my father kindly; “look at it, certainly, it is but fair to poor Mrs Caxton; after taking so much trouble, dear soul!”
Therewith my father, drawing his dressing robe round him in more stately folds, followed Mrs Primmins up stairs, into a room very carefully darkened.
“How are you, my dear?” said my father, with compassionate tenderness, as he groped his way to the bed.
A faint voice muttered, “Better now,—and so happy!” And, at the same moment, Mrs Primmins pulled my father away, lifted a coverlid from a small cradle, and, holding a candle within an inch of an undeveloped nose, cried emphatically, “There—bless it!”
“Of course, ma’am, I bless it,” said my father rather peevishly. “It is my duty to bless it;—B ! And this, then, is the way we come into the world!—red, very red,—blushing for all the follies we are destined to commit.”
My father sat down on the nurse’s chair, the women grouped round him. He continued to gaze on the contents of the cradle, and at length said musingly:—“And Homer was once like this!”
At this moment—and no wonder, considering the propinquity of the candle to his visual organs—Homer’s infant likeness commenced the first untutored melodies of nature.
“Homer improved greatly in singing as he grew older,” observed Mr Squills, the accoucheur, who was engaged in some mysteries in a corner of the room.
My father stopped his ears:—“Little things can make a great noise,” said he, philosophically; “and the smaller the thing the greater noise it can make.”
So saying, he crept on tiptoe to the bed, and, clasping the pale hand held out to him, whispered some words that no doubt charmed and soothed the ear that heard them, for that pale hand was suddenly drawn from his own, and thrown tenderly round his neck. The sound of a gentle kiss was heard through the stillness.
“Mr Caxton, sir,” cried Mr Squills, in rebuke, “you agitate my patient—you must retire.”
My father raised his mild face, looked round apologetically, brushed his eyes with the back of his hand, stole to the door, and vanished.
“I think,” said a kind gossip seated at the other side of my mother’s bed, “I think, my dear, that Mr Caxton might have shown more joy,— more natural feeling, I may say,—at the sight of the baby: and such a baby! But all men are just the same, my dear—brutes—all brutes, depend upon it.”
“Poor Austin!” sighed my mother feebly—“how little you understand him.”
“And now I shall clear the room,” said Mr Squills.—“Go to sleep, Mrs Caxton.”
“Mr Squills,” exclaimed my mother, and the bed-curtains trembled, “pray see that Mr Caxton does not set himself on fire;— and, Mr Squills, tell him not to be vexed and miss me.—I shall be down very soon—shan’t I?”
“If you keep yourself easy you will, ma’am.”
“Pray say so;—and, Primmins,—”
“Yes, ma’am.”
“Every one, I fear, is neglecting your master. Be sure,—(and my mother’s lips approached close to Mrs Primmins’ ear,)—be sure that you—air his nightcap yourself.”
“Tender creatures those women,” soliloquised Mr Squills, as, after clearing the room of all present, save Mrs Primmins and the nurse, he took his way towards my father’s study. Encountering the footman in the passage,—“John,” said he, “take supper into your master’s room—and make us some punch, will you?—stiffish!”
CHAPTER II.
“Mr Caxton, how on earth did you ever come to marry?” asked Mr Squills, abruptly, with his feet on the hob, while stirring up his punch.
That was a home question, which many men might reasonably resent. But my father scarcely knew what resentment was.
“Squills,” said he, turning round from his books, and laying one finger on the surgeon’s arm confidentially,—“Squills,” said he, “I should be glad to know myself how I came to be married.”
Mr Squills was a jovial good-hearted man—stout, fat, and with fine teeth, that made his laugh pleasant to look at as well as to hear. Mr Squills, moreover, was a bit of a philosopher in his way;—studied human nature in curing its diseases;—and was accustomed to say, that Mr Caxton was a better book in himself than all he had in his library. Mr Squills laughed and rubbed his hands.
My father resumed thoughtfully, and in the tone of one who moralises:—
“There are three great events in life, sir; birth, marriage, and death. None know how they are born, few know how they die. But I suspect that many can account for the intermediate phenomenon—I cannot.”
“It was not for money,—it must have been for love,” observed Mr Squills; “and your young wife is as pretty as she is good.”
“Ha!” said my father, “I remember.”
“Do you, sir?” exclaimed Squills, highly amused. “How was it?”
My father, as was often the case with him, protracted his reply, and then seemed rather to commune with himself than to answer Mr Squills.
“The kindest, the best of men,” he murmured,—“Abyssus Eruditionis: and to think that he bestowed on me the only fortune he had to leave, instead of to his own flesh and blood, Jack and Kitty. All at least that I could grasp deficiente manu, of his Latin, his Greek, his Orientals. What do I not owe to him!”
“To whom?” asked Squills. “Good Lord, what’s the man talking about?”
“Yes, sir,” said my father rousing himself, “such was Giles Tibbets, M.A., Sol Scientiarum, tutor to the humble scholar you address, and father to poor Kitty. He left me his Elzevirs; he left me also his orphan daughter.”
“Oh! as a wife—”
“No, as a ward. So she came to live here. I am sure there was no harm in it. But my neighbours said there was, and the widow Weltraum told me the girl’s character would suffer. What could I do? —Oh yes, I recollect all now! I married her, that my old friend’s child might have a roof to her head, and come to no harm. You see I was forced to do her that injury, for after all, poor young creature, it was a sad lot for her. A dull book-worm like me—cochleæ vitam agens, Mr Squills—leading the life of a snail. But my shell was all I could offer to my poor friend’s orphan.”
“Mr Caxton, I honour you,” said Squills emphatically, jumping up and spilling half a tumbler-full of scalding punch over my father’s legs. “You have a heart, sir! and I understand why your wife loves you. You seem a cold man; but you have tears in your eyes at this moment.”
“I dare say I have,” said my father, rubbing his shins: “it was boiling!”
“And your son will be a comfort to you both,” said Mr Squills, reseating himself, and, in his friendly emotion, wholly abstracted from all consciousness of the suffering he had inflicted. “He will be a dove of peace to your ark.”
“I don’t doubt it,” said my father ruefully, “only those doves, when they are small, are a very noisy sort of birds—non talium avium cantus somnum reducunt. However, it might have been worse. Leda had twins.”
“So had Mrs Barnabas last week,” rejoined the accoucheur. “Who knows what may be in store for you yet? Here’s a health to Master Caxton, and lots of brothers and sisters to him!”
“Brothers and sisters! I am sure Mrs Caxton will never think of such a thing, sir,” said my father almost indignantly. “She’s much too good a wife to behave so. Once, in a way, it is all very well; but twice
—and as it is, not a paper in its place, nor a pen mended the last three days: I, too, who can only write ‘cuspide duriusculâ’—and the Baker coming twice to me for his bill too! The Ilithyiæ are troublesome deities, Mr Squills.”
“Who are the Ilithyiæ,” asked the accoucheur.
“You ought to know,” answered my father, smiling. “The female dæmons who presided over the Neogilos or New-born. They take the name from Juno. See Homer, book XI. By the bye, will my Neogilos be brought up like Hector or Astyanax,—videlicet, nourished by its mother or by a nurse?”
“Which do you prefer, Mr Caxton?” asked Mr Squills, breaking the sugar in his tumbler. “In this I always deem it my duty to consult the wishes of the gentleman.”
“A nurse by all means, then,” said my father. “And let her carry him upo kolpo, next to her bosom. I know all that has been said about mothers nursing their own infants, Mr Squills; but poor Kitty is so sensitive, that I think a stout healthy peasant woman will be best for the boy’s future nerves, and his mother’s nerves, present and future too. Heigh-ho!—I shall miss the dear woman very much; when will she be up, Mr Squills?”
“Oh, in less than a fortnight!”
“And then the Neogilos shall go to school! upo kolpo—the nurse with him, and all will be right again,” said my father, with a look of sly mysterious humour, which was peculiar to him.
“School! when he’s just born?”
“Can’t begin too soon,” said my father positively; “that’s Helvetius’ opinion, and it’s mine too!”
CHAPTER III.
That I was a very wonderful child, I take for granted; but, nevertheless, it was not of my own knowledge that I came into possession of the circumstances set down in my former chapters. But my father’s conduct on the occasion of my birth made a notable impression upon all who witnessed it; and Mr Squills and Mrs Primmins have related the facts to me sufficiently often, to make me as well acquainted with them as those worthy witnesses themselves. I fancy I see my father before me, in his dark-gray dressing-gown, and with his odd, half sly, half innocent twitch of the mouth, and peculiar puzzling look, from two quiet, abstracted, indolently handsome eyes, at the moment he agreed with Helvetius on the propriety of sending me to school as soon as I was born. Nobody knew exactly what to make of my father—his wife excepted. Some set him down as a sage, some as a fool. As Hippocrates, in his well-known letter to Damagetes, saith of the great Democritus, he was contemptu et admiratione habitus—accustomed both to contempt and admiration. The neighbouring clergy respected him as a scholar, “breathing libraries;” the ladies despised him as an absent pedant, who had no more gallantry than a stock or a stone. The poor loved him for his charities, but laughed at him as a weak sort of man, easily taken in. Yet the squires and farmers found that, in their own matters of rural business, he had always a fund of curious information to impart; and whoever, young or old, gentle or simple, learned or ignorant, asked his advice, it was given with not more humility than wisdom. In the common affairs of life, he seemed incapable of acting for himself; he left all to my mother; or, if taken unawares, was pretty sure to be the dupe. But in those very affairs—if another consulted him—his eye brightened, his brow cleared, the desire of serving made him a new being: cautious, profound, practical. Too lazy or too languid where only his own interests were at stake—touch his benevolence, and all the wheels of the clockwork felt the impetus of the master-spring. No wonder that, to others, the nut of such a character was hard to crack! But, in the eyes of my poor mother, Augustine (familiarly Austin) Caxton was the best and the greatest of human beings; and certainly
she ought to have known him well, for she studied him with her whole heart, knew every trick of his face, and, nine times out of ten, divined what he was going to say, before he opened his lips. Yet certainly there were deeps in his nature which the plummet of her tender woman’s wit had never sounded; and, certainly, it sometimes happened that, even in his most domestic colloquialisms, my mother was in doubt whether he was the simple straightforward person he was mostly taken for. There was, indeed, a kind of suppressed subtle irony about him, too unsubstantial to be popularly called humour, but dimly implying some sort of jest, which he kept all to himself; and this was only noticeable when he said something that sounded very grave, or appeared to the grave very silly and irrational.
That I did not go to school—at least to what Mr Squills understood by the word school—quite so soon as intended, I need scarcely observe. In fact, my mother managed so well—my nursery, by means of double doors, was so placed out of hearing—that my father, for the most part, was privileged, if he so pleased, to forget my existence. He was once dimly recalled to it on the occasion of my christening. Now, my father was a shy man, and he particularly hated all ceremonies and public spectacles. He became uneasily aware that a great ceremony, in which he might be called upon to play a prominent part, was at hand. Abstracted as he was, and conveniently deaf at times, he had heard significant whispers about “taking advantage of the bishop’s being in the neighbourhood,” and “twelve new jelly glasses being absolutely wanted,” to be sure that some deadly festivity was in the wind. And, when the question of godmother and godfather was fairly put to him, coupled with the remark that this was a fine opportunity to return the civilities of the neighbourhood, he felt that a strong effort at escape was the only thing left. Accordingly, having, seemingly without listening, heard the day fixed, and seen, as they thought, without observing, the chintz chairs in the best drawing-room uncovered, (my dear mother was the tidiest woman in the world,) my father suddenly discovered that there was to be a great book sale, twenty miles off, which would last four days, and attend it he must. My mother sighed; but she never contradicted my father, even when he was wrong, as he certainly was in this case. She only dropped a timid intimation that she feared “It would look odd, and the world might misconstrue my father’s absence—had not she better put off the christening?”
“My dear,” answered my father, “it will be my duty, by-and-by, to christen the boy—a duty not done in a day. At present, I have no doubt that the bishop will do very well without me. Let the day stand, or, if you put it off, upon my word and honour I believe that the wicked auctioneer will put off the book sale also. Of one thing I am quite sure, that the sale and the christening will take place at the same time.”
There was no getting over this; but I am certain my dear mother had much less heart than before in uncovering the chintz chairs, in the best drawing-room. Five years later this would not have happened. My mother would have kissed my father and said “Stay,” and he would have staid. But she was then very young and timid; and he, wild man, not of the woods but the cloisters, nor yet civilised into the tractabilities of home. In short, the post-chaise was ordered and the carpet-bag packed.
“My love,” said my mother, the night before this Hegira, looking up from her work—“my love, there is one thing you have quite forgot to settle—I beg pardon for disturbing you, but it is important!— baby’s name; shan’t we call him Augustine?”
“Augustine,” said my father, dreamily; “why, that name’s mine.”
“And you would like your boy’s to be the same?”
“No,” said my father, rousing himself. “Nobody would know which was which. I should catch myself learning the Latin accidence or playing at marbles. I should never know my own identity, and Mrs Primmins would be giving me pap.”
My mother smiled; and, putting her hand, which was a very pretty one, on my father’s shoulder, and looking at him tenderly, she said, “There’s no fear of mistaking you for any other, even your son, dearest. Still, if you prefer another name, what shall it be?”
“Samuel,” said my father. “Dr Parr’s name is Samuel.”
“La, my love! Samuel is the ugliest name—”
My father did not hear the exclamation, he was again deep in his books; presently he started up:—“Barnes says Homer is Solomon. Read Omeros backwards, in the Hebrew manner—”
“Yes, my love,” interrupted my mother. “But baby’s christian name?”
“Omeros—Soremo—Solemo—Solomo!”
“Solomo! shocking,” said my mother.
“Shocking, indeed,” echoed my father; “an outrage to common sense.” Then, after glancing again over his books, he broke out musingly—“But, after all, it is nonsense to suppose that Homer was not settled till his time.”
“Whose?” asked my mother, mechanically.
My father lifted up his finger.
My mother continued, after a short pause, “Arthur is a pretty name. Then there’s William—Henry—Charles—Robert. What shall it be, love?”
“Pisistratus?” said my father, (who had hung fire till then,) in a tone of contempt—“Pisistratus indeed!”
“Pisistratus! a very fine name,” said my mother joyfully —“Pisistratus Caxton. Thank you, my love: Pisistratus it shall be.”
“Do you contradict me? Do you side with Wolf and Heyne, and that pragmatical fellow Vico? Do you mean to say that the Rhapsodists?”—
“No, indeed,” interrupted my mother. “My dear, you frighten me.”
My father sighed, and threw himself back in his chair. My mother took courage and resumed.
“Pisistratus is a long name too! Still, one could call him Sisty.”
“Siste, Viator,” muttered my father; “that’s trite!”
“No, Sisty by itself—short. Thank you, my dear.”
Four days afterwards, on his return from the book sale, to my father’s inexpressible bewilderment, he was informed that “Pisistratus was growing quite the image of him.”
When at length the good man was made thoroughly aware of the fact, that his son and heir boasted a name so memorable in history as that borne by the enslaver of Athens, and the disputed arranger of Homer—and it was insisted that it was a name he himself had suggested—he was as angry as so mild a man could be. “But it is infamous!” he exclaimed. “Pisistratus christened! Pisistratus! who lived six hundred years before Christ was born. Good heavens, madam! You have made me the father of an anachronism.”
My mother burst into tears. But the evil was irremediable. An anachronism I was, and an anachronism I must continue to the end of the chapter.
CHAPTER IV.
“Of course, sir, you will begin soon to educate your son yourself?” said Mr Squills.
“Of course, sir,” said my father, “you have read Martinus Scriblerus?”
“I don’t understand you, Mr Caxton.”
“Then you have not read Martinus Scriblerus, Mr Squills!”
“Consider that I have read it, and what then?”
“Why then, Squills,” said my father familiarly, “you would know, that though a scholar is often a fool, he is never a fool so supreme, so superlative, as when he is defacing the first unsullied page of the human history, by entering into it the commonplaces of his own pedantry. A scholar, sir, at least one like me, is of all persons the most unfit to teach young children. A mother, sir, a simple, natural, loving mother, is the infant’s true guide to knowledge.”
“Egad, Mr Caxton, in spite of Helvetius, whom you quoted the night the boy was born—egad, I believe you are right!”
“I am sure of it,” said my father; “at least as sure as a poor mortal can be of any thing. I agree with Helvetius, the child should be educated from its birth; but how?—there is the rub: send him to school forthwith! Certainly he is at school already with the two great principles, Nature and Love. Observe, that childhood and genius have the same master organ in common—inquisitiveness. Let childhood have its way, and as it began where genius begins, it may find what genius finds. A certain Greek writer tells us of some man, who, in order to save his bees a troublesome flight to Hymettus, cut their wings, and placed before them the finest flowers he could select. The poor bees made no honey. Now, sir, if I were to teach my boy, I should be cutting his wings and giving him the flowers he should find himself. Let us leave Nature alone for the present, and Nature’s living proxy, the watchful mother.”
Therewith my father pointed to his heir sprawling on the grass and plucking daisies on the lawn; while the young mother’s voice rose
merrily, laughing at the child’s glee.
“I shall make but a poor bill out of your nursery, I see,” said Mr Squills.
Agreeably to these doctrines, strange in so learned a father, I thrived and flourished, and learned to spell, and make pothooks, under the joint care of my mother and Dame Primmins. This last was one of an old race fast dying away—the race of old faithful servants— the race of old tale-telling nurses. She had reared my mother before me; but her affection put out new flowers for the new generation. She was a Devonshire woman—and Devonshire women, especially those who have passed their youth near the sea-coast, are generally superstitious. She had a wonderful budget of fables. Before I was six years old, I was erudite in that primitive literature, in which the legends of all nations are traced to a common fountain—Puss in Boots, Tom Thumb, Fortunio, Fortunatus, Jack the Giant-killer tales like proverbs, equally familiar, under different versions, to the infant worshipper of Budh and the hardier children of Thor. I may say, without vanity, that in an examination in such works of imagination, I could have taken honours!
My dear mother had some little misgivings as to the solid benefit to be derived from such fantastic erudition, and timidly consulted my father therein.
“My love,” answered my father, in that tone of voice which always puzzled even my mother, to be sure whether he was in jest or earnest —“in all these fables, certain philosophers could easily discover symbolical significations of the highest morality. I have myself written a treatise to prove that Puss in Boots is an allegory upon the progress of the human understanding, having its origin in the mystical schools of the Egyptian priests, and evidently an illustration of the worship rendered at Thebes and Memphis to those feline quadrupeds, of which they made both religious symbols and elaborate mummies.”
“My dear Austin,” said my mother opening her blue eyes, “you don’t think that Sisty will discover all those fine things in Puss in Boots!”
“My dear Kitty,” answered my father, “you don’t think, when you were good enough to take up with me, that you found in me all the
fine things I have learned from books. You knew me only as a harmless creature, who was happy enough to please your fancy. Byand-by you discovered that I was no worse for all the quartos that have transmigrated into ideas within me—ideas that are mysteries even to myself. If Sisty, as you call the child, (plague on that unlucky anachronism! which you do well to abbreviate into a dissyllable,) if Sisty can’t discover all the wisdom of Egypt in Puss in Boots, what then? Puss in Boots is harmless, and it pleases his fancy. All that wakes curiosity is wisdom, if innocent—all that pleases the fancy now, turns hereafter to love or to knowledge. And so, my dear, go back to the nursery.”
But I should wrong thee, O best of fathers, if I suffered the reader to suppose, that because thou didst seem so indifferent to my birth, and so careless as to my early teaching, therefore thou wert, at heart, indifferent to thy troublesome Neogilos. As I grew older, I became more sensibly aware that a father’s eye was upon me. I distinctly remember one incident, that seems to me, in looking back, a crisis in my infant life, as the first tangible link between my own heart and that calm great soul.
My father was seated on the lawn before the house, his straw hat over his eyes (it was summer) and his book on his lap. Suddenly a beautiful delf blue-and-white flower-pot, which had been set on the window-sill of an upper storey, fell to the ground with a crash, and the fragments spluttered up round my father’s legs. Sublime in his studies as Archimedes in the siege, he continued to read “Impavidum feriunt ruinæ!”
“Dear, dear!” cried my mother, who was at work in the porch, “my poor flower-pot that I prized so much! Who could have done this? Primmins, Primmins!”
Mrs Primmins popped her head out of the fatal window, nodded to the summons, and came down in a trice, pale and breathless.
“Oh!” said my mother, mournfully, “I would rather have lost all the plants in the greenhouse in the great blight last May,—I would rather the best tea-set were broken! The poor geranium I reared myself, and the dear, dear flower-pot which Mr Caxton bought for me my last birth-day! That naughty child must have done this!”
Mrs Primmins was dreadfully afraid of my father—why, I know not, except that very talkative social persons are usually afraid of very silent shy ones. She cast a hasty glance at her master, who was beginning to evince signs of attention, and cried promptly, “No, ma’am, it was not the dear boy, bless his flesh, it was I!”
“You! how could you be so careless? and you knew how I prized them both. Oh, Primmins!”
Primmins began to sob.
“Don’t tell fibs, nursey,” said a small shrill voice; and Master Sisty (coming out of the house as bold as brass) continued rapidly—“don’t scold Primmins, mamma: it was I who pushed out the flower-pot.”
“Hush!” said nurse, more frightened than ever, and looking aghast towards my father, who had very deliberately taken off his hat, and was regarding the scene with serious eyes wide awake.
“Hush! And if he did break it, ma’am, it was quite an accident; he was standing so, and he never meant it. Did you, Master Sisty? Speak! (this in a whisper) or Pa will be so angry.”
“Well,” said my mother, “I suppose it was an accident; take care in future, my child. You are sorry, I see, to have grieved me. There’s a kiss, don’t fret.”
“No, mamma, you must not kiss me, I don’t deserve it. I pushed out the flower-pot on purpose.”
“Ha! and why?” said my father, walking up.
Mrs Primmins trembled like a leaf.
“For fun!” said I, hanging my head—“just to see how you’d look, papa; and that’s the truth of it. Now beat me, do beat me!”
My father threw his book fifty yards off, stooped down, and caught me to his breast. “Boy,” he said, “you have done wrong: you shall repair it by remembering all your life that your father blessed God for giving him a son who spoke truth in spite of fear! Oh! Mrs Primmins, the next fable of this kind you try to teach him, and we part for ever!”
From that time I first date the hour when I felt that I loved my father, and knew that he loved me; from that time too, he began to converse with me. He would no longer, if he met me in the garden, pass by with a smile and nod; he would stop, put his book in his pocket, and though his talk was often above my comprehension, still
somehow I felt happier and better, and less of an infant, when I thought over it, and tried to puzzle out the meaning; for he had a way of suggesting, not teaching, putting things into my head, and then leaving them to work out their own problems. I remember a special instance with respect to that same flower-pot and geranium. Mr Squills, who was a bachelor, and well to do in the world, often made me little presents. Not long after the event I have narrated, he gave me one far exceeding in value those usually bestowed on children,—it was a beautiful large domino-box in cut ivory, painted and gilt. This domino-box was my delight. I was never weary of playing at dominoes with Mrs Primmins, and I slept with the box under my pillow.
“Ah!” said my father one day when he found me ranging the ivory squares in the parlour, “ah! you like that better than all your playthings, eh?”
“Oh yes, papa.”
“You would be very sorry if your mamma was to throw that box out of the window, and break it for fun.” I looked beseechingly at my father, and made no answer.
“But perhaps you would be very glad,” he resumed, “if suddenly one of these good fairies you read of could change the domino-box into a beautiful geranium in a beautiful blue-and-white flower-pot, and that you could have the pleasure of putting it on your mamma’s window-sill.”
“Indeed I would!” said I, half crying.
“My dear boy, I believe you; but good wishes don’t mend bad actions,—good actions mend bad actions.”
So saying, he shut the door and went out. I cannot tell you how puzzled I was to make out what my father meant by his aphorism. But I know that I played at dominoes no more that day. The next morning my father found me seated by myself under a tree in the garden; he paused and looked at me with his grave bright eyes very steadily.
“My boy,” said he, “I am going to walk to —— (a town about two miles off,) will you come? and, by the bye, fetch your domino-box: I should like to show it to a person there.” I ran in for the box, and, not
a little proud of walking with my father upon the high-road, we set out.
“Papa,” said I by the way, “there are no fairies now.”
“What then, my child?”
“Why—how then can my domino-box be changed into a geranium and a blue-and-white flower-pot?”
“My dear,” said my father, leaning his hand on my shoulder, “every body who is in earnest to be good, carries two fairies about with him —one here,” and he touched my heart; “and one here,” and he touched my forehead.
“I don’t understand, papa.”
“I can wait till you do, Pisistratus! What a name!”
My father stopped at a nursery gardener’s, and, after looking over the flowers, paused before a large double geranium. “Ah, this is finer than that which your mamma was so fond of. What is the cost, sir?”
“Only 7s. 6d.,” said the gardener.
My father buttoned up his pocket.
“I can’t afford it to-day,” said he gently, and we walked out.
On entering the town, we stopped again at a china-warehouse. “Have you a flower-pot like that I bought some months ago? Ah, here is one, marked 3s. 6d. Yes, that is the price. Well, when your mamma’s birth-day comes again, we must buy her another. That is some months to wait. And we can wait, Master Sisty. For truth, that blooms all the year round, is better than a poor geranium; and a word that is never broken, is better than a piece of delf.”
My head, which had drooped before, rose again; but the rush of joy at my heart almost stifled me.
“I have called to pay your little bill,” said my father, entering the shop of one of those fancy stationers common in country towns, and who sell all kinds of pretty toys and nicknacks. “And by the way,” he added, as the smiling shopman looked over his books for the entry, “I think my little boy here can show you a much handsomer specimen of French workmanship than that work-box which you enticed Mrs Caxton into raffling for, last winter. Show your domino-box, my dear.”
I produced my treasure, and the shopman was liberal in his commendations. “It is always well, my boy, to know what a thing is worth, in case one wishes to part with it. If my young gentleman gets tired of his plaything, what will you give him for it?”
“Why, sir,” said the shopman, “I fear we could not afford to give more than eighteen shillings for it, unless the young gentleman took some of these pretty things in exchange.”
“Eighteen shillings!” said my father; “you would give that. Well, my boy, whenever you do grow tired of your box, you have my leave to sell it.”
My father paid his bill, and went out. I lingered behind a few moments, and joined him at the end of the street.
“Papa, papa!” I cried, clapping my hands, “we can buy the geranium—we can buy the flower-pot.” And I pulled a handful of silver from my pockets.
“Did I not say right?” said my father, passing his handkerchief over his eyes—“You have found the two fairies!”
Oh! how proud, how overjoyed I was, when, after placing vase and flower on the window-sill, I plucked my mother by the gown, and made her follow me to the spot.
“It is his doing, and his money!” said my father; “good actions have mended the bad.”
“What!” cried my mother, when she had learned all; “and your poor domino-box that you were so fond of! We will go back tomorrow, and buy it back, if it costs us double.”
“Shall we buy it back, Pisistratus?” asked my father.
“Oh no—no—no! It would spoil all,” I cried, burying my face on my father’s breast.
“My wife,” said my father solemnly, “this is my first lesson to our child—the sanctity and the happiness of self-sacrifice—undo not what it should teach to his dying day!”
And that is the history of the broken flower-pot.
CHAPTER V.
When I was between my seventh and my eighth year, a change came over me, which may perhaps be familiar to the notice of those parents who boast the anxious blessing of an only child. The ordinary vivacity of childhood forsook me; I became quiet, sedate, and thoughtful. The absence of playfellows of my own age, the companionship of mature minds alternated only by complete solitude, gave something precocious, whether to my imagination or my reason. The wild fables muttered to me by the old nurse in the summer twilight, or over the winter’s hearth—the effort made by my struggling intellect to comprehend the grave, sweet wisdom of my father’s suggested lessons—tended to feed a passion for reverie, in which all my faculties strained and struggled, as in the dreams that come when sleep is nearest waking. I had learned to read with ease, and to write with some fluency, and I already began to imitate, to reproduce. Strange tales, akin to those I had gleaned from fairyland —rude songs, modelled from such verse-books as fell into my hands, began to mar the contents of marble-covered pages, designed for the less ambitious purposes of round text and multiplication. My mind was yet more disturbed by the intensity of my home affections. My love for both my parents had in it something morbid and painful. I often wept to think how little I could do for those I loved so well. My fondest fancies built up imaginary difficulties for them, which my arm was to smoothe. These feelings, thus cherished, made my nerves over-susceptible and acute. Nature began to affect me powerfully; and from that affection rose a restless curiosity to analyse the charms that so mysteriously moved me to joy or awe, to smiles or tears. I got my father to explain to me the elements of astronomy; I extracted from Squills, who was an ardent botanist, some of the mysteries in the life of flowers. But music became my darling passion. My mother (though the daughter of a great scholar—a scholar at whose name my father raised his hat, if it happened to be on his head) possessed, I must own it fairly, less book-learning than many a humble tradesman’s daughter can boast in this more enlightened generation; but she had some natural gifts which had ripened, Heaven knows