Home > Store

Object-Oriented Introduction to Computer Science Using Eiffel, An

Register your product to gain access to bonus material or receive a coupon.

Object-Oriented Introduction to Computer Science Using Eiffel, An

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

  • Supported by a friendly, consistent, and relatively easy-to-learn object oriented language—Eiffel.
  • Entirely different approach to learning computer science by introducing the idea of "modeling" first, and then "programming" as only one part of the overall process.
  • Covers Booch methods early in the book.

Description

  • Copyright 1997
  • Dimensions: 7" x 9-1/4"
  • Pages: 408
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-183872-5
  • ISBN-13: 978-0-13-183872-7

Eiffel, one of three object-oriented programming languages after C++ and Smalltalk, is user-friendly, consistent, and relatively easy to learn. In this book, Eiffel is used to introduce the basic principles of computer science from an object-oriented perspective. KEY TOPICS: Introduces the idea of "modeling" first, and then "programming" as only one part of the overall process; details the object-oriented approach to problem solving; covers the construction of Eiffel classes; explains polymorphism as a design principle. MARKET: For software development professionals new to object technology and Eiffel.

Sample Content

Table of Contents



1. Programming and Software.

1.1 Computer science. 1.2 Computer programs. 1.3 Programming languages. 1.4 Structured and object-oriented programming. 1.5 Common software tools. 1.6 Programming. 1.6.1 Programming languages. 1.7 Goals of this book. 1.8 Exercises.



2. An Object-Oriented Approach to Problem Solving.

2.1 Object, objects everywhere. 2.1.1 Ordinary objects. 2.1.2 Objects as abstractions. 2.2 The object model. 2.2.1 An object model example. 2.2.2 The noun-verb and noun-noun metaphors. 2.2.3 Internal state. 2.2.4 Object scenarios and messages. 2.2.5 Parameters. 2.3 Relationships among objects. 2.3.1 Inheritance. 2.3.1.1 Classification. 2.3.2 Aggregation. 2.3.3 Uses relationship. 2.4 Abstract data type. 2.5 Producers and consumers. 2.6 Object modeling. 2.6.1 Analysis. 2.6.1.1 Aggregation relationship. 2.6.1.2 Uses relationship. 2.6.1.3 Inheritance relationship. 2.6.2 Analysis of an elevator. 2.6.3 Design. 2.7 Summary. 2.8 Exercises. 2.9 References.



3. The Basic Elements of Eiffel Programs.

3.1 Programming. 3.2 The Eiffel Language. 3.3 Creating and destroying objects. 3.4 Basic types, default values, and assignment. 3.5 Ordinary or reference type objects. 3.6 Copying objects. 3.7 Cloning. 3.8 Basic operators with examples. 3.9 Branching. 3.10 Iteration (loop). 3.11 Routines. 3.12 Arrays. 3.13 Strings. 3.14 Basic input and output. 3.15 Mathematical routines and “number crunching.” 3.16 Files and secondary storage. 3.17 Summary. 3.18 Exercises.



4. Algorithms.

4.1 Introduction. 4.2 Problems versus their instances. 4.3 A taste of algorithms-some simple examples. 4.3.1 Algorithms for finding smallest and largest array values. 4.3.2 Simple sorting algorithm. 4.4 The efficiency of algorithms. 4.5 Computing faster. 4.5.1 Illustrative example- subvector problem for arrays. 4.6 Some more sorting. 4.6.1 Bubble-sort. 4.6.2 Gap-sort-a magic number and a fast variant of bubble-sort. 4.6.3 Insertion-sort. 4.7 Hard problems. 4.7.1 Traveling salesperson problem. 4.7.2 Knapsack problem. 4.8 Concluding remarks. 4.9 Summary. 4.10 Exercises. 4.11 References.



5. Building Some Simple Eiffel Systems.

5.1 Dice. 5.1.1 Random number generators. 5.1.2 Implementation of die class. 5.2 Constant attributes. 5.3 A horse race using unusual dice. 5.3.1 Analysis and design of horse race game. 5.3.2 A four-way race. 5.4 Summary. 5.5 Exercises. 5.6 References.



6. The Construction of Eiffel Classes.

6.1 An overview of the components of an Eiffel class. 6.2 Creation. 6.2.1 Subclass creation. 6.2.2 More advanced subclass creation. 6.3 Inheritance. 6.3.1 Extension-subtypes. 6.3.2 Specialization-the redefine subclause. 6.3.3 Selective export-the export subclause. 6.3.4 Renaming inherited routines-the rename subclause. 6.3.5 The select subclause. 6.4 Abstract classes using Eiffel's deferred class facility. 6.5 Storage versus computation: attributes versus routines. 6.6 Protecting and documenting routines-assertions and programming by contract. 6.6.1 Account classes revisited with assertions. 6.6.2 Propagation of assertions through inheritance. 6.7 Summary. 6.8 Exercises.



