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

Download Full Component Oriented Development and Assembly Paradigm Principles and Practice using Java 1st Edition Piram Manickam PDF All Chapters

The document promotes the book 'Component Oriented Development and Assembly Paradigm Principles and Practice using Java' by Piram Manickam and others, available for download at ebookultra.com. It highlights the collaboration between Infosys Press and CRC Press to publish titles on software engineering and information technologies. Additionally, it lists other related ebooks available for download.

Uploaded by

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

Download Full Component Oriented Development and Assembly Paradigm Principles and Practice using Java 1st Edition Piram Manickam PDF All Chapters

The document promotes the book 'Component Oriented Development and Assembly Paradigm Principles and Practice using Java' by Piram Manickam and others, available for download at ebookultra.com. It highlights the collaboration between Infosys Press and CRC Press to publish titles on software engineering and information technologies. Additionally, it lists other related ebooks available for download.

Uploaded by

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

Visit https://ebookultra.

com to download the full version and


explore more ebooks

Component Oriented Development and Assembly


Paradigm Principles and Practice using Java 1st
Edition Piram Manickam

_____ Click the link below to download _____


https://ebookultra.com/download/component-oriented-
development-and-assembly-paradigm-principles-and-
practice-using-java-1st-edition-piram-manickam/

Explore and download more ebooks at ebookultra.com


Here are some suggested products you might be interested in.
Click the link to download

Object oriented software development using Java principles


patterns and frameworks 2nd Edition Xiaoping Jia.

https://ebookultra.com/download/object-oriented-software-development-
using-java-principles-patterns-and-frameworks-2nd-edition-xiaoping-
jia/

Object Oriented Software Engineering Using UML Patterns


and Java 2nd Edition Bernd Bruegge

https://ebookultra.com/download/object-oriented-software-engineering-
using-uml-patterns-and-java-2nd-edition-bernd-bruegge/

Rural Development Principles and Practice 1st Edition


Malcolm J. Moseley

https://ebookultra.com/download/rural-development-principles-and-
practice-1st-edition-malcolm-j-moseley/

Object Oriented Design with UML and Java 1st Edition


Kenneth Barclay

https://ebookultra.com/download/object-oriented-design-with-uml-and-
java-1st-edition-kenneth-barclay/
Java EE 5 Development using GlassFish Application Server
1st Ed. Edition David Heffelfinger

https://ebookultra.com/download/java-ee-5-development-using-glassfish-
application-server-1st-ed-edition-david-heffelfinger/

Automatic ECG Analysis Using Principal Component Analysis


and Wavelet Transformation Antoun Khawaja

https://ebookultra.com/download/automatic-ecg-analysis-using-
principal-component-analysis-and-wavelet-transformation-antoun-
khawaja/

Evaluating the Effectiveness of Academic Development


Principles and Practice 1st Edition Lorraine Stefani

https://ebookultra.com/download/evaluating-the-effectiveness-of-
academic-development-principles-and-practice-1st-edition-lorraine-
stefani/

China s Rise Development Oriented Finance and Sustainable


Development 1st Edition Lixing Zou

https://ebookultra.com/download/china-s-rise-development-oriented-
finance-and-sustainable-development-1st-edition-lixing-zou/

Java the UML way integrating object oriented design and


programming Else Lervik

https://ebookultra.com/download/java-the-uml-way-integrating-object-
oriented-design-and-programming-else-lervik/
Component Oriented Development and Assembly
Paradigm Principles and Practice using Java 1st Edition
Piram Manickam Digital Instant Download
Author(s): Piram Manickam, S. Sangeetha, S. V. Subrahmanya
ISBN(s): 9781466581005, 146658100X
Edition: 1
File Details: PDF, 15.41 MB
Year: 2013
Language: english
Component-
Oriented
Development
and Assembly
Paradigm, Principles, and
Practice Using Java

Piram Manickam
S. Sangeetha
S. V. Subrahmanya
Component-
Oriented
Development
and Assembly
Paradigm, Principles, and
Practice Using Java
In an initiative to promote authorship across the globe, Infosys Press and CRC Press have
entered into a collaboration to develop titles on leading edge topics in IT.

Infosys Press seeks to develop and publish a series of pragmatic books on software
engineering and information technologies, both current and emerging. Leveraging Infosys’
extensive global experience helping clients to implement those technologies successfully,
each book contains critical lessons learned and shows how to apply them in a real-world,
enterprise setting. This open-ended and broad-ranging series aims to brings readers practical
insight, specific guidance, and unique, informative examples not readily available elsewhere.

PUBLISHED IN THE SERIES

The Complete Book of Data Anonymization: From Planning to Implementation


Balaji Raghunathan

Component-Oriented Development and Assembly: Paradigm, Principles,


and Practice using Java
Piram Manickam; S. Sangeetha, and S. V. Subrahmanya

.NET 4 for Enterprise Architects and Developers


Sudhanshu Hate and Suchi Paharia

Process-Centric Architecture for Enterprise Software Systems


Parameswaran Seshan

Process-Driven SOA: Patterns for Aligning Business and IT


Carsten Hentrich and Uwe Zdun

Web-Based and Traditional Outsourcing


Vivek Sharma and Varun Sharma

IN PREPARATION FOR THE SERIES

Applying Resource Oriented Architecture: Using ROA to Build RESTful Web Services
G. Lakshmanan, S. V. Subrahmanya, S. Sangeetha, and Kumar M. Pradeep

Scrum Software Development


Jagdish Bhandarkar and J. Srinivas

Software Vulnerabilities Exposed


Sanjay Rawat, Ashutosh Saxena, and Ponnapalli K. B. Hari Gopal
Component-
Oriented
Development
and Assembly
Paradigm, Principles, and
Practice Using Java

Piram Manickam
S. Sangeetha
S. V. Subrahmanya
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2014 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works


Version Date: 20130925

International Standard Book Number-13: 978-1-4665-8100-5 (eBook - PDF)

This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
made to publish reliable data and information, but the author and publisher cannot assume responsibility for the valid-
ity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this
form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may
rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or uti-
lized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopy-
ing, microfilming, and recording, or in any information storage or retrieval system, without written permission from the
publishers.

For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://
www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For
organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
This book is dedicated to our mentor Mr. Kris S. Gopalakrishnan,
Vice Chairman of Infosys Limited

© 2010 Taylor & Francis Group, LLC


Contents

Fo re wo rd xiii
P r e fa c e xv
Acknowledgments xvii
Th e A u t h o r s xix

Pa r t I P r i n c ip l e s : C o n c e p t s in CODA
Chapter 1 I n t r o d u c t i o n t o C o m p o n e n t- O r i e n t e d D e v e l o p m e n t
a n d A s s e m b ly (CODA ) 3
1.1 Introduction 3
1.2 Motivation for Software Components 3
1.3 Components—An Ice Breaker 4
1.4 Component Characteristics 5
1.4.1 Part of a Whole 5
1.4.2 Component Ecosystem 5
1.4.3 Component Framework 5
1.4.4 Component Model 6
1.4.5 Component Interfaces 6
1.4.6 Provided and Required Interfaces 6
1.4.7 Component Compatibility 6
1.4.8 Implementation Independence 7
1.4.9 Producer-Consumer Independence 7
1.4.10 Active and Passive Component 7
1.5 Historical Perspective of Software Components 7
1.6 Defining Software Components 8
1.6.1 Function Libraries as Software Components 10
1.6.2 Object Libraries as Software Components 10
1.7 Elements of a Software Component 11
1.7.1 Component Specification 12
1.7.2 Component Interfaces 12

© 2010 Taylor & Francis Group, LLC vii


viii C o n t en t s

1.7.3 Component Implementation 13


1.7.4 Component Model 13
1.8 Component-Based Software Engineering 14
1.8.1 Requirements 14
1.8.2 Component Specifications 15
1.8.3 Component Provisioning 15
1.8.4 Component Assembly 15
1.8.5 Testing 15
1.8.6 Deployment 15
1.8.7 Component-Based Life Cycle Artifacts 15
1.9 Advantages of Component-Based Software Engineering 16
1.9.1 Reusability 17
1.9.2 Parallel Development 17
1.9.3 Easy Maintainability 17
1.9.4 System Evolution 18
1.9.5 Single Point of Maintenance 18
1.9.6 Increased Quality 18
1.9.7 Rapid Prototyping Support 18
1.10 Summary 19
Review Questions 19

C h a p t e r 2 C o m p o n e n t Th i n k i n g in J ava 21
2.1 Introduction 21
2.2 Component Constructs in Java SE 21
2.3 Java Software Components Using JAR and Package 23
2.4 Java Interfaces to the Rescue of Build Time Tight Coupling 25
2.5 Runtime Dependencies While Using Interfaces 27
2.6 Manual Component Assembly Using Glue Code 28
2.7 Automated Component Assembly Using Component Framework 29
2.8 Example Component Model 29
2.9 Summary 33
Review Questions 34

C h a p t e r 3 C o m p o n e n t M o d e l s in J ava 35
3.1 Introduction 35
3.2 Understanding Components 35
3.3 Enterprise JavaBeans Component Model 36
3.3.1 Business Interface 37
3.3.2 EJB Component 37
3.3.3 EJB Container 38
3.3.4 Component Reference 38
3.3.5 An Example to Understand the EJB Component Model 39
3.4 Spring Component Model 42
3.4.1 Spring Container 42
3.4.2 Spring Beans 43
3.4.3 Spring Configuration 43
3.4.4 An Example to Understand the Spring Component Model 44
3.5 OSGi Component Model 46
3.5.1 OSGi Bundle 47
3.5.2 OSGi Service Registry 48
3.5.3 OSGi Component 48
3.5.4 An Example to Understand the OSGi Component Model 49
3.5.4.1 Interface Bundle 50

© 2010 Taylor & Francis Group, LLC


C o n t en t s ix

3.5.4.2 Implementation Bundle 50


3.5.4.3 Client Bundle 52
3.6 Service Component Architecture Model 56
3.6.1 Services 57
3.6.2 Component 57
3.6.3 Composite 57
3.6.4 Domain 58
3.6.5 An Example to Understand the SCA Component Model 59
3.7 Snapshot of Features of the Component Models—EJB, Spring, OSGi,
and SCA 62
3.8 Summary 62
Review Questions 63

Pa r t II P r ac t i c e : H a n d s - O n CODA U s i n g J ava


Component Models
C h a p t e r 4 C o m p o n e n t- O r i e n t e d A pp l i c at i o n D e s i g n and

Architecture 67
4.1 Introduction 67
4.2 Componentizing a Monolithic Application 67
4.2.1 Analysis of the Monolithic Implementation of the Virtual Store 67
4.2.2 Componentizing the Virtual Store 69
4.2.3 Analysis of the Componentized Implementation of the Virtual Store 70
4.2.4 Accommodating Changes to the Virtual Store 73
4.3 Componentizing Applications with Multiple Layer Architecture 75
4.3.1 Existing Design of the POS Layered Application 76
4.3.1.1 Objects in the Model 76
4.3.1.2 Design of the Presentation Layer 77
4.3.1.3 Design of the Business Layer 77
4.3.1.4 Design of the Persistence Layer 78
4.3.2 Analysis of the Existing Design of the POS Application 79
4.3.3 Componentizing the POS Application 80
4.3.4 Component Replacement in the POS Application 81
4.4 Summary 86
Review Questions 86
Chapter 5 P r a c t i c i n g CODA with OSG i 87
5.1 Introduction 87
5.2 What Is OSGi? 87
5.3 Necessity of OSGi 88
5.4 The OSGi Module Layer 91
5.4.1 Internal Bundle Class Path 92
5.4.2 Exported Internal Code 93
5.4.3 Imported External Code 93
5.5 OSGi Runtime Framework 96
5.6 OSGi Life Cycle Layer 97
5.7 OSGi Service Layer 100
5.8 OSGi Declarative Services Specification 102
5.9 Summary 106
Review Questions 106
Chapter 6 P r a c t i c i n g CODA with SCA 109
6.1 Introduction 109
6.2 What Is Service Component Architecture? 109

© 2010 Taylor & Francis Group, LLC


x C o n t en t s

6.3 SCA Concepts 109


6.3.1 Component 109
6.3.2 Composite 111
6.3.3 Wiring 112
6.3.4 SCA Runtime and Domain 112
6.4 Creating an SCA Component from Java Implementation 112
6.5 Creating SCA Components and Composites 116
6.5.1 Component Element of a Composite 118
6.5.2 Service Element of a Composite 120
6.5.3 Reference Element of a Composite 121
6.5.4 Property Element of a Composite 121
6.6 PosGuest Composite 121
6.7 Deploying and Consuming SCA Composites 122
6.8 Summary 123
Review Questions 124

