• Nenhum resultado encontrado

An Aspect-Oriented Implementation Method

N/A
N/A
Protected

Academic year: 2022

Share "An Aspect-Oriented Implementation Method"

Copied!
41
0
0

Texto

(1)

1

An Aspect-Oriented

Implementation Method

Sérgio Soares CIn – UFPE

Orientador: Paulo Borba

(2)

Motivation

OOP allows modularization/separation of concerns

Reuse, maintainability, and productivity

User interface, distribution, business logic, and data management

but has limitations ...

(3)

3

The major problem

OO limitations

Spread code

several units to implement a concern

Tangled code

several concerns mixed in a single unit

Design patterns can help, but are

limited

(4)

Concerns spread and tangled with

business logic, UI, and with each other

concurrency control

distribution

data management

OO information system

using design patterns

(5)

5

The major problem

User interface Distribution

Business logic

Data management Concurrency control

(6)

User interface Distribution

Business logic

Data management

The major problem

(7)

7

How can we

avoid those OO limitations?

support developers?

increase productivity?

Research

(8)

Using aspect-oriented programming (AOP)

User interface Distribution

Business logic

Data management

(9)

9

Using aspect-oriented programming (AOP)

User interface Distribution

Business logic

Data management Concurrency control

(10)

AspectJ – aspect-oriented

programming with Java

(11)

11

Joint point model

object A

object B

and returns or throws

a method is called

dispatch dispatch

a method is called

and returns or throws a method executes and returns

or throws

a method executes and returns or throws

Behavior might be

changed at join points…

Source: AspectJ Tutorial aspectj.org

(12)

Advices

Define additional code that should be executed…

before

after

after returning

after throwing

or around

specified join points

(13)

13

Static crosscutting

Change types hierarchy

Add new members to types

Define compile-time errors and warnings

Wrap checked exceptions into

unchecked ones

(14)

Define an implementation method to

deal with several concerns

UI, distribution, business logic, data management, and concurrency control

complement programming techniques and design patterns

support developers

deal with aspect-oriented software development

AspectJ

Research

(15)

15

Aspect-oriented development

Software requirements

Concern identifier

AOP OOP

Aspects Classes

Interfaces Executable

software W

E A V E R Concerns

UI and business logic use OOP

Distribution, data management, and

concurrency control use AOP

(16)

Towards an aspect-oriented implementation method

A case study restructuring an OO software to an AO software

AOP is useful

suggestion of AspectJ improvements

dependencies and impacts between aspects

distribution vs. data management

aspect framework and patterns to implement the concerns

(17)

AspectJ framework

DM CC

D

Synchronization

<<Aspect>>

PessimisticSynchronization<<Aspect>>

OptimisticSynchronization<<Aspect>>

ConcurrencyManager

PersistenceControl

<<Aspect>>

TransactionControl

<<Aspect>>

DataCollectionCustomization

<<Aspect>>

IPersistenceMechanism

ClientSide

<<Aspect>>

ServerSide

<<Aspect>>

Remote (from java.rmi) TimestampedType

Timestamp

<<Aspect>>

OptimizedTimestamp

<<Aspect>>

TimestapedRepository

(18)

Implementation method

Tailored to a specific software architecture

already used in several real OO information systems

allows more precise guidelines

some types can be automatically generated

tool support

(19)

IPersistenceMechanism connect()

disconnect() beginTransaction() commitTransaction() rollbackTransaction() getCommunicationChannel() releaseCommunicationChannel()

HttpServlet

<<UserInterface>>

HWPersistenceMechanism

<<PersistenceMechanism>>

ComplaintRepositoryRDBMS

<<PersistentDataCollection>>

Complaint getCode()

<<BusinessBasic>>

ComplaintRepositoryArray

<<NonpersistentDataCollection>>

IComplaintRepository insert(Complaint)

remove(code) update(Complaint) search(code) : Complaint ServletUpdateComplaint

<<UserInterface>>

ComplaintRecord update(Complaint)

<<BusinessCollection>>

HWFacade

<<Facade>>

<<Business-DataInterface>>

<<PersistenceMechanismInterface>>

(20)

Implementation method

An alternative implementation approach

non-functional requirements initially abstracted

distribution, persistence, and concurrency control

allows early functional requirements validation

can increase productivity

decreases tests complexity

(21)

21

Implemented concerns

time

x y

a a a a a b a b a b a b

Regular approach

User interface Distribution

Functional requirements

Persistent data management Concurrency control

Milestone (end of iteration)

a and b are use cases, sets of use cases, or use-cases scenarios

(22)

User interface Distribution

Functional requirements

Persistent data management

Non-persistent data management

