Internet & : How to Program by Deitel and Deitel

Hardware / Software Trends and Programming (in Chapter 1)

1/19/2011 1

OBJECTIVES

. In this chapter you will learn about: – computing concepts. – the different types of programming languages. – the evolution of the Internet and the World Wide Web. – what Web 2.0 is and why it’s having such an impact among Internet-based and traditional businesses. – what Rich Internet Applications (RIAs) are and the key software technologies used to build RIAs.

2

Chapter 1 Sections

. 1.8 Personal, Distributed and Client/Server Computing . 1.9 Hardware Trends . 1.10 Key Software Trend: Object Technology . 1.11 JavaScript: Object-Based Scripting for the Web . 1.12 Browser Portability . 1131.13 C, C++ and Java . 1.14 BASIC, Visual Basic, Visual C++, C# and .NET . 1.15 Software Technologies . 1.16 Notes about Internet & World Wide Web How to Program, 4/e . 1.17 Web Resources

3

1 Personal, Distributed and Client/Server Computing . Personal Computing – 1977 Apple Computer popularized personal computing – computers became economical for personal or desktop business use – 1981 IBM PC . Distributed Comppguting – workstations could be linked together in computer networks (late 1980s) – Local area networks (LANs) . Client/Server Computing – servers offer data storage and other capabilities that may be used by client computers distributed throughout the network, – popular operating systems for C/S • UNIX, Linux, Mac OS X and Microsoft’s Windows

4

Hardware Trends

. Cost of products and services – consistently dropping over the decades . Computer capacity and speed – doubles every two years (on average) » Moore’s Law . Microprocessor chip – laid groundwork in late 197 0s and 1980s for productivity improvements of the 1990s – hardware moving toward mobile, wireless technology • hand-held devices more powerful than early supercomputers • portability • wireless data-transfer speeds

5

Key Software Trend: Object Technology . Objects – reusable software components that model items in the real world (classes) – makes software developers more productive – do not have to “reinvent the wheel” – object-oriented programs often easier to understand, correct and modify than older types of programs

6

2 Key Software Trend: Object Technology (cont.) . Packaging scheme that helps create meaningful software units – large and highly focused on particular applications areas . Before object technology, programming languages focused on actions (verbs) rather than on objects (nouns) – programmers programmed (wrote code) primarily with verbs – made programs awkward, hard to read – the real world is filled with complex objects and simple actions 7

Key Software Trend: Object Technology (cont.) . Object-oriented programming – programmers work in ways that complement how they see the world – more natural process – significant productivity enhancements . Procedural programming – code was not particularly reusable – forced programmers to constantly “reinvent the wheel” – waste of time and resources . Objects (classes) – software modules – kept in libraries (electronic) – reusable – save time and resources

8

Objects

. Have attributes – properties – characteristics – color,,,p,g size, shape, weight . Exhibit behaviors – operations – a ball rolls – a balloon deflates – a baby cries

9

3 Object Classification

. Observe object behaviors . Study object attributes . Group objects with similar attributes, behaviors . Compare objects

chimpanzees adult human

baby lizard

10

Object-Oriented Software Design

. OOD . Model software in terms similar to those used to describe real-world objects . Classes of objects have similar characteristics – cars, trucks, little red wagons, roller skates all have wheels – class convertible is a subclass of the class automobile

11

Objects Interact

. People objects send information to other people objects by talking . A bank account object send a message to another object that an account has a negative balance

12

4 OOD

. Encapsulates: ties together an object’s attributes and behaviors . Hides Information: The way properties or operations are implemented are hidden from a user of the object (a developer is a user of the object when she uses it in a section of code) . Interface: The means by which the object communicates with users of the object 13

Object-oriented vs. Procedural

. VB.NET is object-oriented . C is procedural . Object-oriented programming: Programming in an object-oriented language – fundamental unit is the class – a class has properties and methods . Procedural programming: action oriented programming where actions are defined by procedures . Fundamental unit is the function or procedure

14

Classes, Fields, Methods

. Class is a user-defined type – contains data • attributes, properties, fields – contains methods that manipulate data . Classes can be associated with other classes – relationships

15

5 Component

. Software . Group of related classes . Reusable – employ it in multiple applications

16

Object-oriented Analysis and Design Process . Requirements – what is the system supposed to do? . Specification – how will the system do what it’s supposed to do? . Pseudocode: informal textual description of program flow and logic – OK for small programs/systems . Systems analysis and design software

17

Unified Modeling Language

. UML . Most widely used graphical representation for modeling object-oriented systems . Ex tensibl e: can be en hance d w ith new features . Independent of OOAD process used . A feature-rich graphical language

18

6 Software Engineering Observations

Extensive class libraries of reusable software components are available on the Internet. Many of these libraries are free. Some organizations report that the key benefit object- oriented programming gives them is not software that is reusable but, rather, software that is more understandable, better organized and easier to maintain, modify and debug. This can be significant, because perhaps as much as 80 percent of software cost is associated not with the original efforts to develop the software, but with the continued evolution and maintenance of that software throughout its lifetime.

19

Software Engineering Observation

. Reuse of existing classes when building new classes and programs saves time, money and effort. Reuse also he lps programmers bu ild more reliable and effective systems, because existing classes and components often have gone through extensive testing, debugging and performance tuning.

20

JavaScript

. Offers object-based scripting for the Web . Attractive language for advancing one’s level of programming skill – object-based language – supports proper software engineering techniques – free for download – interppyppreter built into today’s most popular Web browsers – powerful scripting language • portable • programs execute interpretively on client machines when run through a browser – ActionScript and JavaScript are converging in the next version of the JavaScript standard (JavaScript 2/ECMA Script version 4) – universal client scripting language – simplifies web application development

