510 likes | 522 Views
Explore the development process of programming languages, from binary to high-level 4GLs, and the role of software tools. Learn about machine independence, SDLC phases, and the impact of OOP. Discover how executable code is created from human-readable syntax in modern languages.
E N D
Chapter 10 Application Development
Chapter Goals • Describe the application development process and the role of methodologies, models and tools • Compare and contrast programming language generations • Explain the function and operation of program translation software, including assemblers, compilers and interpreters • Describe link editing and contrast static and dynamic linking • Describe integrated application development software, including programmer’s work-benches and CASE tools
Software Development • Process of translating user needs into CPU instructions • This is a complex process that requires significant effort and resources • Software is the most costly component of IS
SDLC Phases • Systems requirement model – provides the detail needed to develop a specific system to meet user needs • Design model – provides an architectural blueprint for system implementation
Programming languages • Language used to instruct a computer to perform a task • Programming language development has tried to • Make the language easier to understand • Develop a language that takes less time (requires fewer instructions) to complete a task
Programming languages cont. • Variety of programming languages • Link to Google programming languages page • http://directory.google.com/Top/Computers/Programming/Languages/
Development of languages • First Generation – binary CPU instructions • First programmers wrote code as sequences binary digits • Tedious and error prone • As software grew in complexity this became unpractical
Languages cont. • Second generation language – assembly languages (simple machine) • Mnemonic represents CPU instruction • Mnemonic can also represent location in memory (variable) • Mnemonic can also represent a program instruction memory address (label)
Assembler • Code from 2GL (Assembly code) is translated into binary instructions by Assembler • Translates each mnemonic into its corresponding binary digit sequence • Programmer still required to write one assembly instruction per CPU instruction • 2GL is for a specific CPU (i.e. processor)
Machine independence • Programs written in 2GL (assembler) only work for a specific CPU • Companies spend a long time developing custom systems • These systems continue to evolve over time • New modules added • Systems updated and maintained over time
Machine independence cont. • When company buys a new computer (i.e. new CPU) what happens to the old software? • Still a problem, still a lot of mainframe systems running (COBOL) due to difficulty of porting to a new computer
3G languages • 3GLs address the issue of machine independence • Code is standardized (ANSI, etc.) • Special software called a compiler takes standard code and translates it to a specific CPU • Each CPU needs to have its own version of the compiler
3GLs • FORTRAN, COBOL, BASIC,PL/1, Pascal and C • 3GL code is translated (compiled) into assembly code, then into binary code • First languages to exploit machine independence – 3GL code is the same regardless of the CPU that executes it
Languages cont. • Third generation language – allows programmers to specify many CPU instructions per program instruction or statement • This one-to-many (1:N) relationship is called instruction explosion
Instruction explosion • One line of code – Cobol, Pascal, C – are translated into many lines of CPU instructions • Makes programmer more productive • CPU code is more efficient • Compiler (software that generates CPU instructions) can optimize CPU instructions
4GLs • Addressed the following limitations of 3GL • Higher instruction explosion • Ability to develop GUI • Ability to interact with database • Most 4GL were proprietary packages • VB and SQL are still in use
Object Oriented Languages • OOP is an attempt to address problems of software maintenance and re-use • Data and programs are viewed as integrated parts called objects • Objects communicate using methods • Client – server model • Prominent examples: C++, Java
Language standardization • American National Standards Institute (ANSI) and International Standards Organization (ISO) set standards for programming languages (C, C++, COBOL) • Advantage: guarantee portability between platforms, promotes machine independence • Disadvantage: slow to improve and develop
Creating executable code • Modern programming languages use a syntax more suited to human understanding • Computer requires instructions made out of 0s and 1s
Creating .exes cont. • Software applications have become quite complex • Hundreds if not thousands of programmers contribute part of the solution • Solutions are designed to be re-usable
Producing an .exe • Individual programmer’s work needs to be translated into machine code • Translate the source code of an individual file into 0s and 1s • All the work of many programmers needs to be packaged together • Collect and bundle different parts of binary code into a single load module
IDE • Integrated development environment is a software development tool that brings together software tools to facilitate: • Translating higher order languages into 0s and 1s (binary code) • Managing and combining libraries of existing programming solutions
Steps in development process • Programmer produces a program in a specific language • Program is called source code • Code is made up of • Data declarations • Statements • Function calls (using pre-written library routines)
Steps cont. • Source code (as produced by programmer) becomes input into compiler • Compiler tests each line of code comparing it to syntax requirements of specific language • If errors exist, produces an error report • After “clean compile” compiler produces object code (assembly instructions)
Output of compile step • Symbol table – list of variable names associated with a memory location • Assembler instructions – mnemonic for CPU instructions
Steps cont. • Object file (output of compile step) becomes input into next step – link editor • Link editor combines object file with code from software libraries • Output of link step is .exe file
Example in C++ • Example program showing compile link and exe output • Go to Visual C++
Link Editor • Modern programming languages allow programmers to use pre-existing routines in their code • Using a function is referred to as a function call • A link editor searches object code (the output of the compile step) for references to external library function calls • When an external function call is found, the link editor searches for the corresponding executable code that implements the function
Benefits of a link editor • Allows a project to be developed among different files (i.e. each programmer develops a separate file) • A single executable program can be constructed from multiple object code files compiled at different times • A single compiler can generate executable programs that run under multiple operating systems
Dynamic vs. static binding • Dynamic Linking – linking is performed during program loading or executionexample: DLLs and Visual Basic, Java • Static Linking – library and other subroutines cannot be changed once they are inserted into the executable codeexample: C++ program
Dynamic vs. static linking Dynamic Linking Advantages • Smaller application program files • Flexibility Static Linking Advantages • Execution speed • Improved reliability and predictability of executable programs
Interpreters • Reads a single source code instruction, translates it into CPU instructions or a DLL call • Advantage: flexibility to incorporate new or updated code into an application program • Disadvantage: increased memory and CPU requirements during program execution
Visual Basic • Is an interpreted language • See VB example
Java language • OOL developed by Sun • Originated as operating system for interactive TVs • Applied to demands of producing code for a distributed computing environment (i.e. the Web)
Java web resources • Java web site http://java.sun.com/ • Java software http://java.sun.com/java2/ • Java documentation http://developer.java.sun.com/developer/infodocs/?frontpage-main • Java tutorials http://java.sun.com/docs/books/tutorial/ • Java applet examples http://javaboutique.internet.com/javasource.html
Development for the Web • What are the requirements for an application development tool designed to produce applications for a distributed computing environment?
Requirements • Seamless multi-platform capability • Built in security & protection capabilities • Multi-threaded, i.e. easily break a problem into independent sections run concurrently • How does Java address these requirements?
Java Requirements • Multi-platform • Java virtual machine • Built in security • Security restrictions for applets • Multi-threaded • Built-in thread class in standard library
Java example • Run java example with java console
Microsoft’s Answer • .Net framework • Supports 20 different programming languages • Supports distributed networked applications (see presentation)