Table Of ContentDeveloping Business Applications
with OpenStepTM
Springer Science+Business Media, LLC
Nik Gervae Peter Clark
Developing
Business Applications
with OpenStep™
With 37 Illustrations
~..,~, Springer
Library of Congress Cataloging-in-Publication Data
Gervae, Nik.
Developing business applications with OpenStep / Nik Gervae, Peter
Clark.
p. cm.
Inc1udes bibliographical references and index.
ISBN 978-0-387-94852-2 ISBN 978-1-4612-1852-4 (eBook)
DOI 10.1007/978-1-4612-1852-4
1. Application software-Development. 2. OpenStep 3. BusineS&
Data processing. 1. Clark, Peter. II. Title.
QA76.76.A65G46 1996
()()5.2~c20 96-32683
Printed on acid-free paper.
@ 1997 Springer Science+Business Media New York
Originally published by Springer-Verlag New York, Inc. 1997
Ali rights reserved. This work may not be translated or copied in whole or in part without the
written permission of the publisher <Springer-Verlag New York, Inc., 175 Fifth Avenue, New York,
NY 10010, USA), except for brief excerpts in connection with reviews or scholarly analysis. Use
in connection with any form of information storage and retrieval, electronic adaptation, com
puter software, or by similar or dissimilar methodology now known or hereafter developed is
forbidden.
The use of general descriptive names, trade names, trademarks, etc., in this publication, even jf
the former are not especially identified, is not to be taken as a sign that such names, as
understood by the Trade Marks and Merchandise Marks Act, may accordingly be used freely by
anyone.
Production managed by Frank Ganz; manufacturing supervised by Johanna Tschebull.
Photocomposed pages from the authors' FrameMaker files.
Printed and bound by R.R. Donnelley & Sons, Harrisonburg, VA.
Printed in the United States of America.
987654321
Contents
.
Foreword
• • • • • • • • • • • Xl
...
Preface..
• • • • • • • • • • XlU
..
Acknowledgments and Disclaimers .
•••• XVll
Part One: OpenStep
Chapter 1:WhatIs OpenStep? 3
The OpenStep Specification . . . . . . . . . . 4
Components ofthe OpenStep Specification . . . 6
User and Development Environments. . . . . . . . .12
NeXT's OPENSTEP Release 4 for Windows NT .12
SunSoft's OpenStep 1.0 for Solaris. . . . .13
NeXT's OPENSTEP Release 4 for Mach. . . . . .14
Chapter 2: The Object Model. . . . . . . . . . . . . . . . .15
Principles ofObject-Oriented Programming. .15
Encapsulation. .16
Inheritance . . .17
Polymorphism .18
Dynamism . . .18
Basics ofthe Objective-C Language. .20
Objects and Messages. . . . . . .21
Implementing Objects: Classes and Protocols .22
Run-Time Features. .27
Class Objects. . . . . . . . . . . . . . . . . .27
v
VI DevelopingBusinessApplicatiomwith OpenStep
The Root Class . .28
Object Lifetime. .28
Archiving.... .30
Objective-C and c++. .31
MixingObjective-C and C++. .33
Chapter3: The Foundation Framework. . . • • • • . • • • .35
The Classes. . . . . . . . . . . . .37
Core Run-Time Classes. . . . . . . . . . . . . . .37
Value and Collection Classes. . . . . . . . . . . .44,
Classes for Distributed Objects and Concurrency .48
Process Environment Classes. . . . . . . . . . . .50
Chapter4: TheApplication Kit. . • • . . . • • • . . • • • .53
Preliminaries . . . . . . . . . . .54
CoreApplication Functionality. .55
Graphical Structure. . . . . .56
Driving theApplication . . .60
Standard User Interface Controls. .64
Other FunctionalAreas. .65
Text and Fonts. .65
DrawingAids. . .67
Printing. . . . . .68
System Services. .69
Chapter 5: NeXT's OPENSTEP forWindows NT . • • . • .73
The UserInterface . . . . .74
User System Programs . . .7'5
Background Programs ./'5
DemoApplications. . .i'6
The Development Environment .76
Project Builder . .:7
Interface Builder .81
OtherTools . . .82
Chapter 6: SunSoft's Solaris OpenStep 85
The User Interface . . .85
User System Programs 88
Contents VII
Workspace Manager .88
Mail . .89
Edit . .89
Terminal . .90
Preview.. .91
Preferences . .91
The Development Environment .91
Project Builder . .92
Interface Builder .96
HeaderViewer . .96
Chapter7: BuildinganApplication 99
PayPerView: The Design . . 100
Creating the Project . . . . . . 101
Buildingthe Interface. . . . . . 103
Laying Out the Window . . 104
Creating the Controller Objects . 107
Connecting Interface Objects. . 109
Fleshing Out the Classes . . . . . . 110
The ProgramController Class. . 111
The Program Class . . . . . . 114
The OrderController Class. . 115
Buildingand Debugging . . 118
NeXT'sWay. .118
SunSoft'sWay. . . . . 120
Part Two: Business Applications
Chapter 8: The CharacterofaBusinessApplication .... 125
The Business Environment. . . . . . . · 125
Data, Process, and Policy. . . . . . · 126
The Elements ofaBusinessApplication · 127
Databases . · 127
Business Components . . . · 128
Business Entities . . . . . . .128
Presentation ofInformation .129
Elements as Objects . .129
DevelopingBusinessApplicationswith OpenStep
Vlll
Component Objects .129
Business Objects . . .130
Presentation Objects .130
AUnifiedApproach to BusinessApplications .131
Chapter9: DistributedApplications . . . . . . . . . . . . 13.3
What Distributed Objects Does . . . .133
PayPerViewwith Distributed Objects .134
HowItWorks . . . . . . .137
Advertising an Object. . . . .137
Contacting the Server. . . . .139
Remote Message Processing · 14:2
Transferring Dataand Objects. · 146
Handling Failures. . . . . . .148
Other Distribution Models. . . .149
Microsoft OLEAutomation .149
OMG's CORBA . · 15:2
Where Distributed Objects Falls Short . .153
Limitations in the Distribution Mechanism .154
Absent and Incomplete Services .154
MissingTook . . . . . . . . · 155
Design with Distributed Objects . .156
Performance . .157
Reliability. . . . .158
Concurrency . . · 159
Interoperability. · 160
Perspective . . . . . · 161
Chapter 10: DatabaseApplications 163
What the Enterprise Objects Framework Does. . 16Ll
What's an Enterprise Object? . . . . 165
Model-View-Controller Revisited . . 16<l
Specific Features . . . . . . . . . . . 16?
PayPerViewwith Enterprise Objects. . . 168
Defining the Relational-to-Object Mapping . . 16~)
Revising the User Interface and Code. . 174
Changes to ExistingCode . 180
How ItWorks . . . . . . . . . . . . . . . 181
Contents IX
TheAccess Layer . . .182
The Control Layer . .188
The Interface Layer. .194
Perspective . . . . . . . .196
Chapter 11:WorldWideWeb Applications 197
What WebObjects Does . . 199
The Pans ofa Page. . . . . . 199
Reusable Components . . . .200
Session State Management . .201
ASample Page Definition . . . . 202
How ItWorks. . . . . . . . . .204
The Request-Response Loop. .205
Following Hello World. .206
Perspective . . . . . . . . . . . . . 207
Part Three: Development Topics
Chapter 12: DevelopmentTopics . . . 211
Chapter 13: Project Management
and the Development Life Cycle. . . . . . . . . . . . . 213
Building Business Models. . .216
Constructing the Model . .216
Verifying the Model . . . .218
Choosing aMethodology. .219
Rapid Prototyping . . . . . .220
Iterative Development . . . .222
Schedulingand Milestones . .224
DefiningMilestones . .225
Revising the Schedule.. .227
The BenefitsofReuse.. .228
Chapter 14: Portability . . . . . . . . . . . . . . . . . . . 231
Guaranteed Portable . . . .232
Guaranteed Nonportable . .232
Gray Areas . . . . . . . . .233
x DevelopingBusinessApplicationswithOpenStep
System-Neutral Libraries and Tools .234
Additions to OpenStep . .234
Noncode Resources. . . . . . . . . .235
Chapter 15: Testingand Debugging .••••••.•••• 237
Debugging in OpenStep . . 238
Common ProblemAreas . . .23~)
Reference Counts. . . . .239
Run-Loop Asynchrony . .240
Noncode Logic: Nib Files and Models . .240
Exceptions . . . . . . 241
WeakTyping. . . . .242
Distributed Objects. . 243
Chapter 16: Performance •.••••.....••..••• 245
Measuring Performance .245
Improving Performance . . . . . . . . .246
TuningAlgorithms. . . . . . . . . . 247
Reducing Memoryand DiskUsage. .24~'
ManagingAutoreleased Objects . 248
Loading Resources on Demand. .248
Using C++ and Standard C. . . .249
UsingThreads and Distribution .249
Overriding Reference-Count Methods. .250
OverridingObjective-C Dynamism .250
Appendices
AppendixA: PayPerViewSource • •• 255
Appendix B: PayPerViewwith Distributed Objects. • • • •265
Appendix C: PayPerViewwith Enterprise Objects •• 271
Suggested Reading. · .. 281
Index . · •. 283