Unit 6 – P1
Describe the Application and Limits of Procedural, Object Oriented and
Event-Driven Programming Paradigms.
A computer paradigm is a style of computer programming, this
means you can build the structure and the elements of many different computer
programs. There are many different types of programming paradigms, some of
these being: Object-Oriented, Event Driven and Procedural.
Procedural
Procedural languages are mainly used for large, complicated
programs as they are mainly for creating operating systems or calculating
scientific work. The output of the program needs to turn into return values so
it could help the user. Procedural is only used for smaller sized projects
instead of larger based ones. It wouldn’t be appropriate to use procedural to
create such high demanding requests such as a calculator or operating systems.
It would just be too complicated to create.
The big restriction of procedural languages is the re-usability.
You cannot use the same method and coding over and over again while making
something as it would become far too complex to make. To make it, it would need
millions upon millions of lines of code, meaning that it could lead the creator
to fail. After millions of lines of code and they fail. That’s a lot of work
and you would have to manually find the error that you made, that would
possibly take even longer than it should do.
The
most serious limitation is the tendency for large procedural-based programs to
turn into "spaghetti-code". Spaghetti
code is code that has been modified so many times that the logical flow shown
in the figures above becomes so extremely complex that any new programmer
coming onto the project needs a two month preparation in order understand the
software. This happens because a programmer’s job begins when they finish the
first version of their software application, they will then will be raided with
tons and tons of bug reports and modifications because they didn’t code the
application properly, they will then have to make newer versions of the
application making it version 1.1, 1.2 etc...
Examples of procedural languages include BASIC, Pascal,
and C, although there are many others.
Object Oriented
Object oriented
programming is merely based on objects, it will attempt to provide a model for
programming. The object will have both state and behaviour. Objects sometimes
match to things in the real world, such as a circle or a square. An online
shopping website will have things like a shopping cart and an ‘add to cart’
button. These will all have special functions acquired to them. Object oriented
can be used to create classes and sub-classes for a shopping website. They will
filter out things to your choice, such as ticking a box on clothing and then
checking what type of clothes you want. It will do a mathematical equation to
filter out the types of clothing that are not in the requirements that you
want.
Main application
areas of Object Oriented Programming are: User interface design such as windows, menu etc…
§ Real Time Systems (RTS)
§ Simulations and Modelling
§ Object Oriented Databases
§ AI and Expert System
§ Parallel programming
§ Decision Support
There are only a
few limitations with object oriented programming and one of them is that there
are no tools to develop the application and this programming could be used in
PHP coding using software like Adobe Dreamweaver and vb.net. Object oriented
programming also has to be done manually and can be really challenging and take
forever to produce something.
Event Driven
Event driven
programming is created using procedural programming and can use object
programming. Event driven programming is based on how the program reacts to the
user’s needs and isn’t related to the structure of the program. Event driven
programming is only used when it is going to use a windows graphical interface
as this may not be suitable on any other interface such as Apple computers and
Linux. This could be made using Visual Basic by Microsoft. Event driven
programs would be used as something such as an alarm clock, to set a time for a
task and to sound an alarm when it is time to do such task. A limit of event
driving programming would be that it doesn’t allow you to enter event loops and
requires the user to do it manually instead of automatically.
Unit 6 – P2
There are many factors which influence the choice of
programming language; these will include such factors as:
Reliability:
Programming software will have to be reliable as it will have
a lot of pressure being put on it. If a programming language is un-reliable
then not a lot of people will use it. The programming software will need to
have a good and safe security system as it could be easily hacked if it hasn’t
a good one. If somebody was to hack someone’s work, they could take it and say
it is their own, after all the hard work I’m sure the original creator wouldn’t
be happy at all if someone had stolen their work. If the programming software
doesn’t have a security system software built into it, it will most probably
not work. If it did have a security system then it would run smoothly and will
be unlikely to crash and break your computer. Some programming software will
have special features built into them which can enable it to become more
reliable and safe.
Expandability:
Some types of programming software systems have to help and
support up to thousands of people worldwide. Meaning that the software will be
able to run without crashing if there were hundreds and thousands of people
using it at the exact same time, putting the software under stress and may slow
it down a bit. The software will need to be expandable so that it cannot stress
and crash if there are many people using it. Some different software will have
other special features which support a much larger audience than another
software which only supports a smaller audience. The more expandable software
are better because they are most probably a better system and more people would
recommend them.
Trained
Staff:
The programmers will need to be extremely skilled when
working with a certain software because if any bugs occur, they will need to be
skilful enough to find the errors and fix them immediately. If the staff aren’t
trained enough then there may be some risks when designing the code, this would
be a disaster for the people using the software because they would want to
trust the software that they are working on. The staff will be trained well
enough so that they can work on any language easily whilst designing new
software for people. If they are skilled enough then they should be able to do
this a lot faster than the not so skilled. This is a benefit because if you can
get a task done in the same quality but a shorter time, it leaves more time for
the worker to either move on to another task or to work on another thing within
the same software, either making it better or just strengthening a certain area
of it.
Development
Cost:
The developer of the software will have a budget that they
will work their software around, they will have to select features carefully so
that they don’t go over the budget that they have, and one feature to decide
would be the language. Some languages have licenses which you would have to pay
for to be enabled to create software using that language. Some languages have a
free license so you wouldn’t have to pay for it separately like the paid
licensed software. As software developing costs a lot of money, there will be
many updates to the software which would also cost quite a lot of money,
depending who is doing your programming for you, you may have to pay more or
less depending on who they are and how skilled they are at actual programming.
Organisational
Policy:
Some companies use this policy as to what software and
hardware is to be used like Microsoft software. This is due to whether problems
occur, the organisation will help as they are a larger company and will most
probably have a higher level of trained staff that can solve the problems,
there are multiple factors that affect organisational policy.
·
Selection – This chooses which code should be run by
using the ‘if’ and ‘then’ commands, it is a method of letting the program make
its own choice and then locate it to the right code.
·
Boolean – Boolean is a binary variable that can have either
one of two values possible. False, and true. True being 1 and false being 2.
·
Integer – This stores whole numbers but no decimal
points, it can have up to 4 bytes of data inside.
·
String – This is like integer and floating point. It
is used for text over numbers, although it can contain both. It is always in
quotation marks as it would not work without them. The data will need to be
recognised as a string, if it is not in quotation marks then it may think it is
a number or a variable name.
Unit 6 – P3
Explain sequence, selection and iteration as used in computer programming
Selection:
Selection is one of the main three basic structures. If a
question is asked, there must be more than one outcome depending on the users’
answer. This is also known as an if statement. If statement is a selection
statement that allows more than one flow of control. If statements are also
decision statements, it is also sometimes a true or false statement. Normally a
question will be asked, and depending on the answer, the program will take one
of two courses of action, moving onto the next event. This structure is
sometimes referred to an if-then-else because it directs the program to perform
in this way. Selection is all about choice, it is the place where an algorithm
or program branches in different directions. Choice can be made in many ways,
for example a quiz. If the answer provided is incorrect, the program will tell
them that they have entered an incorrect answer, on the other hand if they are
correct, it would congratulate them on getting the answer right. It can also be
a choice with a burglar alarm, if the sensor detects a movement whilst the
alarm is enabled, it would sound an alarm letting the people around the alarm
know that that place is being burgled. If no movement is detected then the
alarm would be normal and quiet. All logic problems in programming can be
solved by forming algorithms using only three logic structures, and they can be
combined in an infinite number of ways, the more complex the computing needed,
the more complex the combination of structures.
Sequence:
Sequence is another one of the three main basic structures.
Sequence is a set of instructions that are in order, or a sequence, one
instruction after another, once one instruction has been completed, and the
computer may take a few seconds for the next instruction to be done. These
instructions are made by computer programmers. An example of sequence is a flow
chart. A flow chart is a diagram that used many shapes such as a rectangle,
ovals, diamonds and many more. Flow charts are useful because they are a good
way of visualising the chart than describing it to another person, they would
understand it much more if you showed them a diagram than explaining to them
what it looks like or how they work. They are a step by step guide from start
to end and there are many separate routes that lead to an ending. The outcome
may be different but you will get somewhere eventually. In a sequence
structure, an action will happen and it will lead onto the next one in order in
advance. No actions can be skipped or bypassed, once you have done one action,
it can lead into many different directions to another action, which would then
do the same. Sequence structures can be used as a tutorial such as getting
ready for college in the mornings, it would have steps such as ‘Get out of bed
and get in the shower’ or ‘Get dressed and put your shoes on’. Sequence
structures can have as many steps as possible but would be more complex and
would take a longer time to code if it had hundreds of steps. If a sequence
structure was only 5 steps, it wouldn’t take long to code and would be fairly
simple to do it. Whereas if it was 1000 steps, it would take much longer and
there would be much more room for error, meaning that it would take longer to
find the error if the software doesn’t point it out for you.
Iteration:
Iteration is a computer loop that goes through a group of
instructions which get executed over and over and over again in a loop.
Iteration is also known as a loop. When a process or sequence in a computer
program is repeated, this is an iteration (or loop). In a computer program, a
common form of iteration is a loop, which repeats code to determine values for
multiple variables or just sometimes a single variable.
Many computer programs and programming languages use
iterations to perform specific tasks, solve problems and present solutions. The
process will be repeated with the aim of reaching a goal or target. Each
repetition is called an iteration and the results of one iteration are used at
the starting point of the next iteration. Iteration can be shown as a ‘while
loop’. The while loop performs a function that is given by the program designer
and will go on until the function is true. The while loop first test the given
condition then executes the function.
Unit 6 – P4
Outline the
Benefits of Having a Variety of Data Types
Boolean:
Boolean is a part of a larger group of algebra that is used
to making a T/F (True/False) statement. True will be written as the number 1,
whereas false will be written as the number 2. Boolean can be written in both
algorithms and coding. Boolean was developed by the English mathematician and
computer pioneer George Boole (Hence the name Boolean). A boolean consists of
operators such as and, or, not and xor. Booleans are often used in programming
and today in internet search engines. Boolean expressions are expressions that
result in the value of either true or false.
As mentioned above, a user can use Boolean searches to help
locate more exact matches in internet searches.
String:
String is very useful for programmers because it can hold
many letters and numbers without having to use the data type char. In
programming, to use string you will have to use quotation marks to emphasise
that it’s a quote and not a command. An example of string is in JavaScript: var
carname = “Mercedes”. String is a contiguous sequence of symbols or values,
such as a character string or a binary digit string.
Char:
Char is another data type that is useful to programmers. Char is used as a reserved keyword in a number of programming languages, such as C, C++, C# and Java. It is short for character, you would use char when you only need to hold one single character but when you don’t need string. In addition, other languages that do not have char as a data type may use the abbreviation for certain methods that are used with string values. For example, JavaScript has methods such as charAt() and charCodeAt() that return values relate to the calling string. The charAt() method, for instance, returns a string containing one character, which is the character at the location given as the framework to the function.
Integer:
Integer is one of the data types that a programmer will need
whilst programming. An integer is a whole number, so no decimal places, just
like in maths. Integers are useful for programmers when coding because some of
their program will be in numbers. The use of integers as variables supports
programming in various ways. For instance, a common strategy is to create an integer
variable and store some value in it that will influence calculations made
within the program. Examples include things like counters and calendars.
Float:
Float, also known as floating point is numbers that have
decimals in them, such as 4.20 or 13.37, just as long as they have a decimal
point in them. Float is similar to integer but float has decimals whereas
integers don’t. There are also no fixed numbers before and after the decimal
point. A float has numbers before and after the decimal place. Programmers will
use the term float before the name of a variable. A second line of code can
declare a value for the float variable by using the name of the variable,
adding an equal’s sign and following that with the value.
The float’s variable is often used to include currency values
in a computer program, such as US Dollars or Great British Pound Sterling.
Floats generally use the same operators as integers in the same ways. The
addition, subtraction, multiplication and division of these variables is fairly
straight forward in most cases.
Date and Time:
Date and time is mainly used to store dates on a program,
this could be like a calendar. On a calendar you can also set reminders or
alarms to give you a message at a certain time. This can be about anything,
whether to do your homework or go out with some friends. Date and time is
important while coding a program because if you are running a program and it
doesn’t have the correct date or time, it might not work properly.
P5 – Explain the role
of software design principles and software structures in the IT systems
development lifecycle
Software design principles and software structures are used
to make sure that the software is written to as good of a quality and as
efficient as possible. They are also used to help reduce the risk of having a
badly designed software application.
Semi definite and starting strength programs provide a guide
and a structure around it. Software can then be written throughout the
development cycle (Which is the image above this).
Software Design Principles:
There are two main characteristics that you should avoid when
designing software. These are:
·
Rigidness – If a piece of software is very rigid, it
will make it hard to change as the other parts of the system will be affected
by this too much. With
·
Fragility – Sometimes, changes to the software can
break other parts of the computer system. When this happens, you would then
have to do an impact analysis on the whole system which will take time and
could cost money.
Scope:
Scope is an enclosing context where values and expressions
are associated. Various programming languages have different types of scopes.
The type of scope determines what kind of entities it can contain and how it
effects them. Scope is used to determine the amount of information hiding.
Scope refers to the visibility of variables. More simply, which parts of your
program can see or use it. Every variable will usually have a global scope.
Once the variable has been defined, every single part of your program can
access a variable. It’s useful to be able to limit a variable’s scope to a single
function. The main program can’t be affected in any strange ways if changes
occur.
Requirement Analysis:
Requirements analysis is the main focus of the project
managers and stake holders. Meetings with managers, stake holders and users are
held in order to determine the requirements such as; how will the system be
used? Who is the system going to be used by? General questions like these get
answered during the requirement gathering phase. After requirement gathering is
complete, they will then be analysed for they validity and the possibility of
organising the requirements in the system. Requirement analysis can also be
known as requirements engineering. In software engineering, such requirements
are often called functional specifications. Requirements analysis is an
important of project management. Requirements analysis is also a team effort
that demands a combination of hardware, software and human factors engineering
expertise as well as skills in dealing with people.C
Design:
The system and software design will be prepared from the
requirement specifications which were studied during the requirement gathering
and analysis. System design helps in specifying hardware and system
requirements and also helps in defining overall system architecture. The system
design specifications server as an input for the next stage of the model. The
design stage takes the products from the analysis stage and creates a design of
the architecture and detail working of how the software system will deliver
what is wanted. The most important thing to note is that despite many efforts,
there is no automatic way of acquiring the products from the analysis products.
It is possible to compare the design products with the analysis products to see
what was wanted has been included in the design. The design stage is completed
by the analyst and design teams to work together with the developers in the
develop team.
Coding:
This stage of the software development is what most people
would consider as the main stage and what the whole thing is about. In many
ways, this is the least important stage in the whole thing, although it will
consume many of the resources. The reason to this is because most systems are
made from a set of standard parts with a bit of configuration, a bit of customisation
and some other parts to make the system unique. These decision would have been
taken in the design stage. The work will be divided into separate modules and
the coding will finally start to take place. Because this is the stage where
all of the coding will begin to happen, this is the main focus for the software
developer. This will be the longest and most time consuming stage for the
developer and the software development life cycle. After all of the coding for
the software has been completed, the software will then have to be tested.
Testing:
In this stage, the code you previously developed will be put
to the test, it will be tested to see if the software is going to be fragile or
if it will stand strong. It will also be tested for any bugs or errors in the
coding, you will then go and find the error and then fix it. While you are
testing, you must prove that the system works and is what was wanted throughout
the whole development. This stage isn’t all about testing in general, but it
contains activities such as document reviews and code walkthroughs. This stage
will be completed by both the developers and the user. The user will test it
normally as they have never seen the program before and won’t know how to use
it, whereas the developer will know full well how to use it and can check every
nook and cranny. You will mainly want to start testing your system development
as soon as possible so that you will have less to fix if there are problems at
the end. If you test as you go, then if any problems occur you can fix them
straight away other than waiting until the end of the cycle to solve them. You
will want to test your system every so often to ensure that it is working to
its full potential.
Readability is ensuring that the code that you have
written/developed is clear to read and easy to understand as somebody else may
need to look at your coding and see how clear it is to them. If you were to
read something, you would want it to be nice and clear so that you have no
problems locating a certain word or a sentence. If the code is not readable
then somebody reading it will not be able to see where you have gone wrong if
there are any bugs that occurred. Readability is important to coders/developers
because when another programmer needs to modify a bit of your coding so that
they can fix any bugs, they will be able to see where they need to go and what
they need to fix instantly.
Debugging is important in programming because if there are
bugs that occur in your program, it will not work properly and will not be as
high of a quality than if there were no bugs in it. Stakeholders will want to
be a part of a program that has no bugs that occur or have a potential to occur
as they will be more stable and efficient. If there are lots of bugs in your
software, then people will not be as pleased with the program and will want to
use a different piece of software.
Team working is important because if you cannot think of how
to do something by yourself, having someone to work with is much better because
you will have a higher chance of knowing how to do it or a higher chance of
working out how you could do the task. If you don’t know how to do a certain
task, you would most probably turn to google and see if other people know how
to do it. Having a team of people is much better because you will be able to
work through the coding stages and design stages much quicker and efficiently
than if you worked by yourself.
You will need updating skills when developing software
because if there are problems in your software, you will want to have the
skills so that you can fix the problem and then update the software to a better
version, if you don’t know how to update your software then you will be stuck
with a bad version of your program until you get somebody else to update it for
you.
It is extra important that you have high quality code in your
software because if your coding is low quality and not worked on very hard,
your program will most likely be a bad version of a program you could make much
better. If you have high quality code, your program will be of a high quality
overall.