C h a p t e r 7 E n t e r p r i s e C o m p o n e n t- O r i e n t e d D e v e l o p m e n t a n d
A s s e m b ly U s i n g J ava P l at f o r m , E n t e r p r i s e E d i t i o n 125
7.1 Introduction 125
7.2 Presentation Tier Components 125
7.2.1 Web Component Model—Java Servlet 126
7.2.2 Web Component Model—Java Server Pages 128
7.2.3 Web Component Model—Java Server Faces 129
7.2.4 Web Container 132
7.2.5 Packaging Web Components 132
7.3 Business Tier Components 134
7.3.1 Business Interface 134
7.3.2 EJB Container 135
7.3.3 Enterprise JavaBean Component Types 135
7.3.3.1 Stateless Session Beans 135
7.3.3.2 Stateful Session Beans 137
7.3.3.3 Singleton Session Beans 138
7.3.3.4 Message-Driven Beans 138
7.3.4 Packaging Enterprise JavaBean Components 140
7.3.5 Accessing Enterprise JavaBean Components 140
7.4 Persistence Tier Components 143
7.4.1 Entity 144
7.4.2 Entity Manager 146
7.4.3 Persistence Provider 147
7.4.4 Packaging Entities 147
7.4.5 Accessing Entities 148
7.5 Enterprise CODA Using Java EE—An Example 150
7.6 Summary 154
Review Questions 154

C h a p t e r 8 E n t e r p r i s e C o m p o n e n t- O r i e n t e d D e v e l o p m e n t and

A s s e m b ly U s i n g t h e S p r i n g C o m p o n e n t M o d e l 157
8.1 Introduction 157
8.2 Spring Component Model 157
8.3 Spring Container 159
8.4 Spring Beans 160
8.5 Spring Configuration 160
8.6 Spring MVC Model 161

© 2010 Taylor & Francis Group, LLC


C o n t en t s xi

8.6.1 DispatcherServlet 161


8.6.2 Web Configuration File 162
8.6.3 Controller 163
8.6.4 Views 165
8.7 Enterprise CODA Using the Spring MVC Model—An Example 166
8.7.1 View Components 168
8.7.2 Business Components 171
8.7.3 Persistence Components 173
8.8 Summary 178
Review Questions 179
C h a p t e r 9 E n t e r p r i s e C o m p o n e n t- O r i e n t e d D e v e l o p m e n t and

A s s e m b ly U s i n g E n t e r p r i s e OSG i 181
9.1 Introduction 181
9.2 Enterprise OSGi—An Introduction 181
9.3 Enterprise OSGi—Application Structure 182
9.4 Web Application Service 183
9.5 Blueprint Container Specification 184
9.6 JPA Service 188
9.7 Enterprise CODA Using Enterprise OSGi—An Example 189
9.7.1 Persistence Bundle 190
9.7.2 Blueprint Bundle 194
9.7.3 Web Application Bundle 196
9.8 Summary 198
Review Questions 199

Pa r t III Pa r a d i g m : C o m p o n e n t Te s t i n g , B u s i n e s s
A pp l i c at i o n C a s e S t u dy, a n d To o l s
C h a p t e r 10 Te s t i n g C o m p o n e n t- O r i e n t e d S o f t wa r e 203
10.1 Introduction 203
10.2 Concepts in Software Testing 203
10.3 Concepts in Component-Oriented Software Testing 204
10.4 Validation of Component Interfaces 205
10.4.1 Example of White-Box Validation 205
10.4.2 Example of Black-Box Validation 206
10.5 Verification of Component Implementation—White-Box Testing 207
10.6 Verification of Component Functionality—Black-Box Testing 211
10.6.1 Test Case for the Number of Tables 212
10.6.2 Test Case for the Occupy Table Functionality 213
10.6.3 Test Case for the Empty Table Functionality 214
10.7 Summary 216
Review Questions 216

C h a p t e r 11 I m p l e m e n t i n g a B u s i n e s s A pp l i c at i o n U s i n g
CODA — A C a s e S t u dy 217
11.1 Introduction 217
11.2 Case Study Problem—Point-of-Sale Application for Restaurants 217
11.2.1 Use Case 1—Configure Dining Tables 218
11.2.2 Use Case 2—Create New Menu Item 218
11.2.3 Use Case 3—Modify/Remove Existing Menu Item 218
11.2.4 Use Case 4—Check-In Guests 218
11.2.5 Use Case 5—Place Order 220
11.2.6 Use Case 6—Modify/Cancel Order 220

© 2010 Taylor & Francis Group, LLC


x ii C o n t en t s

11.2.7 Use Case 7—Print Receipt 220


11.2.8 Use Case 8—Guests Checkout 220
11.3 Component-Oriented Design of POS 221
11.3.1 POS Architecture 221
11.3.2 Domain Model Design 222
11.3.3 Presentation Tier Design 223
11.3.3.1 Realization of UC1—Configure Dining Tables 224
11.3.3.2 Realization of UC2—Create Menu Item and
UC3—Modify/Remove Menu Item 224
11.3.3.3 Realization of UC4—Check-In Guests 225
11.3.3.4 Realization of UC5—Place Order 226
11.3.3.5 Realization of UC6—Modify/Cancel Order 226
11.3.3.6 Realization of UC7—Print Receipt 227
11.3.3.7 Realization of UC8—Guest Check-Out 228
11.3.4 Business Tier Design 229
11.3.4.1 Design of the TableBiz Component 230
11.3.4.2 Design of the FoodBiz Component 231
11.3.4.3 Design of the OrderBiz Component 232
11.3.4.4 Design of the BillBiz Component 233
11.3.4.5 Consolidated Design 233
11.3.5 Persistence Tier Design 234
11.4 Implementation of the POS Application Using the OSGi Component
Framework 235
11.5 Implementation of the POS Application—Using Service Component
Architecture 240
11.6 Implementation of the POS Application—Using the Enterprise
OSGi Component Framework 242
11.7 Implementation of the POS Application—Using the Spring
Component Framework 244
11.8 Implementation of the POS Application—Using the Java EE Framework 246
11.9 Summary 249

C h a p t e r 12 CODA To o l s — A F i c t i t i o u s CODA W o r k b e n c h 251


12.1 Introduction 251
12.2 CODA Workbench—The Features 251
12.3 CODA Workbench—User Interface 251
12.4 Viewing Repository—Components Section and Properties Section 252
12.5 Assembling Components into Application—Assembly Area and
Potential Components Sections 254
12.6 Test Execution of Assembled Application—Console Section 256
12.7 Summary 257

© 2010 Taylor & Francis Group, LLC


Foreword

Modern software systems are large, distributed, increasingly decentralized, and


­complex beyond the ability of a single architect, designer, engineer, or project man-
ager to comprehend. Modeling, development, integration, deployment, maintenance,
and the evolution of modern software systems is a problem that, on the one hand, has
been attacked with a multitude of methods, techniques, and tools, but on the other
hand, is still considered “unsolved” and remains compelling to software engineering
researchers and practitioners. The past couple of decades has seen a proliferation of
attempts to conquer this challenge. There are a number of examples, ranging from the
very s­ uccessful and widely used object-oriented development methodology, to much
shorter lived and ultimately less widely used subject-oriented and aspect-oriented
development, to the more recent emergence of service-oriented development.
Each of these attempts has introduced its own set of concepts, constructs, and
­abstractions. However, they all share the goal of breaking up a system into a set of
meaningful constituent components, each of which solves a part of the overall p ­ roblem,
that is reasonably insulated from the remainder of the system, and is ­sufficiently
small enough to be understood, designed, implemented, and maintained by a single
­engineer or a small team of engineers. These components are then composed and
interact to solve the larger problem. This is a very simple but powerful concept that has
worked wonderfully in many other domains, from the playful compositions of Lego®
blocks, to furniture construction, to the construction of buildings, to the engineering
of highly complex automotive and avionics systems, and incredibly complex biological
systems.
This recognition that component-based development is a way to conquer the
­complexity of modern software systems has been followed by the emergence of a
growing ecosystem of component-based models, frameworks, tools, and platforms.
However, without a proper understanding of this landscape, anyone trying to enter it

© 2010 Taylor & Francis Group, LLC x iii


xiv F o re w o rd

will ultimately risk leaving without success and in frustration. It is for this very reason
that Component-Oriented Development and Assembly is a timely collection of ­observations,
insights, and understandings that provides the appropriate structure and sheds the
needed light on this important topic. The authors provide a carefully thought out
treatment of software components and component-oriented development. They do so
in a m
­ anner that is, at the same time, rigorous and accessible to a spectrum of read-
ers: from those who are generally knowledgeable in software engineering but do not
have a ­background in component-oriented development, to those who have significant
prior exposure but are looking to shore up their knowledge and develop expertise in
the state-of-the-art. Simply put, Component-Oriented Development and Assembly will be a
­valuable addition to any software engineer’s bookshelf!
Professor Nenad Medvidović
Professor and Associate Chair for Ph.D. Affairs
Computer Science Department
University of Southern California
Author of the Book— Software Architecture: Foundations, Theory, and Practice

© 2010 Taylor & Francis Group, LLC


Preface

Component-oriented software development inherently supports the reuse of ­artifacts.


Component-based software engineering (CBSE) has been a research field for quite
some time, especially in academic circles, but it has taken a considerable amount of
lead time for it to be adopted by the industry. For some time now, the industry has
been ­leveraging the advancements of component-oriented development and assembly
(CODA) technology. There is no single book that provides a comprehensive overview
of the multiple technologies that support CODA for students and practitioners. This
book is an effort in that direction, while restricting the scope to the Java platform to
illustrate CODA principles.
The book is organized into three parts covering the principles, practice, and
­paradigm of Component-Oriented Development and Assembly:

• Part I—Principles: Concepts in CODA


• Part II—Practice: Hands-On CODA Using Various Java Component Models
• Part III—Paradigm: Component Testing, Business Application Case Study,
and Tools

Part I provides the conceptual foundation for component-oriented software. Concepts


of an interface, the composition of components through provided and required inter-
faces, component models, and component frameworks are introduced. The concepts
are explained with the help of Java as a development platform. Components have to be
stitched together using glue code in the absence of a component model. A ­homegrown
­component model and a supporting component framework are used to explain the
­concepts and to illustrate the core concepts on which most of the ­standard Java
­component frameworks are built. A brief overview of various standard Java c­ omponent
models is presented.

© 2010 Taylor & Francis Group, LLC xv


xvi P refac e