7. Constructing Classes for Reuse-Generic Container Classes.

7.1 Stack. 7.1.1 Static implementation of stack. 7.1.2 Dynamic implementation. 7.2 Unordered list with duplicates not allowed. 7.2.1 Interface to UNORDERED_LIST class. 7.2.2 Implementation of class UNORDERED_LIST. 7.2.3 Discussion of implementation. 7.2.3.1 The data model. 7.2.3.2 Internal routine find. 7.2.3.3 Public routine item_before. 7.2.3.4 Public routine insert_front. 7.2.3.5 Public routine insert_back. 7.2.3.6 Public routine insert_before. 7.2.3.7 Public routine remove. 7.2.3.8 Public routines remove_front and remove_back. 7.2.3.9 Public routines remove_after and remove_before. 7.2.3.10 Public routine reverse_sequence. 7.3 Unordered list with duplicates allowed. 7.4 The stack revisited. 7.5 The queue. 7.6 Summary. 7.7 Exercises. 7.8 References.



8. Recursion as a Design Principle.

8.1 The mechanics of recursion. 8.2 Relationship between recursion and iteration. 8.3 Recursion used in design. 8.3.1 Binary search of sorted arrays. 8.3.2 Quicksort-an efficient recursive sorting algorithm. 8.3.3 Binary search tree. 8.4 One final and more advanced but important application of recursion-depth-first search of a graph and airline connection problem. 8.5 Some parting comments about recursion. 8.6 Summary. 8.7 Exercises.



9. Polymorphism as a Design Principle.

9.1 Late-binding and polymorphism. 9.2 A case study that features polymorphism. 9.2.1 Specifications. 9.2.2 The analysis and design. 9.2.3 Implementation details. 9.2.4 Output. 9.3 Version 2-improved design and implementation. 9.3.1 Revised implementation. 9.4 Summary. 9.5 Exercises.



Appendix 1.

Interface to String Class.



Appendix 2.

Interface to Class PLAIN_TEXT_FILE.



Appendix 3.

Class RANDOM_NUMBER.

Preface

There is a strong need for a CS 1 book that from the very beginning presents the basic principles of computer science from an object-oriented perspective and is supported by a friendly, consistent, and relatively easy to learn object-oriented programming language. An object-oriented perspective represents a further evolution in the trend to emphasize abstractions in computer problem solving and the use of abstract data types in particular in early computer science courses.

This book is aimed at the beginning computer science student enrolled in a rigorous computer science curriculum. It is also aimed at practicing software development professionals new to the object paradigm who wish a gentle introduction to many features of the Eiffel language and the object paradigm.

This book presents the basic ideas of object modeling from the very beginning. Before a student learns to "program," he or she should be introduced to modeling. It is important that the beginning student as well as practicing software development professionals view programming as only part of the intellectual process associated with software development and computer science. Booch class and object scenario diagrams are introduced early as a means of providing notational support and more importantly support for the notion of object modeling.

The object-oriented perspective is quite distinct from the older traditional approach of having students learn the rudiments of programming from the bottom up. That is, first learn about scalar types, variables, assignment operations, branch and loop program control structures, and much later the concept of functional abstraction. Although in recent years functions have been introduced earlier in some CS 1 books, it is often the case that they are first introduced in the middle of the book.

Using an object-oriented perspective, functions and the underlying data model that they are manipulating are introduced from the very beginning. The class is introduced early as a frame from which to introduce and implement simple algorithms and provide a model for objects.

Some computer science departments have been moving towards C or C++ to support CS 1. This author believes that this is a grave mistake. Although both of these languages are commercially important and widely used outside of the university, which probably accounts for their adoption as a CS 1 language, they are poor candidates to support CS 1. Both languages are complex, are relatively hard to read, provide relatively little safety to the beginning programmer, and are relatively inconsistent (particularly C++). They both require the student to take a fairly low-level systems view quite early. It therefore becomes quite challenging for the beginning student to master low-level details and at the same time develop a high-level vision and sensitivity concerning the safe construction of software systems. The Eiffel language is much better suited for this task.

Eiffel is quite readable, friendly, and consistent. The dangerous artifact of pointers is totally missing.

