Nov 15, 2011

STRUCTURED PROGRAMMING



Structured programming is a programming theory is to build programs understandable,
 it is especially useful when you need to make corrections or changes after the completion
 of a program or application. By using structured programming is much easier to understand
 the coding of the program, which will have been done in different sections.
It is based on a software development methodology called successive refinement: an
 operation is proposed as a whole is divided into segments simpler or less complex, once
 completed all segments of the program proceeds to unify the applications made by the group
 of programmers. If you have used properly structured programming, this integration should be
 simple and have no problems integrating it, and to present a problem, will be quickly detectable
 for correction.
The graphic representation of structured programming is done through flow charts, which
 represents the program with inputs, processes and outputs.
Structured programming processes proposed structures segregate as simple as possible,
which are known as sequence, selection and interaction, which are available in all modern
programming languages ​​in the form of imperative sentences by combining simple schemes
can get to build systems large and complex but easy to understand.
Structured programming is a disciplined approach to writing programs that are clear, proven
 to be correct and easy to modify.
Structured programming is divided into modules and programs are based on the
development of programs ranging from general to particular, ie, the element set is said of
a particularly specific.
To solve a particular problem, start by considering the functions that must meet the overall
 program and then dismembering these functions is smaller subfunctions until the last one
 or more particular case and no longer can be subdivided into cases smallest. Once
the program has already been dismembered in the general to the particular, is beginning to
 program these small functions, private or modules, in this way, we can always build new
modules or units by inserting the name of the module and developing appropriate part.
modification of the modules is easy and can be referenced as many times as needed, thereby
 saving time in the program, a program has a structured design if it meets the following two
conditions:
  • The structure theorem.
  • Is properly documented
The structure theorem states that "a program meets the structure theorem if and only (or) if you
 own and contains only three basic control structures" that are sequential, alternative and
 repetitive, a program is proper if and only if it satisfies: having a single point of entry and one
exit point, and in two control points of the program exists at least one way.
Structured programming is a style with which he seeks to develop programs that the
 programmer simple and easy to understand, structured programming makes use of three
 basic structures of control are: Sequential Structure, Structure and Structure Selective repetitive
 (or iterative)
Structured programming is based a fundamental theorem, which states that any program, no
matter what kind of jobs that can be produced using only the three basic structures.
DEFINITION OF THE BASIC STRUCTURES 3
1. Sequential structure: Indicates that the program instructions are executed one after the other in the same order in which they appear in the program. Is plotted as a box after another, each with a single input and single output.
sequence
Boxes A and B can be defined to run from a single instruction to a module or complete program, provided they are
also appropriate programs.















3. Repetitive structure (Iterative): Also called the structure to do - while - that corresponds to the repeated execution of an instruction while a certain condition is met. The flow diagram for this structure is as follows:
iteration
Here the block A is executed repeatedly while the condition is fulfilled or C is true. It also has one input and one output, same as can be any basic structure or set of structures.


2. Selective Structure: Also known as the structure if true - false, poses the choice between two alternatives based on the outcome of the evaluation of a condition, is equivalent to the IF of all programming languages ​​and is graphically represented as follows :
selection
In the above flow diagram, C is a condition that is evaluated, A is the action that is executed when the evaluation of this condition is true and B is the action executed when the result of the evaluation indicates false. The structure also has one entrance and one exit, and the functions A and B can also be any basic structure or set of structures.




ADVANTAGES OF STRUCTURED PROGRAMMING
In structured programming, develop computer programs remains a work that demands effort,
creativity, skill and care.However, with this new style we obtain the following advantages:
1. Programs are easier to understand, a structured program can be read in sequence, from top
 to bottom without having to be jumping from one site to another logic, which is typical of other
 styles of programming.
2. It achieves a reduction of effort in testing, monitoring or debug faults (debugging) is provided
 due to the logic more visible, so that errors can be detected and corrected more easily.
3. Programs are created easier and faster.
DIFFERENCES structured programming with other programming






Although structured programming led to improvements in sequential programming
 technique, modern methods of software design including object-oriented
 improvements among which are the use of design patterns, design by contract,
 and modeling languages, the main differences between structured programming
 and object oriented are:
  • Object-oriented programming is more modern, is an evolution of structured
     programming that captures the design of a family of languages ​​concepts that
    previously existed with some new.
  • Object-oriented programming languages ​​is based on syntactic and semantic
     supporting the link between abstract data types and operations.
  • The object-oriented programming features in runtime mechanisms such as
     polymorphism and sending messages between objects.
Erroneously ascribed to classical structured programming as if they were certain
 problems inherent in it, those problems were becoming more severe and before the
 various object-oriented programming authors found solutions to apply strict working
 methods. From this period are the concepts of cohesion and coupling of these
 problems are the following:



Abnormal mental model. Our image of the world rests in people, to which we attach
nouns, while the classical programming is based on behavior, usually represented
 by verbs.
  • It is difficult to modify and extend the programs, as there are often shared by
           several sub-data, which introduce hidden interactions between them.
  • It is difficult to maintain the programs. Almost all large computer systems have
             hidden errors that do not come to light until after many hours of operation.
  • It is difficult to reuse programs. It is virtually impossible to take on a new 
              application subroutines that were designed for another.
  • It is complex coordination and organization among developers creating 
               applications for medium and large.
    In pure object-oriented programming should not be used subroutine calls, messages
     only, therefore, sometimes called no call schedule, like structured programming is also
     called programming without goto, however, not all oriented languages to prohibit the call
    instruction objects, enabling hybrid programming, imperative, object-oriented at
     a time.

    0 comments:

    Post a Comment

    Twitter Delicious Facebook Digg Stumbleupon Favorites More

     
    Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Premium Wordpress Themes