Part II focuses on educating readers with various standard Java component m ­ odels
and describing how to develop a component-oriented system using these c­ omponent
models. The second part opens with a chapter on the design and a­rchitecture of
­component-oriented software. This is followed by chapters that cover various Java
­component models such as OSGi, SCA, Java EE, Spring, and Enterprise OSGi in
depth. Each technology is explained with the help of implementation. All of the
­chapters make use of the same application scenario to elaborate on component-­
oriented solutions. This makes it easy to follow the example implementations in
­different ­chapters as well as helps the reader to compare and contrast the differences
across implementations in different component models. OSGi and SCA are authorita-
tive organizations that define g­ uidelines for the component world. This book adheres
to the guidelines set up by them.
Part III presents various aspects of the component-oriented development para-
digm. The first chapter in this part deals with testing and quality assurance aspects
of component-oriented software. The next chapter provides an end-to-end case study
of a real-life business problem that is solved using the CODA approach. The last
­chapter provides input on how the use of tools can bolster the CODA approach. In
this ­chapter, a fictitious component workbench is presented, and the software compo-
nents from the case study are assembled using this tool.
Overall, the book provides enough information for anyone to start practicing
CODA. We believe this book is appropriate for:
• Practicing software engineers to learn component-oriented technologies and
programming
• Practicing software architects to get a concise view of various component-
oriented technologies available in Java along with hands-on examples
• Academic students studying software development for understanding the
benefits of component-oriented software development and assembly, for
­
learning the concepts, and for gaining hands-on programming knowledge in
various component models in Java
The book has a companion Web site (http://www.codabook.com) on which all the
source code used in the book are hosted. The source code for the CODA i­ mplementation
of the end-to-end case study presented in Chapter 11 using various Java c­ omponent
models are also hosted on the Web site. The Web site will also serve as a technical
forum for further discussions of the topic, and for any updates such as errata.

© 2010 Taylor & Francis Group, LLC


Acknowledgments

We would like to acknowledge and immensely thank Infosys Limited for sup-
porting and encouraging this book project. We would like to especially thank
S. Gopalakrishnan, our mentor, and Vice Chairman, Infosys Limited, for his constant
guidance, support, and encouragement during the execution of the project and for gen-
erating interest on this topic. We would like to thank Professor Nenad Medvidović,
Professor and Associate Chair for Ph.D. Affairs, Computer Science Department,
University of Southern California, for writing the Foreword.
We would like to thank Professor Y. Narahari, Chairman, Department of Computer
Science and Automation, Indian Institute of Science (IISc), Bangalore, for his v­ aluable
­technical review input on the book. We also thank Ravindra Babu Tallamraju,
Principal Researcher, Infosys Limited, for helping with a detailed technical review
of the book. Special thanks are due to Srikantan (Tan) Moorthy, SVP, Group Head
of HR, former Global Head of Education and Research, and Nandita Gurjar, Global
Head of Education and Research, for their constant support and encouragement.
Our sincere thanks to our colleagues Soumya Bardhan, Shikhar Johari, Vishal
Vijay Verma, Rohit Jain, Vaasavi Lakshmi Jammalamadaka, Karthika K. Ravigopal
Nair, Vibhuti Mahendra Pithwa, and Navdeep Kumar, for their help in software
development, documentation, and testing of the companion code and the workbench
tool to demonstrate the concepts and principles. Special thanks are due to Soumya
Bardhan and Shikhar Johari for their contribution of creating all the figures used in
this book.
Special thanks are due to T.S. Mohan for his help. We would like to extend our
special thanks to Deepa Jagdish, John Wyzalek, Jessica Vakili, and Linda Leggio at
Taylor & Francis for their support throughout the project. Last but not the least, the
authors would like to acknowledge and thank their beloved families for their patience
during this project.

© 2010 Taylor & Francis Group, LLC x vii


x viii Ac k n o w l ed g m en t s

Trademark

All the registered trademarks used in this book are the properties of their ­respective
owners/companies. The authors have no rights to these trademarks. Example
­organizations, products, domain names, e-mail addresses, logos, people, places, and
events depicted in this book are fictitious and no association with any real organiza-
tion, product, domain name, e-mail address, logo, person, place, or event is intended
or should be inferred.

Companion Web Site

The book has a companion Web site (http://www.codabook.com) on which all the
source code used in the book are hosted. The Web site will also serve as a technical
forum for further discussions of the topic, and for any updates such as errata.

© 2010 Taylor & Francis Group, LLC


The Authors

Piram Manickam is an ardent technologist. During the past two decades he has
worked with many software development teams and built a number of systems
using various development platforms. He has a special interest in object-oriented
design. He has authored many technical articles. He has been practicing and teach-
ing component-oriented development and assembly (CODA) for the last few years.
He is a technical consultant and architect on many software ­component–based
projects at Infosys. He is a graduate of electronics and communication engineering
from Regional Engineering College (currently NIT) in Tiruchirapalli, India. He
is currently pursuing a master of science in computer engineering from the Illinois
Institute of Technology, Chicago.

S. Sangeetha is a senior technical architect at Infosys. She has been working on


Java, Java EE–related technologies, for more than 14 years. She is involved in the
design and development of prototypes and POCs on several e­ nterprise applica-
tion solutions. She is also involved in grooming architects at Infosys through the
program Connect Architecture. She has been practicing and teaching component-­
oriented development and assembly (CODA) for the last few years. Sangeetha has
authored many t­echnical articles and c­ oauthored a book titled J2EE Architecture
(Tata McGraw-Hill, 2005). She has a bachelor’s degree in engineering (electronics
communication engineering) from Madras University (India).

S. V. Subrahmanya (also known as SVS) has more than 25 years of experience in the
information technology industry and academics. SVS is currently working at Infosys
Limited as vice president and is a research fellow at Infosys. He heads the E-Commerce
Research Labs. He is also responsible for competency development of employees

© 2010 Taylor & Francis Group, LLC xix


xx T he Au t h o rs

across the technical spectrum including new upcoming areas of ­technology at Infosys.
SVS has published many papers in reputed journals and international conferences.
He has coauthored books titled Discrete Structures, Web Services: An Introduction (Tata
McGraw-Hill, 2004), J2EE Architecture (Tata McGraw-Hill, 2005), and Enterprise
IT Architecture (Wiley India, 2006).

© 2010 Taylor & Francis Group, LLC


Part I
P rinciples
Concepts in CODA

© 2010 Taylor & Francis Group, LLC


1
I ntroducti on to C omp onent-
O riented D e v elopment
and A s sembly (CODA)

1.1 Introduction

Component-Oriented Development and Assembly (CODA) has lots of benefits.


Product building in the modern industrial age has revolved around assembling end
products from components rather than building from scratch. Although this is true
for most modern-day products in many disciplines, the majority of software engineers
prefer to build software products from the ground up, save alone the reuse of applica-
tion f­rameworks, design patterns, and coding idioms. The objective of component-
oriented software development and assembly is to reduce the development effort as
much as possible and encourage the reuse of existing components to assemble new
applications. When implemented successfully, this approach can bring down costs,
reduce cycle time, and improve overall product quality. In this chapter, we introduce
the concepts of component-oriented development and assembly.
This chapter introduces readers to the component paradigm. It introduces software
components along with concepts of interfaces, composition, component models, and
component frameworks. At the end of the chapter, readers are expected to have gained
an understanding of the component-oriented paradigm and how this paradigm can be
practiced in software development.

1.2 Motivation for Software Components

When we compare the software industry with other mature industries, it seems to
be in its early stages of evolution. This is because other industries have advanced
to automated mass production capabilities from primeval practices of ­individual
craftsmanship-based production, and the majority of software is hand-built one line
at a time by individual craftsmen (programmers) even now. The component-based
software development paradigm is expected to help evolve the software industry
from micro-level line-by-line building practice to a macro-level mass production
practice.
Software products and services vendors are always under pressure to deliver bet-
ter-quality products at lower cost and shorter time frames. Most of the time the
software engineering team buckles under this pressure. What are the challenges

© 2010 Taylor & Francis Group, LLC 3


4 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

that software engineers face in achieving these goals, and how do they overcome the
challenges?
The biggest challenge is that the requirements for newer systems are getting more
­complex than ever before, and software development techniques have not adapted
­rapidly to the changing demands. Because of this, software developers are perenni-
ally looking f­orward to newer techniques that can bridge the gap between business
demands and state-of-the-art software development methodologies.
Divide and conquer is a time-tested technique to effectively manage a complex
problem. The technique involves breaking the larger problem into smaller, more
­manageable problems. After the smaller solutions are obtained, they can be combined
to get the larger solution. CODA uses the divide and conquer technique to solve the
problem of complexity.

1.3 Components—An Ice Breaker

Component as a concept stems from two root concepts: composition and decomposition.
Composition is the act of assembling a system from individual parts. Decomposition
is the act of dismantling parts from a system. The parts participating in the acts of
composition and decomposition are known as the components of the system. Put
another way, a component is part of a whole (system) which it can be attached with or
detached from.
A common example of a component-based system is Lego®, in which building
blocks are assembled to a toy structure or dismantled. A more sophisticated example
could be an electronic product (e.g., a stereo system), which is assembled from basic
components such as resistors, transistors, and advanced components such as integrated
circuits (ICs).
Any product, be it software or otherwise, can be built in many different ways.
For example, a kitchen cabinet can be completely custom built from raw materials,
or it can be assembled from standard modular kitchen parts available from market,
or it can be built from a mix of modular kitchen parts and custom-made parts.
Similarly, software products can be completely custom built, or they can be built
by i­ntegrating off-the-shelf software products available from market, or they can
be built using a mix of both. The key difference between both of these examples
is that while modular kitchen parts can be assembled to arrive at the final product,
off-the-shelf s­ oftware products need to be integrated to arrive at the final product.
The reason for this d ­ ifference is that the modular kitchen parts were designed
and manufactured to be compatible with one another, while the software products
were not.
Components are parts of a product that are meant to be assembled together. The
basic component principle is to design and build parts that are meant to work together
rather than work in isolation. Parts of a modular kitchen follow this principle, while
disparate software products do not. The result is easy assembly of kitchen c­ omponents
© 2010 Taylor & Francis Group, LLC
In t r o d u c ti o n t o C ODA 5

and tough integration of software products. Some software products that follow the
component design principle do exist. For example, Eclipse IDE is made of compo-
nents, and it is easy to acquire new plugin components for the IDE and literally plug
them to the core of the Eclipse product.

1.4 Component Characteristics

Apart from the basic characteristics of being part of a whole, components exhibit
many other characteristics pertaining to composition and decomposition operations.
We discuss the common characteristics of components in the next few subsections. We
describe these common characteristics of components with examples of ­nonsoftware
­components. We use these characteristics later to extract an ideal candidate from
among a ­variety of common software constructs that could potentially play the role of
a software component.

1.4.1 Part of a Whole

Components can be composed to and decomposed from a system. Composition of an


appropriate set of components should yield a complete functional system; decomposi-
tion of a complete system should yield the set of constituent components. This is a
fundamental characteristic of a component.

1.4.2 Component Ecosystem

By virtue of their basic characteristic of participating in composition and decom-


position, components are designed to be used in a compositional way together with
other components. For example, in mechanical components, a nut does not serve any
­purpose in isolation from a bolt.
In other words, a component is not normally designed in isolation, but as part of
a collection of collaborating components. The collaborating components work in the
context of a component framework governed by a component model. The ­collaborating
components, the component framework, and the component model together form a
component ecosystem.

1.4.3 Component Framework

The component framework provides a common fabric or environment over which the
components may be composed. For example, in electronic components, the printed
circuit board (PCB) serves as the fabric over which the electronic components can be
assembled; in mechanical components, the car skeleton or an equivalent m ­ echanical
core structure serves as the framework over which mechanical components are
assembled.
© 2010 Taylor & Francis Group, LLC
6 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

1.4.4 Component Model

A component model defines what components are, how they can be constructed, how
they can be composed, and how they can be deployed. The component model also
defines the component framework. For example, a component model for electronics
components is defined by the Electronics Industries Alliance (EIA).

1.4.5 Component Interfaces

Each component specifies one or more interfaces through which other components
can be composed with it. The interfaces adhere to the composition standards defined
in the component model. For example, the interface of a nut is a hollow cylinder with
a threaded inner surface and a specified diameter. The interface of a bolt is a solid
cylinder with a threaded outer surface and a specified diameter.

1.4.6 Provided and Required Interfaces

Interfaces specified by a component are of two types. One type of interface is meant
for other components to compose with this component and make use of the function-
ality provided by this component. This type of interface is called a provided interface.
Another type of interface is meant for other components to compose with this compo-
nent and provide some functionality to this component. This type of interface is called
a required interface. A component’s interface specifications include both the provided
and required interfaces.
As an example for provided and required interfaces, consider the case of a nut and
bolt, which are to provide the functionality of fastening two mechanical components
together. The bolt provides a solid cylinder with a threaded outer surface as the interface
for composition. The nut provides a hollow cylinder with a threaded inner surface as the
interface for composition. If the diameters of the nut and bolt match, they can compose
together and fasten other mechanical parts.
Note that the nut’s provided interface (a hollow cylinder with threaded inner sur-
face) is the same as the bolt’s required interface, and the bolt’s provided interface
(a solid cylinder with threaded outer surface) is the same as the nut’s required interface.

1.4.7 Component Compatibility

Two components that coexist in a component ecosystem can be composed together only
if they are compatible with each other. Two components are said to be compatible if they
have complementing interfaces (i.e., the provided interface of one component should be
the same as the required interface of the other). For example, a nut of 2 cm diameter
cannot be fastened over a bolt of 3 cm diameter. Likewise, a nut cannot be fastened over
any nail irrespective of its diameter. If there is a nut and a bolt with an equal diameter
specification, then they have complementing interfaces, which makes them compatible.
© 2010 Taylor & Francis Group, LLC
In t r o d u c ti o n t o C ODA 7

1.4.8 Implementation Independence

Two compatible components (which have complementing interface specifications, by


definition of compatibility) can always be composed, irrespective of the manner in
which their interfaces are implemented. The composition operation concerns only the
interfaces of the components and is immune to varying implementations. For ­example,
a nut made of copper can be fastened together with a bolt made of iron, as long as they
both have compatible diameters. The implementation independency leads to two other
important properties—exchangeability and producer-consumer independence.

1.4.9 Producer-Consumer Independence

A component may be produced and consumed by different commercial entities, as


long as the producer and consumer have a common interface definition for the com-
ponent in context. This property of the component is a derivative of implementation
independence. For example, the nut can be produced by company A, and the bolt can
be produced by company B, and both of them can be consumed by company C as parts
of a composite product. This is possible because all three companies would have fixed
the interface specification (diameter of the nut and bolt) as part of the material supply
contract.

1.4.10 Active and Passive Component

During the composition process that composes components together, some of the
­participating components may be actively performing the composition, whereas the
others may be passively participating in the composition process. For example, when a
gear and a shaft are being fastened by a nut and a bolt, the gear and the shaft are passive
participants of the fastening process, and the nut and the bolt are the active compo-
nents performing the fastening. Note that this notion of active and passive components
is limited to the composition process; it does not imply that the passive components
will continue to play a passive functional role in the resultant composite product. For
example, in the resultant gear assembly from the previous example, the shaft and gear
are active functional components during mechanical operations, even though they
were passive components during composition.

1.5 Historical Perspective of Software Components

Early software systems developed in the 1950s used machine languages and assem-
bly languages that did not have any software components. With the introduction of
Fortran-I in the mid-1950s, software systems could be developed in a higher-level
programming language than assembly language. However, code reuse was still l­ imited
in Fortran-I.
© 2010 Taylor & Francis Group, LLC
8 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

Fortran-I-based software systems developed in the 1950s could not use any
s­ oftware component, not even in the source code form for this reason. When Fortran
II was introduced in 1958, the concept of a subprogram was introduced. The subpro-
gram could be either a function or a subroutine. Subprograms are reused by many
main programs through function or subroutine invocations. Thus, Fortran II-based
software systems employed subprogram-based source code ­components. Fortran II
also provided support for independent compilation of a s­ubprogram. Therefore, the
­subprogram could be used as a static binary component as well.
In 1960, Algol-60 was released, which introduced the block structure concept.
The block structure allowed programmers to localize parts of programs with new
data environments or scopes. These code blocks could be reused across programs by
means of a rudimentary reuse process that copies blocks of code from one program to
another. Even though the code blocks are not scalable source code components, they
are an important concept in source code components.
In 1967, the Simula-67 programming language was born, and it brought with it the
concept of classes. At that time, the concept of data abstraction and abstract data type
did not exist, and the connection of Simula-67 classes to these concepts was not found
until 1972. Simula-67 also introduced inheritance.
Thus, class as a component in the object-oriented paradigm was born.
In 1971, the Pascal programming language was introduced. Pascal implementations
support separate compilation. Each unit includes both interface and implementation.
Interface of one compilation unit can be imported to another compilation unit with a uses
statement. This feature promoted static binary components in Pascal implementations.
In 1978, C was born. It promoted the reuse of function libraries as static binary
components. Header files served as interfaces between components.
Smalltalk, which was born in 1972, and reborn in 1980, treated everything as an
object, a concept that has been borrowed in modern-day programming languages.
The difference between a subprogram component and an object component is that the
subprogram is just a method call that does not maintain data, whereas an object main-
tains and encapsulates data apart from providing a method call form of interaction.
With the birth of C++ in 1984, and subsequently Java in the 1990s, and .NET in
2000, object-oriented programming and class libraries occupied the center stage of
components in the form of static binary components and dynamic binary components.
Distributed dynamic components became prevalent in the 1990s, with the introduc-
tion of Java Beans, CORBA, COM, DCOM, JEE, and other similar technologies.
See Figure 1.1 for a historical overview of software components.

1.6 Defining Software Components

Extending the definition of the generic component from Section 1.4, software compo-
nents are units of composition and decomposition in a software system. Composition
of an appropriate collection of software components should yield a complete software
© 2010 Taylor & Francis Group, LLC
In t r o d u c ti o n t o C ODA 9

Machine Code Component-Oriented


Programming Programming

Assembly-Language Aspect-Oriented
Programming Programming

High-Level Language Object-Oriented


Programming Programming

Procedure-Oriented Reuse through


Programming Libraries

Figure 1.1 Historical perspective of software components.

system; decomposition of a software system should yield the constituent components


that make up the software system.
Software components are parts of a software system which can be individually
identified, stored, retrieved, assembled, and disassembled. There are two differ-
ent approaches possible in the definition of software components. One approach
is to use the existing software abstractions such as functions and objects as soft-
ware components. Another approach is to perceive a software component as an
idea or abstraction above the level of functions and objects. We follow the latter
approach.
A software component provides functionality through an interface. Any other
­component that requires this functionality composes with this component through
the exposed interface. The implementation is kept encapsulated and is not reachable
from the consuming component. For example, in Java, an interface declares an inter-
face, whereas a class provides its implementation. The component interface and imple-
mentation are similar to this concept. The assembly of components into applications
should ideally not involve any recompiling or relinking. The development life cycle
of one component should not depend on another component, and the application
assembly should be totally decoupled from the ­development life cycles of individual
components.
When we build software systems using components, the component is the fun-
damental unit of design, implementation, and maintenance. The component offers a
piece of functionality which is used by other components. Functionality provided by
the component is exposed through interfaces. A component should be an independent
unit of development, storage, and distribution.
Functions and objects are popular design abstractions in software. Function is a
sequence of operations, abstracted as a unit in order to avoid duplication of the same
sequence of code. Functions help to break a long program into smaller manageable
© 2010 Taylor & Francis Group, LLC
10 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

units. An object is an encapsulation of data and associated operations. A type defines


a group of objects that provide the same set of operations. A class serves as a template
for the creation of multiple objects of the same type. Alternatively, a prototypical
object can be used to create many other objects of the same type. An individual func-
tion or object lacks the ability to encapsulate complex functionality. A collection of
functions or objects can encapsulate complex functionality. Such collections are good
candidates to serve as software components, provided they can expose easy-to-use
interfaces and hide complex internal implementations.

1.6.1 Function Libraries as Software Components

When a collection of functions are packaged together, they form a function library.
Together these functions implement complex functionality. However, to access the
complex functionality, one need not invoke each of these functions. It is sufficient to
invoke certain entry point functions that in turn invoke other functions. The entry
point functions are known as an API (application programming interface) of the func-
tion library. The function library makes only the API functions visible from outside
the library and hides the complexity of other functions. When function libraries are
used as software components, one component composes with another component by
invoking the API functions exposed by the latter.
There are certain limitations associated with the use of function libraries as soft-
ware components. The API of a component can be invoked by another component
only through a common programming language. The composition of two compo-
nents happens from the source code of one component which invokes the API func-
tion call of the other component. Because the wiring between the two components
is hardcoded in the source code, the composition is not amenable to rewiring during
runtime. In addition to these limitations, function libraries tend to make use of global
variables, which obscure the exposed API and provides backdoor entry to internal
functions.

1.6.2 Object Libraries as Software Components

Instead of functions, when we package a collection of objects, we get an object library


(like a Java ARchive [JAR] file in Java). Together all the objects implement a complex
functionality. However, to access the functionality, it is not necessary to access all
the objects in the library. It is sufficient to access a few entry point objects, and they
in turn access other internal objects. The object library makes only the entry point
objects visible from outside the library and hides the complexity of other objects. Type
definition of the exposed objects is known as interface type.
When we use object libraries as software components, they compose through
the exposed objects of the component. One component exposes the interface type
objects, and the other component consumes them by invoking operations on them.
© 2010 Taylor & Francis Group, LLC
In t r o d u c ti o n t o C ODA 11

The consuming component is provided with the interface type object only during
runtime. In the source code, the consuming component refers to an object of interface
type, but the object is not instantiated until runtime. This breaks the hardwiring con-
straint associated with function library software components. Object library software
components can be easily rewired during runtime. We discuss this feature in detail in
the next chapter.
To facilitate reuse, we should be able to store and retrieve software components
from a repository. A function library or an object library can be stored in the form of
source code or binary code. A software component distributed as source code can get
modified before reuse, which is not encouraged. If a software component needs some
changes before it can be reused, these changes should be tracked, and the modified
component should be stored in the repository as a new component. So a software
­component repository stores each component as a binary code in primary storage. A
secondary storage can store the component as source code, but this storage is restricted
to users with an obligation by them to submit a new derived component into the
repository. This is discussed in detail with examples in the next chapter. In the rest of
this book, we concentrate on software components made of object libraries and not of
function libraries. (See Figure 1.2.)

1.7 Elements of a Software Component

A software component has the following major elements:


• Component specifications
• Component interfaces
• Component implementation(s)
• Component model that prescribes the following:
• Composition mechanism
• Component storage and distribution mechanism
• Runtime framework specification and standard services

Source Code
Functions, Classes
Components

Static Binary
Function Libraries, Class Libraries
Components

Dynamic Binary DLL, JEE Components, OSGi Service Components,


Components Spring Components, SCA Components

Figure 1.2 Candidate software components.

© 2010 Taylor & Francis Group, LLC


12 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

1.7.1 Component Specification

A software component provides a piece of functionality. The component specification


documents the piece of functionality implemented by the component. Apart from
the functional specifications, the component specification also includes details of the
interfaces through which the component functionality can be accessed. The i­nterface
specification is typically in the form of signatures of all the operations exposed through
it. In addition to syntactic specification of the operations, the interface specifications
can include some semantics such as the preconditions and postconditions associated
with each operation.
The specification of the component should include the list of interfaces that it pro-
vides and the list of interfaces that it requires. The provided interface exposes the
component’s functionality. The specification can also include the quality (nonfunc-
tional) attributes of the component. One of the important characteristics of a software
component is that it must support black–box reuse. Knowing only the specification
details of the component, one must be able to make use of the component without any
­k nowledge about its internal implementation.

1.7.2 Component Interfaces

Components are meant to work together. As discussed earlier, the interactions between
components happen only through interfaces. The component interface defines a set of
accessible operations. An interface can be considered as contract between two com-
ponents. One component offers the interface, and another component consumes the
interface. A component may offer and consume more than one interface.
An interface is merely a list of operations with their syntax and semantics and does
not specify any implementation. Because of this, a component in a component assem-
bly can be replaced with another component with different implementation, but which
offers the same interface. The replacing component can also provide a richer interface
than the original component. Such a replacement enriches the overall functional-
ity offered by the system. Through an iterative replacement of components by richer
­components, gradual system evolution can be well managed.
Typically, an interface specification is only syntactic in which the signatures of
various operations of the interface are specified. A semantic specification needs to
specify the effect of invoking the operations on the interface. Such a specification also
requires a domain and data model that explains the semantics. A less formal semantic
specification can include the preconditions and postconditions associated with each
operation defined in the interface. Semantic specification provides a stronger contract
between the components than syntactic specifications.
It is important to notice that as components evolve and provide richer interfaces,
a versioning mechanism is required to track the differences between evolving interface
specifications. A providing component and a consuming component are unknown to
each other prior to assembly. The only common premise on which both operate is the
© 2010 Taylor & Francis Group, LLC
In t r o d u c ti o n t o C ODA 13

common interface specification. Hence, any mismatch between the providing and
requiring sides can result in catastrophic consequences during runtime.
In addition to the above, an interface specification can include global constraints
and invariants maintained across operation invocations. This can be useful in under-
standing the semantics of the component in conjunction with the preconditions and
postconditions associated with each operation. An interface specification serves as a
contract between the component providing the interface and the component consum-
ing the interface.
Apart from the functional specifications of an interface, it is important to consider
the quality attributes (extra-functional or nonfunctional attributes) of the component.
This can be specified by means of service level guarantees such as latency, reliability,
accuracy, availability, mean time between failures, mean time to repair, capacity, and
so forth.
Apart from the programming interface, a component can have a data interface and
a user interface. The data interface defines data structures used in the programming
interface specifications. The data interface also specifies persistence functionality
­provided by the component. The user interface provides user interaction mechanisms.

1.7.3 Component Implementation

A component specification can be implemented by one or more component imple-


mentations. Multiple implementations of the same specification are interchangeable
in a final system after the deployment. The implementations conform to the compo-
nent specifications. Although the component specification defines the functionality
provided by the component and the interface contracts, it does not define implemen-
tation specifications. There may be some implementation constraints mentioned as
part of the specifications, but not the complete implementation specifications. Thus,
different implementations can be of different programming languages or different
algorithms.
Component implementation must be packaged in a binary code format as pre-
scribed by the component model. It can include a validation code that verifies if the
required interfaces of the component are satisfied in a deployed environment. The
implementation package can be accompanied by requirements, specifications, design
details, and test cases.

1.7.4 Component Model

A component model is a component standard that specifies the common ­component


fabric with sockets on which components with standard plugs can be deployed.
The component model defines a standard socket to be implemented by the com-
ponent framework, and a standard plug to be implemented by components. Apart
from the common socket and plug for the component fabric, the component model
© 2010 Taylor & Francis Group, LLC
14 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

also standardizes the mechanism by which one component can expose the interface
through a socket and another component can consume that interface using a plug.
This is called the composition standard specification in the component model.
Apart from the standardization of the composition mechanism among the
­components and between the components and the common fabric, the compo-
nent model defines how a component must be packaged, stored, and distributed.
Typically, the component model is supported by a runtime component framework
onto which components are deployed. The component framework serves as the fab-
ric containing sockets onto which the deployed components plugin. Examples of
component models are EJB, .NET, CORBA, Spring, SCA, and OSGi. These com-
ponent models define a component framework, structure of the component that can
be deployed onto the framework, and a composition mechanism between the com-
ponents. Some of the component models also define a mechanism using components
which can publish their provided interfaces. Other components can search for an
interface that they require. Some component models also define an auto discovery
mechanism, in which the framework performs the lookup on behalf of the requiring
component. More details about the component model and frameworks are discussed
in Chapter 3.

1.8 Component-Based Software Engineering

Traditional software development involves design and development for specific


requirements. The classic waterfall life cycle model assumes that requirements are
frozen before design is carried out. After the design is frozen, developers typically
look for pieces of implementation from other systems which can be reused in the
implementation of the current system.
In the component-based software engineering approach, reuse starts at the system
design stage (Figure 1.3). The component-based system design makes use of all the
available components to come up with the design of the system. If some required com-
ponents are not available, then they are built from scratch. Unlike traditional software
development, component-oriented development has different life cycle phases.

1.8.1 Requirements

During this phase, the requirements of the system as a whole are captured and the
requirements’ specifications are created.

Component Component Component


Requirements Testing Deployment
Specifications Provisioning Assembly

Figure 1.3 Stages in component-based software engineering.

© 2010 Taylor & Francis Group, LLC


In t r o d u c ti o n t o C ODA 15

1.8.2 Component Specifications

During this phase, the requirements are analyzed and the architect in consultation
with the existing software assets repository identifies architectural elements of the
system. From the architectural specification, individual component specification is
derived. Many of these identified components may already have specifications as
part of the existing asset repository. Component architecture and component design
­documents are the artifacts created during this phase. The component model to be
used for the system is also identified during this phase.

1.8.3 Component Provisioning

Many of the components may be sourced from the existing asset repository. Those
components that are not readily available are created and developed during this phase
as per the component specifications. Typically, components are developed according
to a standard component model chosen during the architectural phase. The end result
would be the source code and binary code representation of the components created.

1.8.4 Component Assembly

The newly developed components and existing components are assembled to create
the software application. The assembly of the components is done with the help of a
component framework that supports the identified component model.

1.8.5 Testing

Integration and system testing are carried out to validate that the system meets all
of the requirements’ specifications. System test cases and integration test cases are
­created. The system is tested against the test cases. If required, the components and
the system will go through a defect fixing phase.

1.8.6 Deployment

The assembled components are packaged as per the packaging mechanism specified
by the component model. For example, Java-based components are packaged in JAR
files. The packaged components are deployed in the environment that supports the
component framework.

1.8.7 Component-Based Life Cycle Artifacts

There are several artifacts involved during the component development and deploy-
ment cycle, and they are graphically represented in Figure 1.4. The business execu-
tive defines the functionality of the system, which is captured as a business domain
© 2010 Taylor & Francis Group, LLC
16 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

Business Business System


Existing
Executive Analyst Architect
Software Assets

Business Component
Business Domain Model Specifications
Vision
Use Case Component
Model Architectures

Component
Design Doc

Tester

Tested
Application
Component Component
Assembler Developer

Deployer Assembled
Application Components
Deployed
Application

Figure 1.4 Component-based life cycle.

model and use case model by the business analyst. The system architect who is spe-
cialized in component engineering creates component specifications from the busi-
ness domain model and the use case model. The architect is responsible for creating
component architecture and the design document by referring to the existing software
asset repository. At the end of this activity, the architect would have identified exist-
ing components and the components to be built. The design document is handed over
to the component developer who develops the component adhering to the specifica-
tion using a standard component model identified by the architect. The assembler
assembles the software application with the existing components and the newly built
components. The tester tests the components as per the test cases, and the deployer is
responsible for deploying the assembled and packaged application to the deployment
environment supporting the component framework.

1.9 Advantages of Component-Based Software Engineering

Traditional software engineering works on the premise that requirements for a s­ ystem
are completely specified before the system is designed and built. In practicality, the
requirements always evolve over time. Component-based system engineering is fully
aligned to this evolving requirements scenario. A component assembled into the
­system under construction can be replaced by another component without affecting
the rest of the system. This provides an efficient and controlled system evolution path,
in which one can enrich the functionalities of individual components and replace
them to gradually evolve the system.
© 2010 Taylor & Francis Group, LLC
In t r o d u c ti o n t o C ODA 17

Components also aid in faster system build turnaround time because the system is built
from available components. In case some of the required components are not available,
parallel development of the required components can reduce cycle time. Components
are used in multiple contexts in different products. Hence, they become less error prone
and more rugged as they get widely deployed in many products over a period of time.
There are many other advantages in using components to build software. These
advantages are summarized below:
• Increased productivity
• Contained complexity
• Reduced cycle time
• Improved quality
• Parallel and distributed development teams
• Reduced maintenance cost
There are many advantages to building a system from components than otherwise
(for instance, as a monolith). Software product firms such as Microsoft®, Oracle®, or
IBM® can reuse software components designed and developed as part of one p ­ roduct
in another product, either as is or with variations to the original. If we consider c­ ustom
software development firms such as Infosys® or Accenture®, each software system
made by them is custom made for the clients. These firms can reuse software compo-
nents designed and developed as part of one custom software system in other software
systems, reducing effort and increasing quality as we elaborate below.

1.9.1 Reusability

Components promote reuse. A component designed and developed as part of one


product can be applied in the composition of multiple other products. Reuse of ­readily
available components in turn reduces the overall cycle time for development of a
­software system.

1.9.2 Parallel Development

If a system is designed as a composition of multiple components (some of which may


already exist and others may be new), then each of the new components can be devel-
oped by different teams concurrently. This is possible due to the producer-consumer
independence characteristic of components, which was presented earlier. Parallel
development in turn can reduce overall time to market.

1.9.3 Easy Maintainability

Maintenance of a component-based software system is easier than that of a mono-


lithic software system. This is due to the fact that fault isolation and correction can be
© 2010 Taylor & Francis Group, LLC
18 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

localized to a single or a set of components, which can be modified without ­affecting


the overall system. In a monolithic system one is faced with the challenge of managing
unknown effects that can occur in other parts and in the overall system when a main-
tenance effort is carried out at one part of the system.

1.9.4 System Evolution

Evolution is the longest and most expensive phase of the software product life cycle.
Component-based software systems are more open to evolution, as the composition
of the system can go through gradual changes over a course of time without a big
bang effect on the overall system. In other words, when a first wave of evolution
­happens on a software system, a set of constituent components may get exchanged
with a newer set of components that cater to the requirements of evolution. The overall
system is not affected during this exchange of components. After some time, when
a second wave of evolution happens, another set of components may get exchanged
with newer c­ omponents, and so on. Thus, at the end of some Nth evolution wave, the
software system may have a completely new set of components compared with the
original composition structure it had before the first evolution wave. Such a smooth
and g­ radual e­ volution is not easily achieved in a monolith system.

1.9.5 Single Point of Maintenance

When a component is applied in the composition of multiple software systems, apart


from reusability, an additional benefit that is easily obtained is that software contained
within this component is maintained only once. Defects need not be fixed redun-
dantly in each system; any defect reported in one system would cause the component
to be modified to fix the defect, and the defect fix is automatically propagated to all
the other systems that employ the same component. Additionally, documentation of
the component is maintained in one place.

1.9.6 Increased Quality

The more a component is reused, the more defects would get exposed. Thus, with
appropriate central defect fixes and propagation of fixes to all systems, the overall
­quality of software systems would improve.

1.9.7 Rapid Prototyping Support

Reusable components can provide an effective basis for quickly building a proto-
type of a software system. This provides an opportunity to present mock systems
during bidding, or to get feedback from the stakeholders during the early stages of
development.
© 2010 Taylor & Francis Group, LLC
In t r o d u c ti o n t o C ODA 19

1.10 Summary

In this chapter, we were introduced to the component paradigm. We understood


how components can reduce complexity. This chapter introduced software compo-
nents along with concepts of interfaces—required interfaces and provided interfaces,
­component composition, component models, and component frameworks.
There are many advantages to building a system from components like increased
productivity, reduced cycle time, improved quality, and reduced cost. We learned
about the characteristics and elements of a software component. The component spec-
ification describes the functionality implemented by the component, and the compo-
nent implementation implements the functionality. A component model is used as a
­component standard for building components. We also discussed the various phases
of the CODA software engineering process and the artifacts used.

Review Questions

1. What is a software component?


2. What are the benefits of components?
3. What is provided interface?
4. What is required interface?
5. What is a component model?
6. What is a component framework?
7. What are the elements of a software component?

© 2010 Taylor & Francis Group, LLC


2
C omp onent Thinkin g in Java

2.1 Introduction

In this chapter, we present an introduction to software components using the Java


­platform with hands-on examples. We present various component constructs avail-
able in Java. We build an example application using the basic component ­constructs
available out of the box in the Java Standard Edition (Java SE) platform. We discuss
the pros and cons associated with using out-of-the-box component constructs in Java.
We enhance the example application and demonstrate ways of improving the basic
component constructs. We show that the use of a component model and ­component
framework makes the job of the component developer and assembler easy.

2.2 Component Constructs in Java SE

The Java platform, Standard Edition (Java SE) consists of the following elements:
• Java Programming Language
• Java Software Development Kit (JDK)
• Java SE Application Programming Interface (API)
• Java Runtime Environment (JRE)
As application developers, we write object-oriented programs using Java classes. The
Java classes that we define can refer to other Java classes within the application’s code.
In addition, the Java classes can refer to classes external to our application’s code after
certain configurations are carried out. For example, we refer to Java SE API to invoke
prebuilt platform provided features. When we invoke any class defined in the Java
SE API, we are referring to classes external to our application’s code. Where does
this external code come from? The Java SE API specifications are implemented and
packaged inside the JRE runtime library called rt.jar.* We get visibility and access
to this external code from within our source code by including the rt.jar file in the
build path (during development time) and in the class path (during runtime). As an
example consider the application source code shown below:

package codabook.helloworld;
public class HelloWorld {
public static void main(String[] args) {

* rt.jar is the file name in Microsoft Windows platforms; in MacOS the file name is classes.jar.

© 2010 Taylor & Francis Group, LLC 21


22 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

System.out.println("Hello");
}
}

In this example, we defined a HelloWorld Java class inside a Java package coda-
book.helloworld. The class refers to the System class which is part of another
Java package java.lang. The System class is not part of our application, but it is
part of the rt.jar file that is included in our build path. Usually, to refer to classes
outside of the Java package that the source code belongs to, we need to refer to the
external class with a fully qualified name such as java.lang.System or we need
to import the class using an import statement like import java.lang.System,
after which we can use the simple class name such as System across our source
code. We did not have to do it in this example because all the classes in java.lang
are imported implicitly by the Java compiler. Consider another example whose
source code is shown below:

package codabook.greeting;
import java.util.Scanner;
public class Greeting {
public static void main(String[] args) {
System.out.println("Hello, What is your name?");
Scanner scanner = new Scanner(System.in);
String name = scanner.nextLine();
System.out.println("Greetings, " + name + "!");
}
}

In this example, we have written a Greeting class inside codabook.greeting


Java package. The Greeting class has referred to the System external class simi-
lar to the last example. In addition, it refers to the Scanner external class, which
is part of the java.util package provided by the rt.jar file. Because the java.
util ­package is not imported implicitly by the Java compiler, we explicitly defined an
import java.util.Scanner statement in our source code. Alternatively, we can
refer to the Scanner class using its fully qualified name java.util.Scanner. The
source code below illustrates this.

package codabook.greeting;
public class Greeting {
public static void main(String[] args) {
System.out.println("Hello, What is your name?");
java.util.Scanner scanner =
new java.util.Scanner(System.in);
String name = scanner.nextLine();
System.out.println("Greetings, " + name + "!");
}
}

© 2010 Taylor & Francis Group, LLC


C o m p o nen t T hin kin g in Java 23

In all the example programs we presented, the rt.jar file has packaged reusable Java
classes. Similar to the rt.jar file, a developer can package custom code into a JAR
file for distribution and use with other applications. Thus, JAR files provide a good
mechanism for storing and distributing physical software components in Java.
While the JAR file provides a physical component boundary, the Java package
­construct provides a logical component boundary across components. For example,
the rt.jar file includes many packages such as java.lang, java.util, and so
forth. This helps the same physical component to carry multiple logical components.
There is an additional advantage in using packages as a logical boundary for compo-
nents. It helps us to reuse simple class names across multiple components. For example,
we had used the Scanner class in the example programs presented so far. This class
was provided by the physical component rt.jar and the logical component java.
util package. Suppose we had to define another Scanner class as part of another
software component, say, a credit card processing component. If this new component
has a logical boundary different from java.util, say, codabook.creditcard,
the two Scanner classes have unique fully qualified names though they share a
­common simple name. In the next section, we show how to build software compo-
nents using the package as a logical boundary and the JAR file as a physical boundary.

2.3 Java Software Components Using JAR and Package

Any Java code implementing a piece of functionality can be turned into a component
by defining logical and physical component boundaries around it. For example, con-
sider a Java class that calculates the age of a person given her date of birth. The source
code of the AgeCalculator class is given below:

package codabook.agecalculator01;
import java.util.Calendar;
import java.util.GregorianCalendar;
public class AgeCalculator {
public int calculateAge(Calendar dateOfBirth) {

//…some code omitted for brevity

if (isCurrentYearBdayPassed)
age = currentYear - birthYear;
else
age = currentYear - 1 - birthYear;

return age;
}
}

The AgeCalculator class is within a logical boundary as defined by the package


codabook.agecalculator01. We can create a physical package by compiling
© 2010 Taylor & Francis Group, LLC
24 C o m p o nen t- O rien t ed D e v el o p m en t a n d A s sem b ly

this package into the AgeCalculator01.jar file. Any developer who needs age
­calculation logic as part of an application that is being developed can reuse the age
calculator component, by including the AgeCalculator01.jar file in the build
path and importing the codabook.agecalculator01.AgeCalculator class
into the source code. Let us build one such application. The application would collect
the date of birth details from the user, make use of the age calculator component to
calculate the age, and display the age back to the user. The application’s source code
is shown below:
package codabook.agecalculator01.app;
import java.util.*;
import codabook.agecalculator01.AgeCalculator;
public class AgeCalculatorApp {
public static void main(String[] args) {

AgeCalculator a
 geCalculator =
new AgeCalculator();

//…some code omitted for brevity

int age 
= ageCalculator.
calculateAge(dateOfBirth);
System.out.println("Your age is" + age);
}
}

The age calculator application makes use of the age calculator component as boldfaced
in the source code. This is made possible by including AgeCalculator01.jar in
the build path during the build time and in the class path during runtime. The build
time and runtime dependency are illustrated in Figure 2.1. The outer box signifies the
physical component boundary, and the inner package box signifies the ­logical compo-
nent boundary. Internals of the components are housed within the logical boundary.
The simple JAR and package-based components worked well in the creation of the
age calculator application. However, there is one drawback in this schema. In compo-
nent-oriented development and assembly, we want to source components from indepen-
dent third-party vendors. This means the vendors and the components that they develop

AgeCalculator01.jar AgeCalculatorApp01.jar

codabook.agecalculator01 codabook.agecalculator01.app
+ AgeCalculator + AgeCalculatorApp

Figure 2.1 Age calculator component dependency.

© 2010 Taylor & Francis Group, LLC


Another Random Scribd Document
with Unrelated Content
THE EXCHANGE

The origin of the commercial exchange is coeval with the


beginning of commerce. According to that eminent Oriental scholar
and historian, Rawlinson, the city of Babylon contained several of
these marts, each devoted to the sale of some particular description
of merchandise, and Herodotus intimates that one of them was set
apart exclusively to the sale of wheat, corn, barley, millet and
sesame. Athens and Rome also had their exchanges, and during the
middle ages the traders of Venice were wont to assemble in the
Rialto. Marseilles boasted of a Chamber of Commerce in the fifteenth
century, and as early as 1566 London merchants were accustomed
daily to convene in the open air at various localities in Lombard
Street, until the erection of the present Royal Exchange, and to-day
exchanges or bourses are among the prominent commercial features
of every great European city.
The idea of a commercial exchange germinated in the United
States before the war of the American Revolution. Here, as in
Europe, the basis of every mercantile exchange is a voluntary union
of business men, who deem it for their mutual interest regularly to
assemble in some convenient locality, for the purpose of effecting
the sale of commodities or securities, and of profiting by the
fluctuations in market prices. Stock exchanges, produce exchanges,
chambers of commerce and boards of trade are all essentially
identical in character, the principal point of difference being the
nature of the commodities bought and sold.
The New York Chamber of Commerce, founded in 1768, is the
oldest organization of this kind in this country. Similar institutions
were established in Baltimore in 1821, and in Philadelphia in 1833.
In 1858 there were ten chambers of commerce and twenty boards
of trade between Portland and San Francisco. In 1865 these bodies
organized what is known as the “National Board of Trade.” In this
association are represented Albany, Baltimore, Boston, Buffalo,
Charleston, Chicago, Cincinnati, Cleveland, Denver, Detroit,
Dubuque, Louisville, Milwaukee, Newark, New Orleans, New York,
Oswego, Peoria, Philadelphia, Pittsburg, Portland, Providence,
Richmond, St. Louis, St. Paul, Toledo, Troy and Wilmington.
As an institution, the commercial exchange has been productive of
some good, but much harm. If restricted in its scope to the
legitimate purposes of commerce, it is unquestionably of the highest
benefit to the business world. When its operations are diverted into
illegitimate channels it becomes a source of incalculable injury to
society. As a great market place, it plays an important part in
modern civilization; as a gigantic agency for the promotion of
gambling in the commodities of the world, it is a snare, a delusion
and a curse.
Not all the gaming hells of the country combined afford facilities
for gambling equal to those furnished by these organizations. The
faro dealer places a limit upon the stakes wagered; upon the floor of
’Change one may bet without limit. Not everyone can obtain
admittance to the gilded salon of the tiger; the commission
merchant, or broker, who does business upon the Stock Exchange or
Board of Trade accepts orders from all comers. The character of the
transactions in which his principals engage is to him a matter of
indifference, his interest being centered in their frequency and
extent.
To one who is not versed in the methods of conducting trading in
the mercantile exchange, the jargon of the ordinary journalistic
report of a day is unmeaning gibberish. “Longs” and “shorts,” “puts,
calls and straddles,” “scalpers” and “plungers,” a “squeal,” a
“squeeze,” an “unloading,” are terms as destitute of significance as
though they were words from a foreign tongue. Yet the mode of
doing business is not so complicated that any man of average
intelligence need fail to grasp it. The author—as he has already
stated in his autobiography—was once connected with a firm
operating on the Chicago Board of Trade, and as such, acquired an
intimate acquaintance with the modus operandi of its dealings, and
he believes that his work would be incomplete should he ignore the
marble palace through whose noiselessly swinging doors so many
thousands have entered upon the path of shame which leads to ruin.
Not that the Chicago Board of Trade is either worse or better than
the score of similar institutions scattered through the country; nor is
it intended to select that organization as the object of special
animadversion. The methods of all commercial exchanges are, as
has been said, substantially identical.
Members of these bodies may be classified on any one of several
general principles. One system of classification has relation to the
character of their operations; in other words, all members may be
divided into two classes, the first comprising those who venture on
their own account (popularly known as “speculators”), and the
second embracing those who buy or sell only on the receipt of
orders from outsiders (i. e., brokers). Under another system,
members may be classified as those who wish to enhance the prices
of commodities on the one hand, and those who, on the other, seek
to depress market quotations. The former are technically known as
“bulls,” and the latter as “bears.” These sobriquets are derived from
the well-known propensities of the two descriptions of animals, the
one to hoist and the other to pull down. A “bull” is one who seeks to
advance prices; a “bear” one who strives to lower them. The
distinction between “longs” and “shorts” is substantially of the same
nature. A “long” is a speculator who, believing that the price of a
certain commodity is destined to advance, buys freely in anticipation
of a rise. It follows that he is naturally, if not inherently, a “bull.” On
the other hand, a “short,” judging that quotations are destined to
decline, sells wherever he can find a purchaser. He, naturally, is a
“bear.” It must not be forgotten, however, that neither of these
parties for a moment actually expects either to receive or deliver the
articles which he buys or sells; and the reason for this apparently
inconsistent statement will be explained hereafter.
With these few prefatory words of explanation, we will pursue the
course of the speculator, after which will be given a definition of the
slang terms used, and following this the reader will find a concise
description of the adventitious agencies employed in the
manipulation of the market.

CHICAGO BOARD OF TRADE.

And first, as to the speculator: He may fall within either one of


two categories—the professional or the occasional. Yet even under
the general caption of professional speculators, operators may be
divided into two classes. One embraces men whose large wealth
enables them to contrive and engineer what is popularly known as a
“corner;” the other includes those who follow in their wake, believing
that they can discern their intentions, and laying the flattering
delusion to their souls that they can presage the course of prices.
The professional speculator, as being the “larger fish,” should first
claim our notice. He it is who originates and conducts “corners,” by
which term is meant the forcing up of prices for any given
commodity to a point far beyond their legitimate value, with a view
to enriching the few at the expense of the many. Men of this stamp
ordinarily associate with themselves kindred spirits, whose natural
bent is the same as their own, and whose capital may prove of value
in carrying out their schemes. The combination having been formed,
the first objective point is the selection of some commodity or stock
to “corner.” The choice having been made, the next step is, quietly
and unostentatiously to buy all of it that can be purchased. Let not
the unsophisticated reader for a moment suppose, however, that the
syndicate thus formed proposes to buy the article in question at
current rates. Far otherwise. Prices must be depressed, and there is
an obvious way in which to effect this result. Every market in the
world is supposed to be governed by the normal relations between
supply and demand. It follows that free offerings of any commodity
are likely to reduce its quotable value. What, then, are the tactics of
the “operator”? Evidently to offer to sell freely. Under the influence
of the precipitation of large lots, prices recede, and the speculator is
shrewd enough to purchase “at the bottom of the market.” Of course
he does not expose his policy by buying such enormous quantities in
his own name. He has recourse to firms doing a strictly commission
business, of whom he employs a multiplicity, and who always refuse
to disclose the name of their principal—not from any high sense of
honor, but from motives of self-interest, for the simple reason that
such exposure would result in a peremptory withdrawal of business.
Having secured the desired quantity of the stock or commodity
selected, the clique proceeds to advance the price, not abruptly but
gradually, selling a little here and buying a little there, the object
being the mystification of the miscellaneous dealers. At last comes
what is known as the “squeeze.” The cabal having all, or at least the
great preponderance, of the article where they can, if they choose,
call for its immediate delivery, refuse to entertain any offers at less
than the limit fixed. The consequence is that the “shorts”—i. e., the
men who have sold to the syndicate—are compelled to settle at the
price to which the coalition has forced quotations. The method of
operation can be best illustrated by a suppositious case. Let us
suppose—simply by way of illustration—that a coterie of dealers in
grain resolve to force up the price of wheat, although not to localize
the illustration, we might assume the formation of a “corner” on
some one of the numerous stock exchanges with which the country
is blessed (?), or cursed. But let us take the Chicago Board of Trade,
with whose methods the author is most familiar: Let us suppose that
the article to be “cornered” is “July wheat,” and that the combination
has been formed in March. Resort is had to the tactics above
explained. Wheat for July delivery is first depressed, then bought,
and in the end sold without regard to its inherent value, but solely
with a view to what the “shorts” may be forced to pay. The profits of
such “corners,” thus constructed, are sometimes enormous. Yet, as
in the game of faro, the most expert dealer is sometimes put to
heavy loss by the combination which is playing against the bank; so
even the machinations of the strongest and shrewdest operators are
brought to naught either by a combination of brighter minds, by a
failure carefully to guard every weak spot, or, it may be, by very
chance. The same elements are present in both games, faro and
stock-jobbing. These corners are conceived in cupidity, carried on in
deceit, and consummated in heartlessness; yet there are not
wanting those who affirm that the commercial exchange is the very
prop and bulwark of American commerce! That the exchange, in its
legitimate scope, affords an easy and safe way of doing business,
cannot be denied; that its practical operation is to foster speculation
and encourage reckless gambling is equally indisputable.
This assertion seems, on its face, perhaps, ill-considered, yet it is
abundantly justified by facts. We have, thus far, considered only the
tactics of the professional “operator.” Let us, for a moment, consider
the fortune (or misfortune) that awaits the occasional speculator.
The latter closely resembles the man who plunges, headlong, into
the Niagara rapids without even a rudimentary knowledge of the art
of swimming. Like a chip, he sports upon the crest of the eddying
waters of the whirlpool, until, gradually drawn nearer and nearer
toward the centre, he is sucked into its very vortex, sinking to
reappear no more. Yet this comparison is weak. The outside
speculator who fancies that he can buy or sell on “pointers,” (i. e.
private information) given him by parties well-posted, very nearly
approaches an idiot in the matter of intelligence. Let us take, as a
single illustration, a case which fell under the author’s personal
observation. The experience of the victim (whom we will call Jones)
is by no means exceptional. Mr. “Jones” was advised by a friend (?)
that “old Higgenbotham” had bought up all of a certain article and
that within sixty days prices were destined materially to appreciate.
Naturally “Mr. Jones” found his interest, as well as his cupidity
stimulated. What would his friend recommend him to do? “Buy, of
course; and buy heavily,” was the answer. “But I don’t know how to
buy,” objected Jones. “Why,” replied his advisor, “that’s the easiest
thing in the world, Q X & Z, one of the best houses in the street, are
particular friends of mine. Take my card and go down and see them.
They’ll use you right.” The unfortunate “Jones” listened to the siren
song. He interviewed Q X & Z, by whom he was received with
distinguished consideration. The firm of brokers explained to him
how he could, by depositing with them a “margin” of five per cent.
on the par value of his prospective purchase, become the putative
owner of twenty times the amount of his deposit. Of course he must
buy for future delivery, this not being a “cash” transaction. But there
was no doubt that prices would advance. Oh, certainly not.
Mr. “Jones” was naturally a little timorous, being unaccustomed to
speculation. He advanced a few hundred dollars, however, by way of
“margins,” and at the conclusion of the “deal,” found himself winner
by a handsome sum. His experience was a revelation to him. He
ventured again and again, with varying success. Finally he found
himself heavily interested on the wrong side of the market. He was
assured that prices must necessarily take a turn, and he could ill
afford to lose the sum already risked.
To understand the nature of the risk which he had incurred,
however, some explanation of the method of speculating by means
of margins is necessary. To illustrate: let us suppose that a certain
article—say, wheat is to-day at $1.00 per bushel, of course 10,000
bushels are nominally worth $10,000. Imagine a legitimate purchase
of such a quantity at these figures. Should the price advance one
cent per bushel, the 10,000 bushels would be worth $10,100; should
it fall off one cent the wheat would be worth only $9,900. In the
former case the buyer would win $100; in the latter he would lose a
like sum. In the case of a bona-fide sale, the whole of the $10,000 is
actually paid. In a speculative transaction the purchaser only
advances a part of the price, usually a few cents per bushel, which is
placed in the hands of his broker, who gives him a receipt therefor.
The commission merchant conducts the business in his own name,
assuming personal responsibility for the payment of the money. To
protect himself against possible loss, which may result from violent
fluctuations in the market, he insists upon a marginal deposit as
above stated. Should the depreciation in value approach the limit of
the margin, the speculator is called upon to advance more money. If
he fail to do so, and the decline continues, the broker protects
himself by selling out the article bought, charging his customer with
the loss sustained, together with his own brokerage charges, and
handing over to him whatever small balance may remain to his
credit. In the case of a speculative sale, precisely the same methods
are employed, except that as the seller’s gain is derived from a
depreciation and his loss through an advance, when the “margin” is
in danger of being “wiped out,” the broker closes the transaction by
buying on the customer’s account instead of selling.
But to return to the experience of Mr. “Jones.” As has been said he
had ventured largely, and he found himself confronted with financial
ruin. Although engaged in a money-making business, he had
plunged so deeply into the maelstrom of speculation that his capital
was seriously impaired. What was to be done? To withdraw meant
bankruptcy; yet, how could he go on? Only one way presented itself
to him. He was the executor of his brother’s will and the guardian of
his brother’s minor children. The trust funds placed under his control
might be utilized to avert impending disaster. Not that he would
wrong the orphans whose patrimony had been committed to his
care, but he would temporarily borrow the money of the estate, to
be returned with interest, within a few weeks. He succumbed to the
temptation and the result need hardly be told. The combination
formed for the purpose of controlling prices absorbed these funds as
it had the others, with the same relentless rapacity as do the knights
of the green cloth the last hard-earned dollar of the day-laborer. The
day of settlement arrived, the bubble burst and the unfortunate man
found himself buried fathoms deep in dishonor and ruin. Not only
was he penniless, but he realized that wherever he went the finger
of scorn pointed out his every step. A temperate man before, he
plunged headlong into dissipation. His wife found herself compelled
to leave him, and to-day, stripped of fortune, bereft of family,
deserted by friends, he walks the streets with faltering tread,
aimlessly and hopelessly; living God knows how; hanging about
bucket-shops and pool-rooms, considering that a fortunate day on
which, honestly or dishonestly, he can earn half a dollar.
Nor is this an isolated case. The speculator who has been alluded
to is but a type of a class of men whose name is legion. The ruined
reputations of confidential clerks, cashiers and administrators of
trust funds mark the path of the reckless operator as milestones
mark the causeway. The terrible fascination of gambling, whether
through speculation or cards, when once the votary has succumbed
to it, can be most fitly compared to that of the opium habit. The
victim of this body-debasing, soul-destroying vice is willing to risk his
hopes, not only for time but for eternity, on the gratification of his
appetite. So does the devotee of the faro table or the man
infatuated with the allurements of the exchange stake his life, his
honor, his very salvation upon the turn of a die or the rise or fall of a
particular stock.
Better, far better, were it for the man who enters a gaming resort
that his first wager prove unsuccessful; far happier would he be who
determines to “speculate in futures” did his first venture result in
heavy loss. In either case the influence of failure would prove a
deterrent sufficiently powerful to avert years of future misery, if not
ultimate destruction.
The technical nomenclature of the exchange—sometimes termed
the “slang of the street”—which, as has been remarked, is
incomprehensible to the uninitiated, in itself affords some key to the
nature of the business transacted. Some of the most common terms
are here defined, although to enumerate them all would swell the
dimensions of the present chapter beyond the limits assigned it.
A “scalper” is an operator who makes it his practice to close his
transactions as soon as he can see a small profit, say a quarter of
one cent. His operations are neither more nor less than betting on a
rise or fall in prices.
The “guerilla” is a species of the genus “scalper,” few in number,
and makes a specialty of dealing in stocks and commodities: So
unsavory is the reputation of this class that it has fixed the
appellation of “Hell’s Kitchen” and “Robber’s Roost” upon certain
localities in the New York Stock Exchange.
Still another class is composed of those who strive to enrich
themselves by the fictitious rise and fall of a particular stock in which
they constantly deal.
The terms “long” and “short,” when used as adjectives, have been
already explained, and their signification when employed as nouns is
practically the same. A “long” is a speculator who has bought heavily
in anticipation of a rise. A “short” is one who has sold freely in
expectation of a decline. The action of the former is called “loading.”
“Forcing quotations” is keeping up prices by any means whatever.
When this is accomplished by the dissemination of fictitious news or
the circulation of unfounded rumors, the operator is said to “balloon”
prices.
A speculator is said to “take a flyer” when he engages in some
side venture; he “flies kites” when he expands operations
injudiciously; he “holds the market” when he prevents a decline in
prices by buying heavily; he “milks the street” when he manipulates
so skilfully that they rise or fall at his pleasure; he “unloads” when
he sells the particular stock or commodity of which he is “long;” he
“spills stock” when he offers large quantities with a view to lowering
or “breaking” prices; if he is successful in these tactics he is said to
“saddle the market.”
A “bear” is said to be “gunning” a stock when he employs all his
energy and craft to “break” its price. He “covers,” or “covers his
shorts,” when he buys to fulfill his contracts. He “sells out” a man by
forcing prices down so that the latter is obliged to relinquish what he
is “carrying,” perhaps to fail.
The nature of a “corner” has been already set forth in detail. The
operator or clique organizing and managing it is said to “run” it. The
day when final settlement must be made between the opposing
parties engaged in such a transaction is termed “settling day.” If the
“bears” are forced to settle at unusually high prices they are said to
be “squeezed.” The “squeeze” which has followed many a corner has
precipitated not a few wealthy men into financial ruin. This
circumstance, however, is usually a matter of utter indifference to
the manipulators. The success of a “corner” is sometimes prevented
by what is known as a “squeal,” or revelation of the secrets of the
pool or clique by one of its members. Sometimes the plans of the
organizers of a “corner” are brought to naught by a “leak” in the
pool, that is, by one of the members secretly selling out his holdings.
Of course, a “corner” can be formed only on what is known as a
“future,” or future delivery, by which is meant the sale and purchase
of some stock or commodity to be delivered at some period in the
future.
Yet another form of gambling very common upon the floors of
stock and commercial exchanges is known as dealing in “puts,”
“calls” and “straddles.” When a person buys a “put,” he pays a
stipulated sum for the privilege of selling to the party to whom it is
paid, a certain quantity of some particular stock or other article,
within a fixed time, at a designated price. Thus A might pay to B one
hundred dollars for the privilege of selling him one hundred shares
of Union Pacific stock at a stipulated price, within ten days. As a
matter of course, the price named is always a little below the current
quotation ruling at the time the contract is made, i. e., the day upon
which the “put” is bought. If, for instance, the “put” is sold at 80
cents on that day, and the market declines to 75, A might tender to
B the one hundred shares, and the latter would be compelled to take
them at that price. In such a case A would have gained five dollars
per share, or five hundred dollars in all, provided he had “covered
his shorts,” i. e., bought in the stock which he had already put, at
the latter figure. As a matter of fact, neither party contemplated an
actual delivery. The market having declined, A’s net gain is, of
course, only four hundred dollars, he having already paid one
hundred dollars to B. This appears an easy method of winning
money. As a matter of fact, however, experience has shown that
very few men win through the purchase of “puts” and “calls.”
A “call” is similar in its general nature to a “put,” but differs from it
in that the buyer of the former has the privilege of calling or buying
a certain quantity, under the same conditions. The seller of the “put”
contracts to buy, and of the “call” to sell, whenever the demand is
made.
A “straddle” is a combination of the “put” and the “call,” and is the
option of either buying or selling. The cost of these “puts,” “calls,”
and “straddles,” which are known as “privileges,” varies from one to
five per cent. of the par value of the stock, or the market value of
the commodity involved, and depends upon the time they have to
run, the range covered, and the activity and sensitiveness of the
market.
It is claimed in behalf of these privileges that they are, in their
essence, really contracts of insurance, and as such are entirely
legitimate. The general public, however, has always regarded them
as a complex system of betting, and believes that they constitute
one of the most pernicious features of the exchange. The fallacy of
the argument in their favor, above outlined, becomes apparent when
it is remembered that the law regards all contracts of insurance as
being one form of gambling, and sanctions and enforces them only
on grounds of public policy. The burden of proof is upon the
defenders of “puts” and “calls” to show that, even if it be conceded
that they are contracts of insurance, they can be justified as being
necessary to the furtherance of commerce or the welfare of society.
That they do not tend to promote commerce is shown by the fact
that neither party to the transaction for a moment contemplates the
actual delivery of the article bought or sold. It is essentially a wager
between two individuals as to the future course of the market, one
betting that prices will advance, and the other that they will decline.
The absurdity of claiming that they promote the general welfare of
society, (were such a claim advanced), may be easily demonstrated
by calling attention to the economic consideration that the winner
has done nothing to produce the money which he pockets, and by
pointing to the pecuniary loss and moral debasement which they
entail. They sustain somewhat of the same relation to the dealings
of the large operators as does the keno room to the faro bank.
The legislature of Illinois, a few years ago, placed the seal of its
condemnation upon the practice by making it a misdemeanor to deal
in privileges. It is said (although the author is unable to vouch for
the truth of the statement), that this virtuous action on the part of
the lawmakers was due to the influence brought to bear upon them
by a well-known member of the Chicago Board of Trade, who had
been dealing extensively in “puts” and “calls,” and had lost heavily.
However that may be, the Chicago Board, after permitting the
practice for years, adopted a rule prohibiting their sale, and even
went to the length of suspending a few members for its violation,
among them being one of the most prominent operators upon the
floor. This spasm of virtue, however, was not of long duration, and at
the present time such privileges may be procured from members of
that august body with the greatest ease.
The action of this great Western Exchange in the premises may
possibly have been prompted by motives other than a desire to
comply with the statutes. Long after the enactment of the law,
privileges were sold as freely as before its passage. In time,
however, it was found to be a two-edged sword. Operators found it
possible to purchase “puts” for the purpose of buying against them,
and to buy “calls” with a view to shield themselves from loss when
they became “bears.” Thus an army of sellers appeared when the
“call” price was reached, and a horde of buyers when the market
touched the price at which “puts” had been sold, the consequence
being that the range of the market was curtailed. Members objected
to tactics which robbed the market of that elasticity so dear to the
speculator’s heart. Carping critics say that the virtue of the directors
was the outgrowth of disappointed self-seeking. In other words—
speculation—the very life-blood of the exchange was being curtailed.
Hinc illae lachrymae.
But the action of the directors, as was soon found, rendered it
possible for certain members, who were willing to incur the risk, to
do a thriving business in privileges provided the transactions were
secret. Of course firms desiring to obey the rules were at a
disadvantage, and legitimate brokerage suffered. There was one
obvious, logical conclusion: “Allow every one to engage in the
business or no one.” This commended itself to common sense, and a
carefully worded resolution was adopted, the practical effect of
which, as every one understood it, was virtually to remove the ban
from the sale of privileges. Since that time, “puts” and “calls” may be
purchased with the same ease as one may pay his taxes.
But let us return to the methods employed in the manipulation of
prices. Reference has been already made to the very common
practice of attempting to “bull” or “bear” quotations by buying or
selling large quantities, or “blocks” of some particular article. There
is probably no description of market in the world so extremely
sensitive as the commercial exchange. A sale or purchase of any
given commodity by certain, well-known operators, is often sufficient
to excite its pulse to fever heat. A similar result may ensue from a
report that the Secretary of the Treasury contemplates a call of a
certain denomination of bonds; that Bismarck had been heard to say
that the French blood was too thin and needed a little more iron;
that a norther in Texas had killed a herd of cattle; that a few
grasshoppers had been seen in the neighborhood of Fargo; or that
the mercury was believed to be about to fall in Northern Minnesota.
The great speculators, the master minds of these gigantic
institutions, are quick to perceive this sensitiveness, and equally
prompt to avail themselves of it. Fictitious news is as potent an
agency in advancing or depressing prices as is the genuine article,
and it is a sad truth that there are not wanting large operators who
do not scruple to employ it. It is said—and there is good reason to
believe the statement to be true—that there are men at all great
commercial centers whose only occupation is the dissemination of
unfounded reports, with a view of raising or lowering the prices of
certain commodities in regard to which the rise or fall of a fraction of
a cent may mean the gain or loss of millions. These manufacturers
of fictitious news are said to “wear purple and fine linen and fare
sumptuously every day.” The results of their operations are to be
found in the wrecking of important financial and corporate interests
and the corresponding enrichment of the unprincipled manipulators
who employ them.
Some years ago, there came a mysterious rumor to the New York
Stock Exchange, that the directors of a certain railroad in the
Northwest had decided upon taking a step which could not fail to
prove disastrous in the extreme to the interests of the corporation.
No one was able to tell just where the rumor originated, yet it found
sufficient credence to depress the price of the road’s stock, and to
induce free selling. The next day came the refutation of the story;
the stock recovered its tone, and the clique in whose interest the lie
had been sent over the wires reaped a profit of $60,000. In the
slang of Wall Street this was called “a plum.” It is difficult to see the
difference in moral turpitude between such tactics as these and
“steering” for a “brace” faro bank.
An acquaintance of the author, who served with distinction during
the late civil war, on his return home, was employed by a company
owning alleged oil lands in Pennsylvania, to superintend the sinking
of wells within its territory. The salary was liberal and the duties not
arduous. Wells were duly sunk, but no oil discovered, after a time,
the gentleman in question received instructions from the
headquarters of the company in an Eastern city to telegraph, on a
certain day, that a well recently sunk, was yielding a certain large
number of barrels per day. This dispatch was to be followed, a day
later, by one of similar tenor, making a like assertion in reference to
another well. The party who gave these instructions well knew that a
certain class of speculators on the exchanges are in the habit of
discounting private information through the bribery of telegraph
employees, and he placed no little reliance upon this fact for the
furtherance of his scheme. The event proved that he had calculated
wisely. The telegrams were duly sent and were read by other parties
before they reached the man to whom they were addressed. The
result was that the company’s stock bounded upward with the
celerity of a rubber-ball, and the projectors of the enterprize
unloaded at an enormous profit. Of course, the purchasers found out
that they had been deceived, but as none of the officers of the
corporation had disseminated the report of the finding of oil, it was
impossible to attach any responsibility to them.
And yet there are not wanting those who affirm, and stoutly
maintain, that without the commercial exchange, business would be
brought to a stand-still, and commerce paralyzed; that Boards of
Trade and Produce and Stock Exchanges are prime factors in
advancing the welfare of the country. And this is said despite the
fact that the percentage of legitimate business done is utterly
insignificant in comparison with that which is purely speculative in its
character. The sales of one agricultural product alone upon the floor
of a single mart of this sort for one month alone have been known
to equal the production of the entire country for a whole year! Is this
legitimate commerce, or is it gambling on the wildest and most
extensive scale? Members of various Boards in the United States
who assume to do a strictly legitimate business, send out circulars
through the rural districts, the sole object of which is to induce the
recipients to speculate upon the floor of ’Change. These
communications depict, in glowing terms, the ease and certainty
with which ignorant countrymen may acquire fortunes in a day,
through the purchase of a “put” or a “call,” or a “straddle.” They
purport to explain, fully and clearly, the methods of speculating in
stocks and grain, and represent the system as simple and easily
comprehensible, while the authors know that the system is in itself
complex and the issue a venture—at the very best—uncertain. It is
not pretended that the transaction contemplates an actual transfer
of the commodity from seller to buyer. Is this frank? Is it manly? Is it
honest?
Scarcely a decade has passed since the whole country rung with
the echoes of the “Fund W” scandal. Unquestionably the men who
engineered that gigantic scheme of fraud were not representative
members of any commercial exchange, yet it is equally certain that
but for the facilities afforded for the perpetration of the fraud
through the Exchanges’ methods of doing business, that stupendous
swindle would have been impossible. Yet the infatuated speculators
who do business through legitimate houses, believe that they can
trust their own judgment as to the future of the market! It may be
that such folly has its parallel, but it is not to be found in that of the
man who stakes his money on the issuance of a particular card from
a faro box.
Few of those who have never witnessed the daily routine of
business on the floor of an Exchange can conceive the wild uproar,
the hubbub, the confusion, the tumultuous excitement, which there
reigns supreme. Let us take a glance at one of the best known.
During the busy hours of the session the floor of the magnificently
proportioned room is crowded. Scattered about at distances more or
less regular, are large marble-topped tables, about which gather
groups of men engaged in quiet, though sometimes earnest,
conversation. These tables contain drawers, in which members, who
pay well for the privilege, keep samples of the commodities in which
they deal. Hurrying to and fro about the room may be seen brokers
and their clerks, carrying in their hands small paper bags, containing
samples of grain which has been consigned by growers or other
shippers, for sale. Similar bags are strewed all over the tables.
Everything indicates activity, and it is evident that important
business is being transacted. The sound of the voices of the traders
rising from the floor to the visitors’ gallery, joined to the clicking of
the myriad of telegraphic instruments, reminds one of the ceaseless
hum of bees around a hive, heard in midsummer, when the nodding
clover and bending buckwheat invite the tireless workers to taste
their sweets.
Such is the scene during the early hours, but as the morning
advances the picture changes. In the center of the room are four
octagonal “pits,” formed by short flights of steps which rise from the
floor on the outside and again descend on the inside. In these so-
called pits is carried on the heaviest business of the Exchange. One
is devoted to the sale of wheat, another to corn, and a third to
provisions, pork, lard, etc. Gradually, as the minutes and hours pass,
they fill with an eager crowd of traders, which swells in numbers
until the area itself and the steps leading to it, are literally jammed
with an excited throng, yelling, gesticulating, waving their arms and
shaking their fists in each other’s faces. The hum has risen to a
surge, and to the onlooker in the gallery the scene seems to have
been transformed into Bedlam or pandemonium. On the upper row
of steps of one of the pits, men stand facing each other, forty feet
apart. One raises his hand and makes what appear to be cabalistic
signals to the other, who makes some other equally mysterious
signs. Then each produces a card on which he makes an entry, and
the dumb show is duplicated by others. To understand this
pantomime, no less than the significance of these frenzied cries and
frantic gyrations of arms and fingers requires an education of
peculiar character, the education of the habitué of the floor. Each
motion of the hand, each turn of a finger has its significance,
representing the quantity of the particular commodity sold, and the
price at which it is bought. These angry, dissonant voices, proceed
from the hoarse throats of opposing factions, one trying to “bull”
and the other to “bear” the market, and each striving to rival the
other in clamor and persistency. No wonder that the excitement is
intense. The entire wheat crop of the country is being sold before it
is harvested, and much of it before it is planted, and on transactions
of such magnitude a variation in price of even a fraction of a cent,
means the gain to one and loss to another of tens of thousands of
dollars. Fortunes are accumulated and sunk in an hour. One operator
sees wealth within his grasp; another perceives bankruptcy staring
him in the face. It is not strange that under such circumstances the
strongest passions in the human breast should struggle for mastery,
and find vent in expressions as wild as they are exaggerated.
Yet outside this howling, seething, surging crowd, within hailing
distance from the center of all this hubbub (were language audible
at a distance of thirty feet), sits a row of men, some of them in the
prime of life, some of them scarcely past its meridian, others
wearing the silver crown of age. Cool, collected, seemingly
dispassionate, they exchange conversation which appears to be
humorous, to judge from the laughter which it provokes. To the
casual observer, they seem to be in the “madding crowd,” but not of
it. Yet one who carefully watches their movements may see that
from time to time signals are exchanged between some one or other
of them and some individual on the steps of the pit. These men,
thus sitting apart, are the great operators, those who make prices,
and whose every movement is watched, as possibly affording a clue
to their intentions. Jealously, however, do they guard their secrets;
impassable are their countenances, and imperturbable their
demeanor. With the seemingly stolid indifference of the veteran
gamester, who sees his last dollar swept from the table by the turn
of a card and gives no sign of regret, these men calmly witness the
wiping out of a fortune by a rise or fall in prices, and manifest not
the slightest indication of emotion.
To the visitor sitting aloft the spectacle is strange, bewildering,
fascinating.
But let us descend to the floor, to enter upon which the stranger
must obtain a card of admission. Here one passes men who have
won largely, but whose countenances betray no symptom of
exultation, and others whose losses have been heavy, yet whose
laughing faces and merry jests indicate no dissatisfaction either with
the world or with life. The busy operators at the telegraph key-board
are too much absorbed in their work to give heed to the Babel of
confusion around them. Messenger boys scurry hither and thither, in
anxious quest of men for whom they bear tidings, perhaps of grave
consequence. Suspended from various points about the room are
charts, tables and diagrams, relating to almost every conceivable
subject, the report and forecast of the Signal Service office; the
supply of cereals at every market in the civilized world; the
movement of breadstuffs and provisions at home and abroad; the
cargoes of steam-ships from American, European and East Indian
ports; comparative statements of receipts and shipments; and one
thousand and one other matters, a knowledge of which may be of
interest to members. On the front of one of the long galleries are
huge dials, whose index fingers record the fluctuations of prices in
the pit. On days when speculation runs riot and excitement is more
than usually rampant, these pointers sway to and fro with a rapidity
of movement almost bewildering.
But before we have satisfied our curiosity, or sufficiently indulged
our admiration of the completeness of the mechanism of the gigantic
machine whose revolutions we have been contemplating, the striking
of the great gong indicates that the active business for the day in
one of the world’s greatest marts has closed. To one who has
regarded the transactions with the indifference of a chance
spectator, this sound means little more than the tolling of the bell,
which in some high tower marks the hour. But on more than one
listening ear upon the floor it falls like the knell of doom. To many a
venturesome speculator who has unfortunately placed himself upon
the wrong side of the market, it is ominous of a crisis in his affairs
which must be promptly met if he is not to be overtaken by ruin,
perhaps by disgrace. He must become a borrower, or be publicly
posted as being unable to meet his contracts. Perhaps he has
already overstrained his credit, and knows that his commercial paper
must go to protest. Who can surmise all the varied feelings which
the sound of that gong awakens in the breasts of not a few of those
who hear it? Yet no sign of emotion is visible in the vast throng of
brokers and their principals as they descend the broad marble
staircase or hurry to the elevators. They laugh, smoke and chat as
though they were returning from a merrymaking, rather than from a
gathering where millions of money had been staked, and where,
perchance, some of them had sold their honor for a mess of
pottage.
The charter powers bestowed upon some of these commercial
corporations is enormous, rivalling those conferred upon courts of
law. Thus, the charter of the Chicago Board of Trade contains the
following provision:
Section 7, after providing for the appointment of a “Committee of
Reference and Arbitration,” and a “Committee on Appeals,” and
fixing their jurisdiction, further provides that “the acting chairman of
either of said committees, when sitting as arbitrators, may
administer oaths to the parties and witnesses, and issue subpœnas
and attachments compelling the attendance of witnesses, the same
as justices of the peace, and in like manner directed to any
constable to execute.”
OPERATORS EXCITED.
A “DEAL” BEING SETTLED.

Section 8 contains provisions of an equally extraordinary character.


It reads as follows: “Whenever any submission shall have been
made, in writing, and a final award shall have been rendered and no
appeal taken within the time fixed by the Rules or By-Laws, then, on
filing such award and submission with the Clerk of the Circuit Court,
an execution may issue upon such award, as if it were a judgment
rendered in the Circuit Court, and such award shall thenceforth have
the force and effect of such a judgment, and shall be entered upon
the judgment docket of said Court.”
The granting of such extra-judicial powers upon men who possess
no special aptitude for their exercise is, to say the least, an anomaly
in jurisprudence. That a court so constituted should naturally incline
to the enforcement of agreements which are, in their essence,
gambling contracts, is no more surprising than that juries of
unbiased men should set them aside, or that courts, whose aim is to
enforce the spirit as well as the letter of the law, should non-suit
plaintiffs seeking relief under their provisions. Over and over again
have courts and juries declined to regard a sale, the parties to which
did not contemplate a bona fide delivery in any other light than as a
bet or wager, the collection of which could not be legally enforced. It
is a serious question whether an act clothing a loosely organized—if
not self-constituted—tribunal with the powers of the highest court of
original jurisdiction in a great commonwealth, is not a blot upon the
judicial system of the State which sanctions it.
In what has been said, however, the author intends to draw no
invidious distinction between the commercial exchanges of the
country. As a rule, they occupy the same plane; and in respect of
being a blessing or a curse to the country at large, they must stand
or fall together. At the same time, the Board of Trade of the Western
metropolis has seen fit to take a position which is, to say the least,
somewhat anomalous. In the preamble to its “Rules and By-Laws” it
declares that among its objects are: “to inculcate principles of justice
and equity in trade * * * *” and “to acquire and disseminate
valuable commercial and economic information.”
As regards the “principles of justice and equity in trade” which are
“inculcated” by commercial exchanges generally, nothing more need
be said. Were the transactions on their floors confined to actual
sales at prices influenced only by legitimate means and natural
causes, there can be little doubt that they would prove potent
factors in the furtherance of commerce and advancements of its best
interests. It is not in this aspect that the author is considering them.
His reprehension of their practices is predicated upon the other, and
broader, side of their character, i. e., their speculative side. It can
scarcely be called an open question whether it “inculcates principles
of justice and equity in trade” for one man to buy up all the wheat in
sight (and out of sight too, for that matter) and then force an
alleged buyer, but an actual rival whom he has done his best to
mislead, to settle with him at a price exceeding by 100 to 150 per
cent. the actual value of the commodity.
But it is the “object” last mentioned—the “dissemination of
valuable commercial and economic information”—concerning which
the exchange in question has taken such a peculiar position.
Originally, the “information” at its command, whether “valuable” or
otherwise, was “disseminated” with the automatic regularity of clock
work. Whether this dissemination was undertaken for the benefit of
the public at large, or from motives purely selfish is immaterial in
this connection, although the “object” may be, perhaps, inferred
from the course of the directors. It was found that places far less
pretentious were being opened and were doing a thriving business.
Within the shadow of the great tower sprang up an “Open Board,”
which attracted speculators who might otherwise have conducted
their operations through the channels opened by the more august
body. Moreover “bucket shops” (the pernicious character of whose
methods will be explained hereafter) multiplied and flourished. The
quotations of the regular exchange were as the “vital air” to the
smaller concerns. “Withdraw our quotations,” said the directors, “and
all competition will come to naught.” A wrangle ensued, followed by
litigation in the courts, resulting in the triumph of the more
renowned body, the “genuine, old, original Jacobs.” In other words,
the “dissemination of valuable commercial and economic
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like