Event Driven Programming
Chapter 1: Introduction
Outlines
Introduction to Software Development
Software Development Approaches
Rapid Application Development(RAD)
Principles behind RAD
Event driven programming
2
Introduction to Software Development
Software is more than just a program code.
A program is an executable code, which serves some
computational purpose.
Software is considered to be a collection of executable
programming code
3
Cont.…
A successful software project must:
Resolve the diverse and possibly conflicting needs of
users in a disciplined way
Satisfy the users expectations
Have been developed and delivered in a timely and
economical manner
Be resilient to the changes that will be introduced
during its operational lifetime
Demonstrate good overall system quality.
4
Cont.…
Characteristics of software that affect its
development and the likelihood of errors:
Malleability:-changing the software repeatedly
introduces the possibility of new errors.
Complexity:- The number of errors is likely to depend
on the complexity of a system.
Size:-It is likely that there will be more errors in a large
piece of software than in a small one.
5
Cont.…
The development processes:
A set of rules that defines how a software development
project should be carried out.
A set of software engineering activities associated with the
development of software.
On completion of an activity there may be one or more
outputs, which are known as deliverables.
The order in which these activities are carried out is called a
6 life cycle
Cont.….
Software Development life cycles:
Domain modelling.
Understanding the environment in which a system may
be introduced (i.e. the business processes and rules).
Requirements (requirements engineering).
A set of steps including requirements elicitation,
where you identify the problem, and requirements
analysis, where you categorise, prioritise and model
requirements.
7 This defines what the system is to do.
Cont.…
Design
Determining how you will solve the problem.
Implementation
Acting upon the decisions made at the design stage.
Testing
Testing what you have done so that you can determine
whether or not you have solved the problem.
8
System development approaches
There are different approaches to develop software. The
following are some of the basic approaches
1. Structural approach
2. Object oriented approach
3. Prototype( a different approach)
9
System development approaches…
1. Structural approach:
It is a methodology which tries to address system
development with traditional system development
lifecycle (project identification, project initiation and
planning, analysis, design, implementation and
maintenance) by making analysis and design more
disciplined by using tools such as flow diagrams, and
transformation analysis.
10
System development approaches…
2. Object oriented approach:
It is a system development methodologies and techniques
based on objects rather than data or process.
In this approach, various objects that occur in the problem
domain and the solution domain are first identified, and
the different relationships that exist among these objects
are identified.
The object structure is further refined to obtain the detailed
design.
11
System development approaches…
3. Prototype approach:
Is an iterative process of system development in which
requirements are converted to a working system that is
revised through close work between analyst and user.
It can be developed with some fourth generation languages
including the following components such as query, screen design,
report design tools of database management system and with
tools called computer associated software engineering(CASE)
It is a form of RAD
The fundamental principle of any RAD is delay producing
detailed system design documents until user requirements
are clearly defined.
12
Rapid Application development(RAD)
RAD:-
Is a software development process that allows usable systems
to be built in as little as 60-90 days, often with some
compromises. i.e. process is quick, painless, and nearly
effortless.
RAD is a Methodology to radically decrease design and
implementation time.
Involves: extensive user involvement, prototyping, JAD
sessions, integrated CASE(computer association
system engineering) tools, and code generators.
i.e. relies on heavy user involvement, joint application sessions,
13 prototyping , integrated case tools and code generators
Cont.…
In RAD prototype become a basis of a new system which relies on
CASE tools that are able to design systems and generate error free
codes.
Joint application development (JAD)
Is a structured process in which users, management and analyst
work together for several days in a serious of intensive meetings to
specify or review system requirements.
RAD lifecycles:
RAD contains the basic phases of any system development
lifecycles such as Requirements Planning, User
Description phase , Construction phase and cutover
Is treated as continuous iterative improvement rather than
strictly sequential step by step process.
14
Contd. . .
The four phases of RAD life cycle are:
15 RAD life cycle
Cont’d. . .
Requirement planning
o In this phase one specific system identified ,users and analysts
conduct a joint requirement planning
User design/analysis
o In this phase end users and information system professionals
participate in JAD and use integrated case tools to support the rapid
prototyping of system design.
Construction/design
o This phase use output from above phase to generate production
codes using the CASE tools
Cut over
o Deliver the new system to its end users.
16 o includes testing ,training users and others.
Rationales /Principles behind RAD
RAD
o Is feasible because it can be easily converged towards
design and is not subjected to the changes of the time.
o Is also saves the time and the efforts of the
development team.
o It allows higher user involvement.
o It prevent cost overruns.
o It prevents run away of schedule.
17
Why RAD is preferred?
With conventional methods, RAD tries to
address:
In traditional system development a long delay
before the customer to get/see any tangible
component/ results of system. But in RAD user see
parts of the working model of the system starting
from the beginning.
In most case development takes much time. But this
isn’t seen in RAD.
In traditional method there is nothing seen until
18 100% of the system completed.
Cont. . . .
Bad reasons for using RAD
o prevent cost overruns (RAD needs a team already
disciplined in cost management)
o prevent runaway schedules (RAD needs a team already
disciplined in time management)
Good reasons for using RAD
o converge early toward a design acceptable to the
customer and feasible for the developers
o limit a project's exposure to the forces of change
o save development time, possibly at the expense of
economy or product quality
19
SCHEDULE versus ECONOMY versus PRODUCT QUALITY
Trade-off determine the speed of development.
o Efficient Development balances economy, schedule, and
quality
Schedule -- faster than average
Economy -- costs less than average
Product -- better than average quality
o Sensible RAD tilts away from economy and quality toward
fastest schedule
Schedule -- much faster than average
Economy -- costs a little less than average
Product -- a little better than average quality
o All-out RAD "code like hell"
Schedule -- fastest possible
20
Economy -- costs more than average
Product -- worse than average quality
Cont.…
For RAD, something other than schedule must
be negotiable.
o RAD has a fair chance of success if the customer will
negotiate either economy or quality
o RAD has a better chance for success if the customer will
negotiate both economy and quality
o NOTE: Negotiating quality does NOT mean accepting a
higher defect rate. It means accepting a product that is
less usable, less fully-featured, or less efficient.
21
Cont.…
With RAD, one or more of the following goals
may be unachievable.
o The fewest possible defects
(because developers may not have the legal right to modify the
source for some plug-in components)
o The highest possible level of customer satisfaction
(because secondary requirements may be sacrificed to stay on schedule)
o The lowest development costs
(because buying reusable components may cost more than
building)
22
Cont.…
Assignment:
What are the applications of RAD?(when it is
applicable)?
In what case RAD fails to work?
Advantage and disadvantages of RAD?
23
Event driven programming
There are literally hundreds of programming languages, each
of which used to solve a particular type of problem.
Most traditional languages likes :
BASIC , C. COBOL,FORTRAN< PL/I , and Pascal are
procedural languages.
I.e. it specifies the exact sequence of all operations.
But the newer programming language , such as Visual Basic
.NET ,C#, & J# use a different approach i.e. OOP.
24
Cont.….
VB – which provide many elements of an object oriented
language is a stepping stone between procedural
programming and OOP.
For this reason ,Microsoft referred VB as an event driven
programming language than an object oriented language .
But with the release of visual studio.NET, which includes
Visual Basic.NET, C#, and Java, Microsoft has produced
three programming languages that are truly object –
oriented.
25
Cont.…
In OOP
Programs are no longer procedural
Don’t follow a sequential logic/operation.
o i.e.. don’t take control that determine the sequence
of execution.
But the user press the keys from keyboard and clicks various
buttons and boxes in a window which cause an event to
occur.
Ex. User clicks on a button labeled calculate .
Clicking this button cause an event to occurs which do the
26 calculation.
Cont.…
So, VB is a programming language in which the event
driven programming paradigm followed.
Or It is an object based and event –driven programming
language which enables to create GUI application using
RAD techniques .
One of the most interesting features of it is, it comes
with IDE which enables to create buttons , textboxes ,&
others controls for application.
o I.e. In visual basic-code won’t write like structural programming
27
language.
Cont.….
But the writing programming code is executed in
response to an event.
i.e. code design to react to the events.
Event driven means write code to handle things occurs as
the program is running.
On other hands VB is designed by put code in to an event
handler and that code can be executed when event take
place.
28
Cont.….
To do so, VB provide all sorts of “pieces” which
inserted into program code that allow the
detection and handling of an event.
For example, a text box which inserted in to a
form will detect the cursor on the textbox then
allow text input from keyboard.
In event driven coding , this is hidden from the
user.
29
Event driven programming in VB
What is event?
Event:- is an action that performed by the user of
application.
o i.e. it occurs through user action.
Also an action which triggered by action of other
objects when certain condition reached.
Common event are:
A mouse click
A mouse double click
A window opening/closing
That means , if users clicks a mouse button on any object
30 – then the click event occurs.
Cont.….
VB Is a powerful programming language which enables:
o GUI application development
o Access to DB using Data accessing Object, Remote Data Object or
Active X Data Object
o And creation of Active X controls
Provides you with a complete sets of tools to simplify RAD
Supports API programming which enables to handle the
windows.
Works with objects which have properties , methods and
events.
Has two parts- visual and basic
31
Cont.…
1. Visual part is part which refer to the method used to
create GUI
Rather than writing of a numerous lines of code to describe
appearance and location of interface , simply add pre-built object.
2. BASIC part is part which refers to the BASIC language –
language which used by more programmer than any other
language.
32
Cont.….
Object
is based on class
Is a thing/ a noun
Ex. Forms and controls
Forms
The windows and dialog boxes which placed on screen.
Or windows that create for user interface.
Controls
The component that placed inside a form such as text boxes,
command button and list boxes.
Or graphical features drown on forms to allow users
interaction
33
Cont.…
Properties
Tell something about behavior of an object such as name, color,
size, or location.
Or specify every characteristics of a form/ controls
Is an objectives that describe objects.
Ex. Name, captions, size, color, position, and contents.
When refer to property – 1st name the object, add a period,
then name the property
o Ex. To refer to the Text property of a form called salesForm as salesForm.Text
34
Cont.….
Method
An action which associated with objects
Or built-in procedures that can be invoked to impart some
action to a particular object.
Ex. Close, show, and clear.
To refer to a methods as Object. Method
Ex.1. a show method can apply to different objects:billingForm.show-
shows the form objects which is called billing Form.
Ex. 2. to show the form objects which is called exit Button, apply
exitButton. Show
35
Cont.….
Events
procedures that write to execute when a particular event
occurs.
An event occurs when the user takes an action, such as
clicking a button, pressing a key, scrolling, or closing a
window.
Events also can be triggered by actions of other objects,
such as repainting a form or a timer reaching a preset
point.
36
Cont.…
Class
Is a prototype/ blueprint for an object.
Or a template / blueprint that used to create new object.
Includes specifications for the properties & methods.
Contains the definition of all available properties , methods,
and events.
When create a new object , it must be based on a class.
For example, you may decide to place three buttons on
your form.
o Each button is based on the Button class and is considered one
object, called an instance of the class.
o Each button(instance )- has its own sets of properties, methods &
events.
37
Cont.…
Example: One button may labeled as “OK”, one as
“Cancel”, and others as “Exit”
When user clicks:
o The Ok button , that button’s click event occurs
o The Exit button , that button’s click event occurs
To do so, different program/instructions written
for each of the button’s clickevent.
38
Questions?
39