Presentation is loading. Please wait.

Presentation is loading. Please wait.

Behind the Scenes: Building Applications

Similar presentations


Presentation on theme: "Behind the Scenes: Building Applications"— Presentation transcript:

1 Behind the Scenes: Building Applications
Technology in Action Chapter 10 Behind the Scenes: Building Applications In this behind-the-scenes chapter, we explore the stages of program development and survey the most popular programming languages. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

2 Information Systems System An information system includes
A collection of pieces working together to achieve a common goal An information system includes Data—electronic, paper forms, graphics People Procedures Hardware/software System development life cycle (SDLC) An organized process (or set of steps) used to develop systems in an orderly fashion Generally speaking, a system is a collection of pieces working together to achieve a common goal. An information system includes data, people, procedures, hardware, and software. You interact with information systems all the time, whether you are at a grocery store, bank, or restaurant. In any of these instances, the parts of the system work together toward a similar goal. Because teams of individuals are required to develop such systems, an organized process (or set of steps) needs to be followed to ensure that development proceeds in an orderly fashion. This set of steps is usually referred to as the system development life cycle (SDLC). Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

3 System Development Life Cycle
There are six steps in the SDLC. This system is sometimes referred to as a “waterfall” system because each step is dependent on the previous step being completed first. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

4 Problem/Opportunity Identification
All steps involve IS and user persons The existing system is evaluated. Problems are defined. New proposals are reviewed. Decisions are made to proceed with the projects. The process is documented. Relevant problems/opportunities are defined. In the Problem/Opportunity Identification phase, problems or opportunities are defined. Whether solving an existing problem or responding to an opportunity, corporations usually generate more ideas for systems than they have the time and money to implement. Large corporations typically form a steering committee to evaluate system development proposals and decide which projects to take forward. They then document the process, and relevant problems or opportunities are defined. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

5 Analysis A program specification (goals and objectives of the project) is developed. A feasibility assessment is performed. User requirements are defined. Analysts recommend a plan of action. Consultations required to answer new questions that arise. User signs off for approval of plan. In the Analysis phase, analysts explore the problem to be solved and develop a program specification. The program specification is a clear statement of the goals and objectives of the project at hand. It is also at this stage that the first feasibility assessment is performed. The feasibility assessment determines whether the project should go forward by looking at the needs and resources available and determining whether the project can be completed at all. Assuming the project is feasible, the analysis team studies the current system (if there is one) and defines the user requirements of the proposed system. Finally, the analysts recommend a solution or plan of action, and the process moves to the Design phase. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

6 Design A detailed plan for programmers is developed.
Flowcharts or pseudo-code and data-flow diagrams are used for the current and proposed logic of the system. More questions arise. Flowchart Data-flow diagram In the Design phase of the SDLC, a detailed plan for programmers to follow is developed. The current and proposed systems are documented using flowcharts and data-flow diagrams. Data-flow diagrams trace all data in an information system from the point at which data enters the system to the point of its final resting place (storage or output). Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

7 Development and Documentation
Actual programming takes place that follows the flowchart or pseudo-code logic. More questions arise. First phase of the program development life cycle (PDLC). Development is documented. User documentation is created. In the Development and Documentation phase, the actual programming takes place. This phase is also the first part of the program development life cycle (PDLC). The development is documented. User documentation is created. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

8 Testing and Installation
Program is tested for proper operation and fixed as necessary. Program is installed for use. Testing and results are documented. The next step in the SDLC is testing the program to ensure that it works properly and installing the program so that it can be used. Testing and results are documented. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

9 Maintenance and Evaluation
Performance of the system is monitored. Corrections and modifications to the program are made. Maintenance procedures and results are documented. User training manuals produced. Once the system is installed, its performance must be monitored to determine whether it is still meeting the needs of end users. Bugs that were not detected in the testing phase and that users discover subsequently must be corrected. Additional enhancements that users request are evaluated so that appropriate program modifications can be made. The procedures and results are documented. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

