e-Business & e-Commerce How to Program Preface



Welcome to the exciting world of e-business and e-commerce. This book is by an old guy and two young guys. The old guy (HMD; Massachusetts Institute of Technology 1967) hasbeen programming and/or teaching programming for 40 years. The two young guys (PJD;MIT 1991 and TRN; MIT 1992) have each been programming and/or teaching programming for 19 years. The old guy programs and teaches from experience; the young guys do so from an inexhaustible reserve of energy. The old guy wants clarity; the young guys want performance. The old guy seeks elegance and beauty; the young guys want results. We got together to produce a book we hope you will find informative, challenging and entertaining.
E-business and e-commerce are evolving rapidly, if not explosively. This creates tremendous challenges for us as authors, for our publisher—Prentice Hall, for instructors, and
for students and professional people.
Why We Wrote e-Business and e-Commerce: How to Program Dr. Harvey M. Deitel taught introductory programming courses in universities for 20 years with an emphasis on developing clearly written, well-designed programs. Much of what is taught in these courses is the basic principles of programming with an emphasis on the effective use of data types, control structures, arrays and functionalization. Our experience has been that students handle the material in this book in about the same manner as they handle it in introductory Pascal or C courses. There is one noticeable difference though: students are highly motivated by the fact that they are learning three leading-edge scripting languages (JavaScript, VBScript and Perl) and a leading-edge programming paradigm (object-based programming) that will be immediately useful to them as they leave the university environment and head into a world of e-business and e-commerce in which the Internet and the World Wide Web have a massive new prominence.
Our goal was clear: produce a textbook for introductory university-level courses in programming and business for students with little or no programming experience, yet offer the depth and the rigorous treatment of theory and practice demanded by traditional, upper level programming and business courses in order to satisfy professionals’ needs. To meet this goal, we produced a comprehensive book that patiently teaches the concepts behind a successful e-business as well as the principles of control structures, object-based programming and various markup languages (HTML, Dynamic HTML and XML) and scripting languages (JavaScript, VBScript and Perl). After mastering the material in this book, students will be well prepared to take advantage of the Internet and the Web as they take upper-level courses and venture into the rapidly changing business world.
e-Business and e-Commerce How to Program is the seventh book in the Deitel/Prentice Hall How to Program series. It is distinguished by its focus on Web-based application development (emphasized in our server-side treatment) and using it to create effective online businesses.
We have emphasized color throughout the book. The World Wide Web is a colorful, multimedia-intensive medium. It appeals to our visual and audio senses. Someday it may even appeal to our senses of touch, taste and smell as well! We suggested to our publisher,Prentice Hall, that they should publish this book in color. The use of color in this book is crucial to understanding and appreciating scores of the book’s programs. From the start, the Web has been a color-intensive medium. We hope it helps you develop more appealing Web-based applications.
Many books about the Web concentrate on developing attractive Web pages. We certainly discuss that subject intensely. But more important, the key focus of this book is really Web-based applications development focussed on building e-businesses. Our audiences want to build real-world, industrial-strength, Web-based e-businesses. These audiences care about good looking Web pages. But they also care about client/server systems, databases, distributed computing, etc. In the world of business, success depends on both marketing and reliability.
Many books about the Web are reference manuals with exhaustive listings of features.
That is not our style. We concentrate on creating real applications. We provide the live-code
examples on the CD accompanying this book so that you can run the applications and see and hear for yourself the multimedia outputs. One of the most exciting features of this text is an introduction to Macromedia’s Flash—a cutting-edge multimedia technology for developing
Web-based applications. It allows the user to develop interactive animated movies at a fraction
of the size of traditional media file types. A Flash movie can be embedded into a Web site or run as a stand-alone program. You will learn how to make Flash movies with sound and interactive features that can be incorporated into your e-business Web sites.
The Web is an artist’s paradise. Your creativity is your only limitation, but the Web contains
so many tools and mechanisms to leverage your abilities that even if you are not artistically
inclined, you can still create stunning outputs. Our goal is to help you master these tools and mechanisms so that you can maximize your creativity and development capabilities. We are excited about the enormous range of possibilities the Internet and the Web offer. We performed extensive research for this book and located hundreds of Internet and Web resources (which we provide as live links on the CD-ROM that accompanies this book) to help you learn about building e-businesses. These links include general information, tutorials and demonstrations. Many of the demos are fun to try such as the E*TRADE investing game in which you can win cash prizes for participating in the demo. The resources also point you to lots of free stuff on the Internet.
This book is appropriate for students and professional people who wish to start their own e-businesses. Many of the Internet and Web resources we include point you to turnkey solutions (some for a fee and some free) for creating e-businesses. You will also be able to use the programming technologies presented here to create e-businesses yourself (you will also need to connect with a bank and use an industrial-strength database system). Please read the tour of the book in Chapter 1 to familiarize yourself with the technologies we present for building real e-business and e-commerce applications.
We have worked hard to create hundreds of useful live-code examples to help you master Internet and Web programming quickly and effectively. All of the code examples are on the accompanying disk and are available for free download from our Web sites:
www.deitel.com
www.prenhall.com/deitel
We cover in depth Microsoft’s Dynamic HTML as a means of adding “dynamic content” to World-Wide-Web pages. Instead of creating Web pages with only text and static graphics, we use Dynamic HTML to make Web pages “come alive” with audios, videos, animations, interactivity and three-dimensional imaging. Dynamic HTML’s features are precisely what businesses and organizations need to meet today’s information processing requirements.