Milestone (end of iteration) Functional iteration

Progressive approach

Implemented concerns

time

a a a a

x’ y’

b b b b

a a a a

a and b are use cases, sets of use cases, or use-cases

(23)

23

Implementation method

How to combine with use-case driven development and RUP

impact on the process dynamics

use of the progressive approach

impact on its activities

management, requirements, analysis and design, implementation, and test

changes and new activities

(24)

Combining with RUP

Implementer Client

Implement Component

Implement Persistence

Implement Distribution

Control Concurrency

... ...

Architect Project

Manager Designer

Validate Functional Prototype

Implementer

(25)

25

New activity example

Validate Functional Prototype

Purpose: validating the functional prototype in order to identify possible requirement changes.

Steps: ...

Input artifacts: The prototype implemented in the Implement Component activity.

Resulting artifacts: A list of requirement changes or a document stating the prototype validation without changes.

Workers: ...

(26)

Experimentation

Formal study with graduate students

analysis of the progressive approach

implementation time

requirements change time

test execution time

pre-validation prototype time

post-validation prototype time

using some use cases of a real software

did not consider concurrency control

(27)

27

Experimentation

Null hypothesis

The times using a progressive approach for aspect-oriented development are not

different than using a non-progressive approach

(28)

Subjects expertise - academic

Expertise

(29)

29

Subjects expertise - industrial

Expertise

1 - OITC 2 - < 6m 3 - 6m-2y 4 - 2y-4y 5 - 4y-6y 6 - > 6y

(30)

Study

Analysis

t-test

some differences were statistically significant and others were not

times to implement and test

(31)

31

Study data – times to change requirements

-89% -56%

(32)

Study data – time to deliver executable prototypes

-75%

-72% -66%

(33)

33

Study data – times do deliver

first usable/testable prototype

(34)

Study

Results using the progressive approach

requirements changes and times to deliver executable prototypes were faster

programmers felt easier to implement and test

some differences to the regular approach were not significant

not enough participants

low degree of precision (confidence interval)

Framework to perform others experiments

(35)

35

Study

Other conclusions

the progressive approach might be more effective with more complex changes

implementation and tests times were not different

less implementation and test complexity through separation of concerns

(36)

Tool support

Aspect generation based on the aspect framework and patterns

Extension of an existing tool and

language for Java transformation with AspectJ

allows, in the future, to define aspect refactorings

(37)

37

Tool support

Eclipse plug-in Transformation

engine – AJaTS

AJaTS

Transformations descriptions

AJaTS

Transformations descriptions Software Java

source files Software Java

source files

AspectJ framework

Generated aspects Generated

aspects Programmer

(38)

Conclusions

Implementation method

activities, implementation approaches, guidelines

inserted into a real development process

Aspects can affect each other

distribution aspects affect data management aspects

analysis and design are essential to identify those possible interferences

(39)

39

Conclusions

Aspect patterns and framework

reuse

Experiments

guide the implementation method

study framework

Tool support

productivity increase

aspect refactoring in the future

(40)

Future work

Extend the implemented aspects

Identify new concerns to implement as aspects

functional aspects?

Refactoring of aspect-oriented software

from OO or AO

from AO to AO

(41)

41

Research group

Software Productivity Group

http://www.cin.ufpe.br/spg

Referências

Documentos relacionados

Para tanto, foram estabelecidos dois passos e a osteoporose foi analisada por densitometria óssea aos 0, 21, 45 e 60 dias após a cirurgia e por análises histológicas de ossos

O alto percentual de estudantes homens agrupados em torno da cor negra, que trabalham, contribui para reforçar análises já realizadas de que os jovens homens negros e pobres são

The Vision module provides information for local navigation: the heading direction to keep the user within safe boundaries in corridors and paths includ- ing

Dada a importância das culturas anuais e forrageiras para a região (Santos et al., 2018), procedeu- se a avaliação do desempenho agronômico de cultivares de milho, sorgo,

Abbreviations used: F-actin, filamentous actin; FCS, fetal calf serum; GDI, GDP dissociation inhibitor; GDP, guanosine diphosphate; GFP, enhanced green fluo- rescent protein;

As lizarditas são minerais primários nessas rochas e ao contrário das esmectitas, estão mais associadas aos poços localizados sobre dunitos (SFTP-050S e SFDD-003) estando

Foram utilizadas as 12 interpolações disponíveis (Data Metrics, Inverse Distance, Kriging, Local Polynomial, Minimum Curvature, Modified Shepard Method, Moving Average,

A problemática é pertinente pois a ideia subjacente à mesma, passa por perceber o que o valoriza uma família quando procura um alojamento para pernoitar durante