10 Joint Application Development (JAD)
Helps designers adapt to changes in program specifications Schedules are adjusted Includes customer involvement No communication delays Also referred to as: Accelerated Design Facilitated Team Technique In each phase of the software development life cycle, a style of interaction named joint application development (JAD) is useful in creating successful, flexible results. JAD is popular because it helps designers adapt quickly to changes in program specifications. In JAD, the customer is involved in the project very closely, right from the beginning. Slow communication and lengthy feedback time is one reason the traditional development process is so time consuming. In JAD “workshops,” there are no communication delays. Workshops usually include end users, developers, subject experts, observers (such as senior management), and a facilitator. The facilitator enforces the rules of the meeting to make sure all voices are heard and agreement is reached as quickly as possible. Also called Accelerated Design or Facilitated Team Technique, the goal of JAD is to improve design quality by fostering clear communication. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

11 The Life Cycle of a Program
Programming is the process of translating a task into a series of commands a computer will use to perform that task. Programming involves Identifying the parts of a task the computer can perform Describing tasks in a specific and complete manner Translating the tasks into a language understood by the computer’s CPU Programming is the process of translating a task into a series of commands a computer will use to perform that task. It involves -Identifying which parts of a task a computer can perform -Describing those tasks in a very specific and complete manner -Translating this description into the language spoken by the computer’s CPU. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

12 Program Development Life Cycle
Just as an information system has a development life cycle, each programming project follows a number of stages from conception to final deployment--sometimes referred to as the program development life cycle (PDLC). Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

13 Step 1: Describing the Problem
The problem statement is: The starting point of programming A description of tasks the program is to accomplish A description of how the program will execute the tasks Created through interaction between the programmer and the user The program statement includes error handling, a testing plan, and output values. First, programmers must develop a complete description of the problem. The problem statement is the starting point of programming work. It is a very clear description of what tasks the computer program must accomplish and how the program will execute these tasks and respond to unusual situations. Programmers develop problem statements so that they can better understand the goals of their programming efforts. In the problem statement, programmers also must describe what the program should do if the input data is nonsense (users do make mistakes). This part of the problem statement is referred to as error handling. The problem statement also includes a testing plan that lists specific input numbers the program would typically expect the user to enter. The problem statement then lists the precise output values that a perfect program will return for those input values. Later, in a testing process, programmers use the input and output data values from the testing plan to determine whether the program they’ve created works in the way it should. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

14 Parking Garage Example
PROGRAM GOAL: To compute the total pay for a fixed number of hours worked at a parking garage. INPUTS: Number of Hours Worked a positive number OUTPUTS: Total Pay Earned a positive number PROCESS: The Total Pay Earned is computed as $7.32 per hour for the first eight hours worked each day. Any hours worked beyond the first eight are billed at $11.73 per hour. ERROR HANDLING: The input Number of Hours Worked must be a positive real number. If it is a negative number or other nonacceptable character, the program will force the user to reenter the information. TESTING PLAN: INPUT OUTPUT NOTES 8 8*7.32 Testing positive input 3 3*7.32 12 8* *11.73 Testing overtime input –6 Error message/ask user to reenter value Handling error Most computer users understand what jobs (or problems) they want to computerize but not the details of the programming process. Therefore, the goal in creating a useful problem statement is to have programmers interact with users to describe three things relevant to creating a useful program: 1. The input that will be entered. This is the data users will have at the start of the job. 2. The output that the program will produce. This is the information users require at the end of the job. 3. The exact processing that converts these inputs to outputs. Programmers must determine how to transform the input into the correct output. In this table, we see a well-written program description. From here, the programmer can start to write code that satisfies the plan. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

15 Step 2: Developing an Algorithm
Algorithm development A set of specific, sequential steps that describe what the program must do Complex algorithms include decision points Binary (yes/no) Loop (repeating actions) Visual tools used to track algorithm and decision points Once programmers understand exactly what the program must do and have finalized the problem statement, they can begin developing a detailed algorithm, a set of specific, sequential steps that describe in natural language exactly what the computer program must do to complete its task Complex algorithms include decision points, or points at which the program must choose from different actions based on the value of its current inputs. Two main types of decisions change the flow of an algorithm. One decision point is a “fork in the road,” or branch. Such decision points are called binary decisions because they can be answered in one of only two ways: as yes (true) or no (false). The result of the decision determines which of the branch paths the algorithm will follow. A second decision structure that often appears in algorithms is a repeating loop. In a loop, a question is asked, and if the answer is yes, a set of actions is performed. Once the set of actions has been performed, the question is asked again (creating a loop). As long as the answer to the question is yes, the algorithm will continue to loop around and repeat the set of actions. Control structures is the general term used for keywords in a programming language that allow the programmer to control, or redirect, the flow of the program based on a decision. Programmers have a number of visual tools at their disposal to help them document the decision points and flow of their algorithms, including flowcharts and pseudocode. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