e-Business & e-Commerce How to Program Preface


Teaching Approach

E-Business and e-Commerce How to Program contains a rich collection of examples, exercises, and projects drawn from many fields to provide the student with a chance to solve interesting real-world problems. The book concentrates on the principles of good software engineering and stresses program clarity. We avoid arcane terminology and syntax specifications in favor of teaching by example. The book is written by educators who spend most of their time writing about, and teaching, edge-of-the-practice programming topics in industry

classrooms worldwide for Deitel & Associates, Inc. The text emphasizes good pedagogy.

Live-Code Teaching Approach

The book is loaded with hundreds of live-code examples. This is the focus of the way we teach and write about programming, and the focus of each of our multimedia Cyber Classrooms as well. Each new concept is presented in the context of a complete, working program immediately followed by one or more windows showing the program’s input/output dialog. We call this style of teaching and writing our live-code approach. We use programming languages to teach programming languages. Reading these programs is much like entering

and running them on a computer.

E-Business and e-Commerce How to Program first explains cutting-edge technologies and business models that are changing the way commerce is conducted, then shows how to create e-business Web sites starting with HTML programming, then rapidly proceeding toprogramming in JavaScript, Microsoft’s Dynamic HTML, VBScript, Perl and XML. Students really want to “cut to the chase.” There is great stuff to be done in all these languages, so let’s get right to it! Web programming is not trivial by any means, but it’s fun and students can see immediate results. Students can get graphical, animated, multimedia-based, audio intensive,database-intensive, network-based programs running quickly through “reusable components.” They can implement impressive projects. They can be much more creative and productive in a one- or two-semester course than is possible in introductory courses taught in conventional programming languages such as C, C++, and even Visual Basic or Java.

World Wide Web Access

All of the code for e-Business and e-Commerce How to Program (and our other publications) is on the Internet free for download at the Deitel & Associates, Inc. Web site www.deitel.com.

Please download all the code then run each program as you read the text. Make changes to the code examples and immediately see the effects of those changes. It’s a great way to learn programming. [Note: You must respect the fact that this is copyrighted material. Feel free to use it as you study, but you may not republish any portion of it in any form without explicit permission from Prentice Hall and the authors.]

Objectives

Each chapter begins with a statement of Objectives. This tells students what to expect and gives them an opportunity, after reading the chapter, to determine if they have met these objectives. It is a confidence builder and a source of positive reinforcement.

Quotations

The learning objectives are followed by quotations. Some are humorous, some are philosophical, and some offer interesting insights. Our students enjoy relating the quotations to the chapter material. Many of the quotations are worth a “second look” after you read each chapter.

Outline

The chapter Outline helps students approach the material in top-down fashion. This, too, helps students anticipate what is to come and set a comfortable and effective learning pace.

14120 Lines of Code in 258 Example Web Pages (with Program Outputs)

We present features in the context of complete, working Web pages. This is the focus of our teaching and our writing. We call it our “live-code” approach. Each Web document is followed by the outputs produced when the document is rendered in a Web browser (We use Microsoft’s Internet Explorer 5) and its scripts are executed. This enables students to confirm that the Web pages are rendered as expected. Reading the book carefully is much like entering and running these programs on a computer. The programs range from just a few lines of code to substantial examples with several hundred lines of code. Students should download all the code for the book from our Web site, and run each program while studying that program in the text. The Web documents are available on the CD accompanying this book and at www.deitel.com..

554 Illustrations/Figures

An abundance of charts, line drawings and program outputs is included. The discussion of control structures, for example, features carefully drawn flowcharts. [Note: We do not teach flowcharting as a program development tool, but we do use a brief, flowchart-oriented presentation to specify the precise operation of JavaScript’s control structures.]

355 Programming Tips

We have included programming tips to help students focus on important aspects of program development. We highlight hundreds of these tips in the form of Good Programming Practices,Common Programming Errors, Testing and Debugging Tips, Performance Tips,Portability Tips, Software Engineering Observations and Look-and-Feel Observations.

These tips and practices represent the best we have gleaned from a total of almost eight decades of programming and teaching experience. One of our students—a mathematics major—told us that she feels this approach is like the highlighting of axioms, theorems and corollaries in mathematics books; it provides a foundation on which to build good software.

