Software structures

9
1 Software Structures Unit 06: Software Design and Development

Transcript of Software structures

Page 1: Software structures

1

Software Structures

Unit 06: Software Design and Development

Page 2: Software structures

22

Assignment 2

P5: Explain where software design and structures fit into the SDLC

M1: Explain the importance of creating program code which is of high quality. Describe how the code quality can be improved

D1: Discuss ways in which a programmer can make codes easier to read

Page 3: Software structures

33

Software Structures

The structure of a program depends on the type of language used

Procedural languages split the system into procedures and functions

Object-orientated (OO) languages are based on objects and classes

Programs are built from combining these techniques in various patterns and quantities

Page 4: Software structures

44

Basic StructuresSequence: Any collection of code statements that are performed one after the other

Selection: A decision or conditional statement whose result lets the program execute one set of code statements or another. These form the program’s logical pathways.

Iteration (Loops): A block of statements that are repeated based on some conditional statement evaluating to true.

Page 5: Software structures

55

Procedural Structures

Modules: A term used to describe different parts of a program. These may include groups of functions and procedures

Procedures: Perform re-usable actions

Functions: Generally used for calculations as they return value – reusable

Pre-defined code: Built-in functions or a compiled module which can be inserted into the solution

Page 6: Software structures

66

OO StructuresClasses: A program building block which provides a template for the creation of objects. A class contains both data and functions that

describe a real-world thing

Objects: A concrete instance of a class, complete with its own personal data. Represent either physical or conceptual things (e.g. customers, books, loans)

Data Abstraction: The object’s users know nothing about how the data is manipulated inside the object

Page 7: Software structures

77

Quality of Code

Reliable and Robust: Thorough testing ensures programs work properly and can cope with being used incorrectly

Usability: The best programs are easy to use and intuitive. Clearly labelled and logically arranged controls make it easier for the user

Efficiency: The code calculates results and performs operations as quickly as possible

Page 8: Software structures

88

Quality of Code

Portability: The ability of a program to run on different hardware or software platforms with minimal modification

Maintainability: Every product needs to be maintained with updates, bug fixes and new features, to make this easier: Good detailed technical documentation

describing the design and implementation Well-written programs inc. Comments,

meaningful variable names and indenting

Page 9: Software structures

99

Achieving Higher Criteria

M1: Cover all quality issues – explaining why they may be important in a particular development project

D1: You need to discuss the readability of code and the factors that affect it, inc. Benefits and drawbacks of each technique used. Give examples of actual code and explain what problems may arise if the technique is not used