16 Flowchart and Pseudocode
Bold terms show actions that are common in programming, such as reading data, making decisions, printing, and so on. 1. Ask the user how many hours they worked today 2. If the number of hours worked < = 8, compute total pay without overtime otherwise, compute total pay with overtime pay 3. Print total pay Flowcharts provide a visual representation of the patterns an algorithm follows. Specific shape symbols indicate program behaviors and decision types. For example, diamonds indicate that a binary decision and branching action will be performed, and rectangles indicate a program instruction. Pseudocode is a text-based manner of documenting an algorithm. In pseudocode, words describe the actions that the algorithm will take. Pseudocode is organized like an outline, with differing levels of indentation to indicate the flow of actions within the program. Underlined words are information items that appear repeatedly in the algorithm. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

17 Top-Down Design Problem is divided into a series of high-level tasks
Detailed subtasks are created from high-level tasks Top-down design is a systematic approach in which a problem is broken down into a series of high-level tasks. In top-down design, programmers apply the same strategy repeatedly, breaking down each task into successively more detailed subtasks. They continue until they have a sequence of steps that are close to the types of commands allowed by the programming language they will use for coding. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

18 Object-Oriented Analysis
Classes (categories of inputs) are identified. Classes are defined by information (data) and actions (methods or behaviors). Reusability is key. With object-oriented analysis, programmers first identify all of the categories of inputs that are part of the problem the program is trying to solve. These categories are called classes. Classes are further defined by information (data) and actions (methods or behaviors) associated with the class. Programmers may need to create several different examples of a class. Each of these is an object. An important aspect of object-oriented design is that it leads to reusability. Because object-oriented design generates a family of classes for each project, programmers can easily reuse existing classes from other projects, enabling them to produce new code quickly. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

19 Step 3: Coding Coding is translating an algorithm into a programming language Generations of programming languages Once programmers create an algorithm, they select the best programming language for the problem and then translate the algorithm into that language. Translating an algorithm into a programming language is called coding. A programming language is a kind of “code” for the set of instructions the CPU knows how to perform. Computer programming languages use special words and strict rules to enable programmers to control the CPU without having to know all of the details of its hardware. Programming languages are readable to humans but then are translated into patterns of 1s and 0s to be understood by the CPU. Programming languages are classified in several major groupings, sometimes referred to as generations. With each generation in language development, programmers have been relieved of more of the burden of keeping track of what the hardware requires. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

20 Compilation Compilation is the process of converting code into machine language. Converting program called a Compiler. The compiler reads the source code and translates it into machine language. After compilation, programmers have an executable program, usually saved on the hard drive. Compilation is the process by which code is converted into machine language, the language the CPU can understand. The compiler is the program that understands both the syntax of the programming language and the exact structure of the CPU and its machine language. It can “read” the source code—the instructions programmers have written in the higher-level language—and translate the source code directly into machine language—the binary patterns that will execute commands on the CPU. At this stage, programmers finally have produced an executable program, the binary sequence that instructs the CPU to run their code. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

21 Interpreter The interpreter translates source code into a line-by-line intermediate form. Each line is executed before the next line is interpreted. Programmers do not have to wait for the entire program to be recompiled each time they make a change. Programmers can immediately see the results of changes as they are making them in the code. Requires less memory than compiling. Allows for platform independence. An interpreter translates the source code into an intermediate form, line by line. Each line is then executed as it is translated. The compilation process takes longer than the interpretation process because in compilation, all of the lines of source code are translated into machine language before any lines are executed. The finished compiled program runs faster than an interpreted program because the interpreter is constantly translating and executing as it goes. Programmers can immediately see the results of their program changes as they are making them in the code. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