21

7 What is Ecma?

. Ecma International is an industry association founded in 1961 and dedicated to the standardization of Information and Communication Technology (ICT) and Consumer Electronics (CE) . Prior to 1994 it was known as ECMA - European Computer Manufacturers Association . www.ecma-international.org/ . Microsoft instrumental in the standardization of JavaScript by ECMA 22

Ready or not …

Programming

23

Good Programming Practice

Write your programs in a simple and straightforward manner. This is sometimes referred to as KIS (“keep it simple”). One key aspect of keeping it simple is another interpretation of KIS — “keep it small.”

24

8 Portability Tips

It is easier to write portable programs in JavaScript than in many other programming languages. However, differences among interpreters and browsers make portability difficult to achieve. Simply writing programs in JavaScript does not guarantee portability. Research platform variations and write code accordingly. 25

Portability Tips

When writing JavaScript programs, you need to deal directly with cross- browser portability issues. Such issues are hidden by Java Scr ip t librar ies (e.g., Dojo, Prototype, Script.aculo.us and ASP.NET Ajax). These libraries provide powerful, ready-to-use capabilities that simplify JavaScript coding, making it cross-browser 26 compatible.

Error-Prevention Tips

Always test your JavaScript programs on all sys tems an d in a ll we b browsers for which they are intended.

27

9 Good Programming Practice

Read the documentation for the JSitiJavaScript version you are us iting to access JavaScript’s rich collection of features.

28

Error-Prevention Tips

Your computer and JavaScript interpreter are good teachers. If you are not sure how a feature works, even after studying the documentation, experiment and see what happens. Study each error or warning message and adjust the code accordingly.

29

Portability of Programs Across Browsers . A great challenge – much diversity of client browsers in use – many different platforms in use . Difficu lt to – know capabilities and features of all browsers and platforms in use – find correct mix between absolute portability, complexity and usability of features

30

10 Portability Tips

The web is populated with many different browsers, which makes it difficult for authors and web application developers to create universal solutions. The W3C is working toward the goal of a universal client-side platform.

31

Here we go …

Programming Languages

32

C, C++ and Java

. C – developed by Dennis Ritchie at Bell Laboratories – development language of the UNIX operating system – virtually all new major operating systems are written in C and/or C++ . C++ – developed by Bjarne Stroustrup in early 1980s – “spruce up” the C language – provide capabilities for object-oriented programming (OOP) . Java – developed by in 1991 – Sun saw the immediate potential of using Java to add dynamic content (e.g., interactivity, animations and the like) to web pages – Sun formally announced Java at an industry conference in May 1995 – Java is now used to • develop large-scale enterprise applications • enhance the functionality of web servers • provide applications for consumer devices

33

11 BASIC, Visual Basic, Visual C++, C# and .NET

. BASIC – developed in the mid-1960s at Dartmouth College – stands for Beginner’s All-Purpose Symbolic Instruction Code – primary purpose was to familiarize novices with programming techniques . Microsoft’s Visual Basic language – based on BASIC – added a development environment that facilitated GUI development – has become one of the most popular programming languages in the world . Microsoft’s .NET development platform – provides the capabilities developers need to create computer applications that can execute on computers distributed across the Internet • Visual Basic (based on the original BASIC) • Visual C++ (based on C++) 34 • Visual C# (based on C++ and Java)

Software Technologies

. Agile Software Development – set of methodologies that try to get software developed and implemented quickly – agile Alliance (www.agilealliance.org) – agile Manifesto (www.agilemanifesto.org) . RfRefact ori ng – reworking code to make it clearer and easier to maintain from a programmer perspective – does not alter the external behavior of the code, rather improves its internal structure . Design patterns – proven architectures for constructing flexible and maintainable object-oriented software – open source code 35

Software Technologies (cont.)

. Linux – open source operating system . Apache – most popular open source web server . MySQL – open source database management system . PHP – most popular open source server-side “scripting” language for developing Internet-based applications . LAMP – Linux, Apache, MySQL and PHP (or Perl or Python) . Game programming – software techniques used in game programming – Adobe, Flash, CS3 . Ruby on Rails – Combines the scripting language Ruby with the Rails web application framework – Developed by 37Signals . Software as a Service (SaaS) – software runs on servers elsewhere on the Internet • Salesforce.com, Google, Microsoft and 37Signals all offer SaaS

36

12 Microsoft’s .NET

. Embraces the Internet and WWW in the arena of software development . Language independent . WbWeb servi ces: ex tend s thidthe idea o f reusable software components to Internet application development

37

The .NET Framework and the CLR

. Framework: – manages and executes applications – manages and executes Web services – contains a class library – enforces security . Details of the Framework are in the Common Language Infrastructure (CLI) – CLI is ECMA Standard 335 compliant

38

.NET Languages

.NET programming languages . .NET framework can

APL Mondrian work with programs Visual C# Oberon written in many COBOL Oz Component Pascal Pascal languages

Curriculum Perl Eiffel Python Forth RPG Fortran Scheme Haskell Smalltalk Java Standard ML

JScript Visual Basic Mercury Visual C++

13 CLR

. CLR: Common Language Runtime – Executes .NET programs . .NET programs are compiled first into Microsoft Intermediate Language (MSIL) . MSIL de fines t he language un derstoo d by t he CLR . MSIL for an application is in the .exe file . When you run the .exe the CLR just-in-time compiler translates the MSIL into the machine language for a particular platform

40

Platform Independence

. Install the .NET Framework on the platform for which it’s created and any .NET application can be run without modification – regardless if the development language is Visual Basic, C++, Fortran, …

41

Internet & World Wide Web: How to Program by Deitel and Deitel

End of Slides for Chapter 01 Part 03

1/19/2011 42

14