Memory management is handled automatically. Eiffel's assertion handling mechanism provides an opportunity to emphasize safe and defensive programming. Its clean and simple syntax and semantics for handling generic components, late-binding, and inheritance allow a student to focus on the fundamental concepts of software construction and algorithm design without having to become distracted with the myriad of complex language details required, for example, if one uses C++.

Chapter 1 provides a short historical perspective related to computation and computers.

Chapter 2 introduces the concept of objects and object modeling. Objects as abstractions of reality are presented. The noun-verb metaphor, the notion of state, object scenarios and messages, classification, inheritance, aggregation and the uses relationship are introduced. An introduction to object-oriented programming is provided through a simple example. Some of the Booch analysis and design notation and the concepts behind the notation are introduced.

Chapter 3 introduces the reader to the world of programming using Eiffel. The basic elements of an Eiffel software system are presented. These include creating and destroying objects, basic types, reference versus value semantics, object assignment, object copying, object cloning, branching, iteration, and the construction of routines. In addition the use of basic Eiffel libraries is introduced.

Chapter 4 focuses on the design of algorithms. A graduated set of problems of increasing complexity are used to illustrate the rudiments of algorithm design and develop sensitivity to algorithm complexity.

Chapter 5 presents the reader with some first examples of complete Eiffel software systems. A preview is provided concerning the use of inheritance, late-binding, and assertions. A pair of ordinary dice are simulated. Then a pair of unusual non-standard dice are constructed using inheritance. A race horse game to be played by a person against the computer is built that uses the non-standard dice. Finally, a counterfeit coin weighing game is created that allows a person to play with the assistance of the computer.

Chapter 6, "The Construction of Eiffel Classes," presents more detail related to the various sections of an Eiffel class and their use. Object creation, routine redefinition and renaming, and export scope are among the topics covered. The important facility of assertion handling is presented in this chapter.

Chapter 7 discusses the issue of building reusable container classes. Several classic container classes are presented including STACK, QUEUE, UNORDERED_LIST, ORDERED_LIST, DEQUE, and SET. The BIT data type is introduced and used as part of the implementation of SET.

Chapter 8 introduces recursion as a design technique. First the mechanics of recursion are presented. The relationship between recursion and iteration is discussed and illustrated. Several smaller examples that illustrate recursive designs are presented including binary search of an array and quicksort. The chapter ends with an intermediate sized example involving a depth-first search of a graph. The reader is introduced to the flavor of more advanced algorithm design, an important foundation subject in computer science.

Chapter 9 presents polymorphism and late-binding as a design principle. After illustrating the principle with a simple and somewhat sterile example, an initial and improved version involving the analysis, design, and implementation of a complete software system are presented. Booch class and object scenario diagrams are used to support the analysis and design.

Acknowledgments

I would first like to thank Paul Becker, publisher at Prentice Hall, for his support and encouragement from this project's inception to its completion.

I am in debt to several outstanding reviewers who have provided extremely useful and constructive criticism of the first-draft manuscript.

Jim McKim of the Hartford Graduate Center, friend, Eiffel mentor, and outstanding critic, has examined every line of code in this manuscript and has made many useful suggestions. As before, Jim, my simple words of thanks are really not enough to thank you for your efforts way above and beyond the call of duty. The entire Eiffel community owes you many thanks for the continuing contributions that you are making.

Brian Henderson Seller, from the University of Technology in Sydney, has provided many helpful comments, particularly regarding the sections of the book dealing with object modeling.

Meilir Page Jones, President of Wayland Systems, has provided tremendous help in his critical but extremely constructive review of the manuscript. His many annotations in the first-draft manuscript have provided significant help in improving the book.

I am particularly appreciative of the timely help provided by Jim, Brian, and Meilir because I know how busy they are. Thank you all for finding the time to fit this manuscript review into your busy schedules.

I thank Margaret Reek for looking at a near final version of the manuscript and providing useful and constructive comments.

I wish to thank Interactive Software Engineering in Santa Barbara for continuing to provide me with their latest Eiffel software. It is my hope that the Professional Version of Eiffel for MSDOS/Windows will make this elegant language much more accessible to students and professionals alike.

I wish to thank Bertrand Meyer, the original designer and implementor of Eiffel, for his encouragement and support.

I also wish to thank Rock Howard and Madison Cloutier and everyone at Tower Technology for their technical support, tremendous encouragement and latest Eiffel products. Their outstanding contributions to the Eiffel community are noteworthy.

With great love and appreciation, I thank my wife Hanne for her help, constructive criticism, and continual encouragement.

Richard Wiener

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020