22 Coding Tools: Integrated Development Environments
Editor: Special tool that helps programmers as they enter the code Debugging: Removal of errors in code Syntax error: Mistake in use of the language Logic error (runtime error): Mistake in the algorithm—you get wrong results Compiler products feature an integrated development environment (IDE), a developmental tool that helps programmers write, compile, and test their programs. Syntax errors are violations of the strict, precise set of rules that define a programming language. Runtime errors can happen in many ways. It is easy for programmers to accidentally write code for a loop that loops one time too many or one time too few. It is also easy for programmers to forget to update a variable (an input or output item) or to put instructions in the wrong place. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

23 Step 4: Debugging Running a program to find errors is known as debugging. Sample inputs are used to determine runtime (logic) errors. Debugger: Tool that helps programmers locate runtime errors The process of running the program over and over to find errors and to make sure the program behaves in the way it should is called debugging. Errors in problem logic are caught only when the program executes and so are referred to as runtime (or logic) errors. A tool called a debugger helps programmers dissect a program as it runs to locate runtime errors. The debugger pauses the program as it is running and allows programmers to examine the values of all the variables. The programmers can then run the program in slow motion, moving it forward just one line at a time. They can then isolate the exact place in which a runtime error has occurred, correct the error, and recompile the program. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

24 Step 5: Finishing the Project
Users test the program (internal testing) Beta version released Information collected about errors before final revision Software updates (service packs) Problems found after commercial release Documentation created User manuals User training sessions Once debugging has detected all of the runtime errors in the code, it is time for users to test the program. This process is called internal testing. In internal testing, a group within the software company makes sure the program behaves as described in the testing plan. Any differences in how the program responds are reported back to the programming team, which makes the final revisions and updates to the code. Before its commercial release, software is often provided at a reduced cost or no cost in beta version to test sites or interested users. By providing users with a beta version of software, programmers can collect information about the remaining errors in the code and make revisions before commercially releasing the program. Often, users discover problems in the program after its commercial release. These problems are addressed with the publication of software updates or service packs. Users can download these software modules to repair errors identified in the program code. At this point, technical writers are responsible for creating documentation for the program, including user manuals and user training materials. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

25 Programming Languages
Selecting the right language Space available Speed required Organizational resources available Type of target application C# ASP / JSP PYTHON Phyton Visual Basic Many top programmers can work in a number of languages. Different projects have different requirements and different languages work better than others for a particular program. Four major considerations come into play when choosing which language to use. Space available. How much RAM and how many registers are in the CPU? Some languages use a lot more space than others. Speed required. Some languages produce faster machine code than others. Resources available. The existing pool of programmers must be proficient in the language chosen. Target application. Certain languages are customized for particular user environments. PHP C / C++ Java Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

26 Windows Applications: Visual Basic 2008
Used to build Windows applications Object-oriented language Visual Basic 2008 is the current version Prototypes for Windows applications are often coded in Microsoft Visual Basic (VB) 2008, a powerful programming language used to build a wide range of Windows applications. Visual Basic is an object-oriented language that gives the programmer powerful tools to develop useful applications that run in Windows. The latest version, Visual Basic 2008, has added features that utilize the Internet easily in programs. Visual Basic Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

27 C and C++ C C++ Sample C Developed for system programmers at Bell Labs
Combines high- and low-level programming features Modern operating systems are written in C C++ Uses the same features as C Includes object-oriented design Sample C Sample C++ C was developed originally for system programmers. It provides higher-level programming language features (such as if statements and for loops) but still allows programmers to manipulate the system memory and CPU registers directly. This mix of high- and low-level access makes C very attractive to “power” programmers. Most modern operating systems (including Windows XP, Mac OS X, and Linux) are written in C. C++ uses all of the same symbols and keywords as C, but extends the language with additional keywords, better security, and more support for the reuse of existing code through object-oriented design. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

28 Java Created for Internet programming at Sun Micro
Object-oriented features Large set of existing classes Architecture neutral Java applets: Small Java-based programs Java’s object-oriented model enables Java programmers to benefit from its large set of existing classes. An attractive feature of Java is that it is architecture neutral. This means that Java code needs to be compiled only once, and it can run on many CPUs. The Java program does not care what CPU, OS, or user interface is running on the machine where it lands. This is possible because the target computer runs a Java Virtual Machine (VM), software that can explain to the Java program how to function on any specific system. There is a Java VM installed with Microsoft Internet Explorer, for example, that allows Internet Explorer to execute any Java applets (small Java-based programs) it encounters on the Internet. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