\ 83 Good Programming Practices

Good Programming Practices are highlighted in the text. They call the students attention to techniques that help produce better programs. When we teach introductory courses to nonprogrammers ,we state that the “buzzword” of each course is “clarity,” and we tell the students that we will highlight (in these Good Programming Practices) techniques for writing programs that are clearer, more understandable and more maintainable.

95 Common Programming Errors

Students learning a language—especially in their first programming course—tend to make certain kinds of errors frequently. Focusing on these Common Programming Errors helps students avoid making the same errors. It also helps reduce long lines outside instructors’offices during office hours!

28 Performance Tips

In our experience, teaching students to write clear and understandable programs is by far the most important goal for a first programming course. But students want to write the programs that run the fastest, use the least memory, require the smallest number of keystrokes, or dazzle in other nifty ways. Students really care about performance. They want to know what they can do to “turbo charge” their programs. So we have include Performance Tips

to highlight opportunities for improving program performance.

23 Portability Tips

Software development is a complex and expensive activity. Organizations that develop software must often produce versions customized to a variety of computers and operating systems.

So there is a strong emphasis today on portability, i.e., on producing software that will run on a variety of computer systems with few, if any, changes. Achieving portability requires careful and cautious design. There are many pitfalls. We include numerous Portability Tips to help students write portable code.

79 Software Engineering Observations

The Software Engineering Observations highlight techniques, architectural issues and designissues, etc. that affect the architecture and construction of software systems, especially large-scale systems. Much of what the student learns here will be useful in upper-level courses and in industry as the student begins to work with large, complex real-world systems.

29 Testing and Debugging Tips

This “tip type” may be misnamed. When we first decided to incorporate Testing and Debugging Tips, we thought these tips would be suggestions for testing programs to expose bugs and suggestions for removing those bugs. In fact, most of these tips tend to be observations about capabilities and features that prevent bugs from getting into programs in the first place.

18 Look-and-Feel Observations

We provide Look-and-Feel Observations to highlight graphical user interface (GUI) conventions.These observations help students design their own graphical user interfaces to conform with industry norms.

Summary (1420 Summary bullets)

Each chapter ends with additional pedagogical devices. We present a thorough, bullet-liststyle Summary of the chapter. On average, there are 42 summary bullets per chapter. This helps the students review and reinforce key concepts.

Terminology (2751 Terms)

We include in a Terminology section an alphabetized list of the important terms defined in the chapter—again, further reinforcement. On average, there are 81 terms per chapter.

607 Self-Review Exercises and Answers (Count Includes Separate Parts)

Extensive self-review exercises and answers are included for self-study. This gives the student a chance to build confidence with the material and prepare for the regular exercises. Students should attempt all the self-review exercises and check their answers.

658 Exercises (Solutions in Instructor’s Manual; Count Includes Separate Parts)

Each chapter concludes with a substantial set of exercises including simple recall of important terminology and concepts; writing individual statements; writing small portions of Web pages and scripts; writing complete Web pages and Web-based e-businesses; and writing major term projects. The large number of exercises across a wide variety of areas enables instructors to tailor their courses to the unique needs of their audiences and to vary

course assignments each semester. Instructors can use these exercises to form homework assignments, short quizzes and major examinations. The solutions for most of the exercises are included in the Instructor’s Manual and on the disks available only to instructors through their Prentice-Hall representatives. [NOTE: Please do not write to us requesting the instructor’s manual. Distribution of this publication is strictly limited to college professors teaching from the book. Instructors may obtain the solutions manual only from their regular Prentice Hall representatives. We regret that we cannot provide the solutions to professionals.] Solutions to approximately half of the exercises are included on the e-Business and e-Commerce Programming Multimedia Cyber Classroom CD

(available in bookstores and computer stores; please see the last few pages of this book orvisit our Web site at www.deitel.com for ordering instructions).

Approximately 6000 Index Entries (with approximately 8100 Page References)

We have included an extensive Index at the back of the book. This helps the student find any term or concept by keyword. The Index is useful to people reading the book for the first time and is especially useful to practicing programmers who use the book as a reference.

The terms in the Terminology sections generally appear in the Index (along with many more index items from each chapter). Students can use the Index in conjunction with the Terminology sections to be sure they have covered the key material of each chapter.

“Double Indexing” of All Live-Code Examples and Exercises

e-Business and e-Commerce How to Program has 258 live-code examples and 658 exercises (including parts). Many of the exercises are challenging problems or projects requiring substantial effort. We have “double indexed” each of the live-code examples and most of the more challenging projects. For every source-code program in the book, we took the figure caption and indexed it both alphabetically and as a subindex item under “Examples.”

This makes it easier to find examples using particular features. The more substantial exercises are indexed both alphabetically and as subindex items under “Exercises.”

Bibliography

An extensive bibliography of books, articles and online documentation is included to encourage

further reading.