To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
How to read class diagrams drawn in other modeling notations.
How and when to use use-case diagrams, sequence diagrams, state diagrams, process models, data models, collaboration diagrams, and interface-flow diagrams.
This book is an extension of The Object Primer and in this chapter we'll extend our knowledge of object-oriented analysis-and-design techniques. This chapter is perfect for people who wish to gain a broad understanding of the analysis-and-design options that are open to them when developing a system.
There's more to object-oriented (OO) development than CRC (Class Responsibility Collaborator) models, use cases, and class diagrams. Although all three techniques are useful, they don't give you the whole picture. In this chapter we'll see several types of diagrams that help to fill in the blanks: use-case diagrams, sequence diagrams, state diagrams, interface-flow diagrams, data models, collaboration diagrams, and process diagrams. We're also going to compare the Ambler notation with other leading notations to help you understand the class diagrams that you see in other OO development books.
The Importance of Bubbles and Lines
Management is constantly talking about deliverables. These are usually, but not always, physical by-products of your development effort. Although the ultimate deliverable should be a fully functioning application that has been successfully installed and accepted by the user, interim deliverables often include project plans, analysis documents, design documents, test plans, and so on.
Here is a great example of a column I wish I'd never written. It presents a new control structure to deal with the complexity of the Composite/Wrapper pattern used in the user interface code in Visual Works. I wrote the column, sent it off, then had a quick talk with David Liebs about the subject. “So you need to talk to a particular wrapper, eh? Why don't you keep a pointer to the wrapper you need to talk to and give it a useful name? Then you can just send it messages.” Duh…
The other aspect of the column I regret is that it seems to condone adding new control structures to Smalltalk. The meta facilities of Smalltalk are extremely powerful, but 99.99 percent of the time, you shouldn't use them. Oh, they'd get the job done alright, but at what cost?
When you write something like #wrapperSend:, you have to take off your application-programmer hat and put on your language-designer hat. The responsibilities of the language designer are ten times as great as those of an application developer. Whatever you do, you have to implement it and test it, sure, but you also have to document it like a new language feature, extend the programming environment to handle it smoothly, and worst of all, maintain it through all future releases of the image.
In this paper we present the SMAR CAD-robotics system (Système de Modélisation et d'Animation de Robots), which we developed at the University of Poitiers. This system allows its user to deal with a great number of robotics problems through the use of a graphic simulator. We will discuss the different parts which form the SMAR system. This includes the following:
—The modeler which allows the user to build a database, describing the robot and its environment. The database generated by the system is composed of the geometric description of the objects and the kinematics description of the environment.
—The simulator and the coordinates reverser, which simulate the robot's movements.
—The collision detection algorithms used to verify task accomplishment.
—A calculation algorithm in order to find optimal placement, which determines the relative position robot/task, allowing the robot to efficiently execute the assigned task.
—The collision free-path planning algorithm allowing the system to generate trajectories in a cluttered environment.
An example dealing with a complex robotized cell will also be presented in order to demonstrate the capabilities of the system.
Okay, back to tilting at windmills. Sometimes I think people just don't get Smalltalk. Why in the world would you want a grungy old explicit case statement when you have a superior substitute in the polymorphic message? How could you read and write Smalltalk code for enough years to be able to implement new language features and not understand that you didn't need them?
I guess my tights and cape aren't far enough at the back of the closet…
This month's topic is case statements: practical necessity or pernicious contaminant? My interest in the topic comes from several areas at once. SmalltalkAgents has added a form of case statement to their Smalltalk for the Macintosh. CompuServe has hosted a lively discussion of isKindOf: and its relatives. Finally, net news has had a discussion of case statements. What's the deal?
Cutting right to the punch line, I think case statements are an inappropriate holdover from procedural thinking. While vital in procedural languages, their use in object programs is obviated by the much more powerful mechanism of the polymorphic message send. Anytime you find yourself wishing for or using a case statement, you have an opportunity to take advantage of objects instead. The noncase version will yield a more maintainable, more flexible, more readable, and faster solution.
As with the previous column, this column has a strong confessional flavor. I like using my mistakes for columns, because I'm sure there is something to learn there.
The meat of the column is good stuff—refactoring and adding stuff becomes easy. I can't imagine how many times and ways I have said this in the last ten years. This is one of my better attempts, because it doesn't just say it, it shows it. (See “Make it Run, Make it Right” for another example.)
When I started writing this, I felt like I was getting preachy. Maybe that's what's so good about demonstrating from my mistakes—I can't be preaching if I'm explaining how I screwed up.
The personal material up front shows that I was aware that my attention was wandering. I'm glad I kept it together enough to say something important here.
Is it my imagination, or are these columns getting harder to write? I think I know exactly what I want to say, but I've started writing three different times without getting anywhere. Maybe this third time will work.
Simply put, here's what I want to say—the best programming style for Smalltalk is to have lots of little methods, and lots of little objects.
That's a pretty broad statement, broad enough that it can't possibly be true in all cases. What are the tradeoffs, the issues that affect programming style?
This is my abortive attempt to bring patterns to the masses. Dr. Dobbs (which I used to read as a Silicon Valley brat in the late '70s) called to ask for a pattern article. I thought, “Here is my chance to step outside the narrow confines of the object universe.”
Ha. Nobody got it. I'm sure I misjudged my audience, but I think there are more serious problems with the presentation here. Looking at the paper again, though, I'll be hanged if I can figure what. I'll take a shot at it, though.
One of the problems is certainly that I am talking about a different kind of pattern here than most people talk about. The patterns in the Design Patterns book, for example, show you how people use objects over and over. You can take the same approach to using a particular framework, however. People use MVC the same way over and over. You can write the things they do as patterns.
Part of the problem with the paper now that I look at it is that I got away from Ward's question, “What is the one thing you want the reader to take away?” This paper is all over the place. Another problem is that the paper isn't explicit about even those points that it does make. It tells a story (kinda), but it doesn't come out and say, “Communication is the problem.”
The ORCCAD programming environment for robotic systems gathers control laws in continuous time at the low levels and discrete time logical aspects at higher levels. Based upon a formal definition of robotic actions, complex applications can be designed, verified and generated incrementally. The approach and tools prototypes have been validated through several applications.
What features to look for in an object-oriented (OO) language.
We'll compare and contrast the leading OO development languages: C++, Smalltalk, Java, and ObjectCOBOL.
How to develop for the world of electronic commerce.
What other development tools you may need to successfully build OO applications.
In this chapter we will discuss what features to look for in an OO language, describing the main features of each of the leaders. We will also compare and contrast the languages as well as discuss how to build electronic commerce applications using OO development languages.
It wouldn't be right to have a book about OO development without covering the most common OO development languages. It needs to be pointed out, however, that this book isn't about OO programming, it's about OO development. Although I could easily write a book about each language covered in this chapter I'm not going to. The fact is that all I want to do is to give you a brief overview of what each language is like and what is typically used for, that's it. If you want more then I highly suggest that you pick up one or more of the books that I've listed in the references section at the end of this chapter.
I have started and stopped working on this book several times. Each time I began writing the introduction to a paper, I looked at it about half way through and said, “This seems awfully arrogant and self-centered. It's all about me, not about Smalltalk. Who wants to read about me?” I gave myself a good old-fashioned Puritan lecture about the virtues of self-effacement, and quit writing.
Recently I got Natalie Goldberg's second book about writing, Wild Mind. Her first book, Writing Down the Bones, was a collection of exercises for freeing the flow of ideas from mind to paper. I was reading Wild Mind sitting on a smooth teak bench in the Rose Garden of the Royal Botanical Gardens in Sydney. The yellowy autumn morning sun was baking the smell out of the roses. I read a comment another author made about the first book: “Why Natalie, this book should be very successful. When you are done with it, you know the author better. That's all a reader really wants, to know the author better. Even if it's a novel, they want to know the author.”
Creaking teak as I sat back. A flutter of wings as the gathered ibis around me took off. I blinked my eyes, hard. If a novel is about getting to know the author, and a book of writing exercises is about getting to know the author, then why shouldn't a book of Smalltalk essays be about getting to know the author?
This was my last column, and the one I'm proudest of. I have a habit of trying to take lessons from the world around me. If I see a tree leaning against another tree I say, “What is that like? Well, if one person leans on another too long, they both end up falling down.” I always kept these little stories to myself, though.
For my last column, I decided to break out. By now I was fully confident in my ability to describe a technical situation. I'd never tried to describe something from the real world in a publication before. This was my first attempt.
Looking at it now, it looks clumsy, but I still really like the underlying story. I've probably told the parable of the woodpile twenty times in the year since I wrote it.
In a way, this column represents the shift that I had been undergoing all along. I got completely away from technical stuff and completely into people stuff, and I did it in people-y, proto-literate way.
IT'S THE OBJECTS, STUPID
Sometimes it takes me a while to see the obvious. Sometimes even longer than that. Three or four times in the last month I've been confronted by problems I had a hard time solving. In each case, the answer became clear when I asked myself the simple question, “How can I make an object to solve this problem for me?” You think I'd have figured it out by now: got a problem? make an object for it.
The various trends and techniques in creating distributed applications.
How to distribute applications using client/server technology, taking both a two-tier and three-tier approach.
How to distribute the classes of your object-oriented application using traditional client/server approaches, object-oriented client/server (OOCS), and applets.
How to create applications using Common Object Request Broker Architecture (CORBA), a distributed object standard.
The architecture for application development is becoming more and more distributed. We're moving from the centralized mainframe approach popularized in the 1960s and 1970s through the client/server approach of the 1980s, into the distributed classes and distributed objects approaches of the 1990s. In this chapter we will compare and contrast these approaches, concentrating on object-oriented client/server design, a technique for distributing classes across a network of computers.
Over the past 15 years we have seen a general migration from highly centralized mainframe computers with dumb terminals to more and more decentralized information technologies. In Figure 5.1 we see how information technology is slowly evolving from mainframe technology to client/server technology to distributed classes and finally to distributed objects. In this chapter we will discuss the merits of all four of these technologies, concentrating on the reality of today and the near future: distributed classes and distributed objects.
Why your persistence strategy is important for successful application development.
What terminology is commonly used with respect to persistence.
How to map objects to flat files.
How to map objects to relational databases, concentrating on several critical topics: the impedance mismatch; mapping objects to tables; implementing object relationships; inheritance mapping strategies; and mapping success factors.
How to use object-oriented databases and object/relational databases as your persistence mechanism.
Persistence deals with the issue of how one ensures that the objects that he or she works with last, or persist, between invocations of object-oriented applications. In other words, persistence addresses one's strategy for saving objects to permanent storage. There are four common mechanisms used to store objects: flat files, relational databases, object-oriented databases, and object/relational databases. Although you may have heard that mapping objects into a relational database is a nightmare, and it can be if you make a mistake, we'll see in this chapter that using relational databases to store your objects is a very viable approach to persistence.
The vast majority of business objects must be persistent, or in other words they need to be saved to permanent storage so that you can work with them in the future. Fortunately or unfortunately depending on your point of view, we have several mechanisms that we can use to make our objects persistent: flat files, relational databases, object-oriented databases, and object/relational databases. We will cover each of these mechanisms in detail, discussing the issues for how to use them to make your objects persistent.
This was the column that generated the most interest and email for me, all of it positive. Other than that, there's not much to say, except “Get to work writing tests—yeah, you, the Smalltalk hacker.”
You can't argue with inspiration (or deadlines). I started to write the final column in the sequence about using patterns for design, but what came out was this. It describes some work I have been doing with a framework that takes the tedium out of writing tests. I'll get back to the pattern stuff in the next issue.
Smalltalk has suffered because it lacks a testing culture. This column describes a simple testing strategy and a framework to support it. The testing strategy and framework are not intended to be complete solutions, but, rather, are intended to be starting points from which industrial strength tools and procedures can be constructed.
The article is divided into four sections:
Philosophy. Describes the philosophy of writing and running tests embodied by the framework. Read this section for general background.
Framework. A literate program version of the testing framework. Read this for in-depth knowledge of how the framework operates.
Example. An example of using the testing framework to test part of the methods in Set.
Cookbook. A simple cookbook for writing your own tests.