29 Web Applications HTML/XHTML Extensible Markup Language (XML)
Hypertext Markup Language/Extensible Extensible means you can add commands Hypertext Markup Language Not a true programming language Uses special symbols (tags) to control how Web pages are viewed Extensible Markup Language (XML) Enables computers to efficiently transfer information between Web sites HTML/XHTML is not a programming language. Rather, HTML/XHTML is a series of tags that modify the display of text. HTML was the original standard defining these tags. XHTML is a newer standard that corrects some of the problems found in HTML. Extensible Markup Language (XML) expands the tag atmosphere of HTML to enable computers to transfer information between Web sites. It allows programmers to write their own customized tags that expand the capability of the browser environment. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

30 Web Applications Scripting languages: Languages limited to performing a specific set of specialized tasks JavaScript Used to make Web pages more visually appealing and interactive VBScript Subset of VB used to add interactivity to Web pages PHP Another scripting language gaining in popularity—dynamic, graphics Dynamic decision making Web page can display content based on user choices Scripting languages are simple programming languages that are limited to performing a specific set of specialized tasks. JavaScript is a programming language often used to add interactivity to Web pages. JavaScript is not as full-featured as Java, but its syntax, keywords, data types, and operators are a subset of Java’s. VBScript is a subset of Visual Basic and is also used to introduce interactivity to a Web page. PHP is a Web scripting language that is growing in popularity. Dynamic decision making means that the page can decide how to display itself, based on the choices the user makes as the page is read. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

31 Web Applications Active Server Pages (ASP) and Java Server Pages (JSP)
Add interactivity capabilities to Web pages Translate user information into a request for more information from a company’s computer Flash Enables elaborate animations to be created for Web pages XML—extensible markup language Enables designers to define their own data-based tags To build Web sites with interactive capabilities, programmers use Active Server Pages (ASP), Java Server Pages (JSP), or the scripting language PHP (Hypertext Preprocessor) to adapt the HTML/XHTML page to the user’s selections. Flash is used to develop sophisticated Web animations. It has its own programming language, called ActionScript. When Web sites communicate with humans, HTML/XHTML works well because the formatting it controls is important. When computers want to communicate with each other, however, all these qualities just interfere. Extensible Markup Language (XML) enables designers to define their own data-based tags, making it much easier for a Web site to transfer the key information on its page to another site. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

32 Adobe Flash and Microsoft SilverLight
Used to develop Web-based multimedia Includes its own scripting language, ActionScript SilverLight Supports development of multimedia and interactive Web applications Adobe Flash is a software product used for developing Web-based multimedia. Flash includes its own programming language, named ActionScript, which is very similar to JavaScript in its selection of keywords, operators, and classes. Microsoft SilverLight supports the development of rich multimedia and interactive Web applications. Other advances, such as the collection of technologies referred to as AJAX, allow the development of Web applications that can create an interaction between a browser and a server without requiring a user to click on a link. This gives users a much more responsive experience. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

33 The Next Great Language
Large projects may take 30 minutes to compile Interpreted languages may become more important Python--interactive Ruby--interactive Smalltalk It is never easy to predict which language will become the next “great” language, but software experts predict that as software projects continue to grow in size, the amount of time needed to compile a completed project will also grow. It is not uncommon for a large project to require 30 minutes or more to recompile. Interpreted languages, however, have virtually zero compile time because compilation occurs while the code is being edited. As projects get larger, this capability for instantaneous compilation will become even more important. Thus, interpreted languages such as Python, Ruby, and Smalltalk could become more important in the coming years. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall

34 Blender (Freeware) Video game development tool Open source
Built-in game engine Built-in physics engine Uses logic bricks to simplify programming Blender is a free, open source application that supports home video game production by collecting a number of tools into one package. Working just in Blender, you have what you need for each of the various stages of beginning 3D video game development: creating three-dimensional objects with textures and then moving them around a 3D world with realistic physics. Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall


Download ppt "Behind the Scenes: Building Applications"

Similar presentations


Ads by Google