• Nu S-Au Găsit Rezultate

Design Principles and Design Patterns.

N/A
N/A
Protected

Academic year: 2022

Share "Design Principles and Design Patterns. "

Copied!
25
0
0

Text complet

(1)

Course 1 – October, 12, 2020 Adrian Iftene [email protected]

(2)

SWEBOK: place and role of software engineering, knowledge areas (KAs), related disciplines

Development and maintenance of the systems:

model driven agile development, patterns of enterprise application architecture, test-driven development, refactoring: code architecture

Object oriented design classes: SOA, object- oriented design principles, Serverless

Modeling, business modeling: BPMN, domain

(3)

Model-driven development (MDD) - software methodology focused on creating models close to a specific field than informatics concepts

Model-driven architecture (MDA) is the best known initiative of MDD and was launched by the group OMG (Object Management Group) in 2001

3

(4)

AMDD is agile version of MDD

(5)

Test-Driven Development – TDD

TDD steps:

1. Add a test.

2. Execut tests; the new test will fail.

3. Add functional code such that pass all test.

4. Run tests again.

If the test fails, go to 3.

If the tests pass successfully, we can continue with other functionality

5. Refactoring code (functional and testing)

5

(6)

IBM Rational Rose Modeler

BPMN

Domain specific languages (DSL)

Working frameworks:

Eclipse Modeling Framework

Open Architecture Ware (OAW)

(7)

Business Process Modelling Notation (BPMN) is a graphical representation for specifying business processes in a workflow

7

(8)
(9)

EMF is an Eclipse-based modeling framework and code generation facility for building tools and other applications based on a

structured data model

9

(10)

AOP is a programming paradigm which isolates secondary or supporting functions from the main program’s business logic

AOP increases modularity by allowing the separation of cross- cutting concerns

AOP includes programming techniques and tools that support the modularization of concerns at the level of the source code

(11)

11

Cross-cutting concerns - aspects of a program which affect other concerns

Advice - additional code

Pointcut - point where additional code is executed

Aspect - the combination of the pointcut and the advice

(12)

Examples:

AspectJ,

CaesarJ,

CLOS,

Compose,

JAsCo,

ObjectTeams

(13)

13

aspect

pointcut

advice

(14)

Problem: we want to know when something changes the student (name or grade)

Solution: we add a pointcut for all “set” methods

(15)

15

Problem: we want to trace our program execution

Solution: we add a pointcut for all methods

set

println

toString

(16)

SOA (Service Oriented Architecture) involves distributing application functionality into

smaller units, distinct - called services - which can be distributed over a network and can be used together to create complex applications

Services are independent functional units that solve specific problems and can be combined to solve complex problems.

(17)

Examples of services:

complete an application online to create an account view a bank statement

make an online ticket orders

For a robot: services for vision, hearing, moved

17

(18)
(19)

Architecture and dependencies:

When we say that we have a degraded project?

Design principles of classes:

responsibility, dependencies, separation

Architecture design principles:

Reuse, versioning, closing

Coupling, dependence

Object-oriented design patterns:

Abstract server, Adapter, Observer, Bridge, Abstract Factory

19

(20)

Rigid - hard to change

Fragile - changes have undesirable effects

Immobility - separation into components is difficult

Viscous - things not running to properly

Additional complexity

Additional repetition

Opacity - hard to understand

(21)

Successive changes lead to sub-optimal code structure

increase the complexity

decreases clarity

Refactoring is a change in the internal structure of a software product in order to make it easier to understand and modify without changing its observable behavior

Results:

decreased coupling

increasing cohesion

21

(22)

The following situations are signals for refactoring:

duplicate code

long methods

large classes

Long lists of parameters

Instructions switch by type objects - is recommended polymorphism

Speculative Generality - Hierarchy of classes that subclasses have the same behavior

Intense communication between objects (strong

(23)

Github – code

GoogleDrive - documents

(24)

SOA: http://www-01.ibm.com/software/solutions/soa/ , http://ro.wikipedia.org/wiki/SOA

SOA for the real world: http://www.javaworld.com/javaworld/jw- 11-2006/jw-1129-soa.html?page=1

Abstract Server

http://today.java.net/pub/a/today/2004/06/8/patterns.html

Agile Model Driven Development (AMDD)

http://www.agilemodeling.com/essays/amdd.htm

Florin Leon – IP Curs 11

http://eureka.cs.tuiasi.ro/~fleon/Curs_IP/IP11_Implementarea.pdf

OAW http://www.openarchitectureware.org/

(25)

Robert Cecil Martin:

Design Principles and Design Patterns.

www.objectmentor.com.

Robert Cecil Martin:

Agile Development.

Principles, Patterns, and Practices,

Prentice-Hall, 2003

25

Referințe

DOCUMENTE SIMILARE

 O clasă care face multe lucruri care nu sunt relaționate sau face prea multe lucruri are o coeziune mică (slabă)..  Sunt principii vechi în

developed and evolved over time” (GOF - Gang-Of- Four (because of the four authors who wrote it), Design Patterns: Elements of Reusable Object- Oriented Software).  In

 Prefer small, cohesive interfaces - Interface is the interface type + All public members of a class.  Divide "fat" interfaces into

 Erich Gamma, Richard Helm, Ralph Johnson, John Vissides: Design Patterns, Elements of Reusable Object-Oriented Software, Addisson

 DSL is a programming language or specification language dedicated to a particular problem domain , a particular problem representation technique , and/or a particular

 DSL is a programming language or specification language dedicated to a particular problem domain , a particular problem representation technique , and/or a particular

◦ Join point is within the called method, before any code is executed pointcut inFoo() : execution( public void setName(String) );..  Problem: we want to know when something

 Erich Gamma, Richard Helm, Ralph Johnson, John Vissides: Design Patterns, Elements of Reusable Object-Oriented Software, Addisson Wesley, 1998.