OOAD121 - PS01

concepcionsockSoftware and s/w Development

Aug 15, 2012 (4 years and 10 months ago)

234 views

Analysis and Design of Software Systems

Practical Session 01


System Layering

Outline


Course Overview


Course Objectives


Computer Science vs. Software Engineering


Layered Architectures


Selected topics in Java


Swing


Parsing XML file

2

Course Objectives

1.
Planning a new Information System in Engineering methods.


One assignment (5%)

2.
Functional Approach for A&D


Two assignments, 5% each

3.
Object
-
Oriented Approach for A&D


Two assignments, 5% each

A total of 5 assignments consisting 25% of the course’s grade.


Test consisting 75% of your grade,
OPEN MATERIAL!

Please study accordingly.

3

E
1

3

E
2

Administration

My email is
guyrap@cs.bgu.ac.il

. Use it!

Office Hours: Wednesday, 16:00
-
18:00, 37/304.


Assignments are submitted electronically to
FTP,
in pairs!


Please
report problems with submission dates
as early as
possible

(that includes students with reservoir duties
).


Reservoir soldiers


I need your release slips, not
the
“invitations”.

4

E
1

3

E
2

Computer Science stops
here
.



Computer science is no more about computers than
astronomy is about telescopes
, biology is about microscopes
or chemistry is about beakers and test tubes. Science is not
about tools, it is about how we use them and what we find out
when we do."


This quote is actually from Fellows, M.R., and Parberry, I., "SIGACT
trying to get children excited about CS", January
1993
,
Computing
Research News
.


Focus is often about algorithms


independent of a particular
programming language (or implementation at all…).

5

Software Engineering starts
here
.


Software Engineering

(
SE
) is the application of a systematic,
disciplined, quantifiable approach to the development,
operation, and maintenance of software…


It is also defined as a
systematic approach

to the
analysis
,
design
,
assessment
,
implementation
,
test
,
maintenance

and
reengineering

of
software
, that is, the application of
engineering to software.


The term
software engineering

first appeared in 1968, and was
meant to provoke thought regarding the perceived "software
crisis" at the time.


Recommended Viewing:

Glenn Vanderburg’s


“Real Software Engineering”
confreaks.net/videos/282
-
lsrc2010
-
real
-
software
-
engineering


6

Example CS Problem:


Narrow
-
Shallow
-
Low
-
Light Trees with and without Steiner Points


Michal Elkin, Shay Solomon


SODA'
11
Best Student Paper Award,
2011
!

7

Example SE Problem:


Your senior programmer Alice has called
-
in sick today.


How do you keep the project’s progress?


…And without introducing new errors into the system?











Software Engineering occurs when
people

meet
programming.
.

8

That does not mean people do both…


Of course there are computer scientists
who consider the engineering side and
software engineers who consider the
algorithmic side.


But in our course we shall focus mainly on
engineering
.


Let’s move on to our first example of
applying an engineering concept unto
software development.

9

System Architecture


Architecture


High level design of large software systems.


Captures the gross structure of a system.


Defines software system in terms of components and interactions
among those components.



Why not write all of our code in a single file?


Programmer
-
friendliness


Code readability


Flexibility


edit or replace parts of the code currently in use.



What can we do to further pursue the above objectives?

10

Introducing: Layered Systems


A layered system is organized hierarchically; each layer
provides services to the layer above it and consumes services
from the layer below it.


Why layers???


Modularity:


Separations of concerns


Increased maintainability




In a pure layered system: Layers are hidden to all except
adjacent layers.


11

Layered Systems
(Cont.)


In a pure layered system: Layers are hidden to all except
adjacent layers.










Pure layered system Not pure layered system


12

NOT

Layered Systems


There is more to layers than the ability to draw separate parts
on top of each other.


Layers are not a function of just who
-
uses
-
what, but are the
result of a
conscious design decision
that allocates software
to layers based on considerations such as coupling, cohesion,
and likelihood of changes.

13


The
Three Layers Architecture

14


On the left: an example
implementation of a
system devoted to
sales.


Presentation can be
GUI, CLI, forms in a
browser…


Some people
distinguish the middle
layer into Application
Layer (Controller layer


queries, UI hooks,
etc.) and Domain Layer
(Business Logic


data
classes, algorithms).


Data layer can be XML,
SQL, Mnesia, etc…



Presentation (GUI) Layer


Contains the software components responsible for presenting
the user with an application interface, which reasonably
facilitates interaction of the user with the software product.



Which tools are you familiar with?

15

Introducing: NetBeans IDE


NetBeans is a Java Integrated Development Environment
which supports building GUI environments in a very
programmer
-
friendly manner, utilizing SWING.


NetBeans employs the “GUI that builds a GUI” work
environment.


Unlike in OOP, in this course we expect you to create a
Functional GUI but do not emphasize writing it ‘by hand’.


If this is the first time you’re writing Java GUI, this might help
you a lot.


Final project will demand GUI.


http://www.netbeans.org


16


Domain Logic Layer
(Application or Business Logic Layer)


Provides the services that implement the functionality
offered by the application.



This layer is the heart of the system (application).



During this course we will further elaborate on this layer.



The development process in this course is focused on this layer.

17



Persistence layer


Provides the services required to ensure the persistence
of the data involved in the execution of the application.



We will use Extensible Markup Language (XML).


Why?

18

Why XML?


Plain text document indicating an
order for 12 Birdsong Clocks, SKU
244:

19

Why XML?

(cont.)


An XML document indicating an order for
12
Birdsong Clocks,
SKU
244
:












Which is better??

20

Why XML?

(cont.)


XML is more understandable to humans.


Given proper names for nodes and attributes, the data’s schema is
more understandable.


XML is more understandable to machines.


That is, almost every programming language now ships with an XML
parser as part of it’s standard library!


XML is more generic


An XML parser can parse data for many applications.


We can easily add nodes and sub
-
nodes to an XML document, and add
more attributes to these nodes


the same way we add attributes to
our data classes.







More on this on the web…

21

Library Application


The XML file contain information about Library, Books and
Magazines. The application read data from XML, and write
data to XML again.

22

Library Application: Architecture

Presentation Layer

MainFrame class

Domain Logic Layer


actionOnLibary class

Paper class

Book class

Magazine class

Library class

DataManipulate class

XML

Persistence Layer
XMLUtilityManagment class

23

Improvement: Data Mapper


The
Data Mapper
is a layer of software that acts as a mediator
between the Domain logic and the Persistence (Data source).


Using
Data Mapper,
the in
-
memory objects need have no
knowledge that there's even a database present.


The domain logic (middle layer) will include no SQL interface
code, and certainly no knowledge of the database schema.


The database schema is always ignorant of the objects that use it.

24

One Last Note: Modeling Tools



During the course you will be requested to hand your
assignments with diagrams included.


Class Diagrams


Sequence Diagrams


State Machine Diagrams


There are many available tools to create these artifacts.


We recommend you use Visual Paradigm (license can be downloaded
from the website).


Direct link (updated
26
-
10
-
2011
):

www.visual
-
paradigm.com/downloads/vpsuite/VP_Suite_Windows.exe

25

Summary


Layers partitioning is a common practice to separate concerns
and increase maintainability.


The system normally could be separated to Presentation,
Domain logic, and Persistence.


The
Data Mapper
is a layer of software that acts as a mediator
between the in
-
memory objects and the database.


Questions?

26