• Nu S-Au Găsit Rezultate

Aspect Oriented Programming

N/A
N/A
Protected

Academic year: 2022

Share "Aspect Oriented Programming "

Copied!
54
0
0

Text complet

(1)

Course 5 – November 9 2017 Adrian Iftene [email protected]

(2)

Plan your second meeting with the person who coordinates the research practice!

Deadline: 8th week!

2

(3)

Recapitulation course 4

Modeling (EMF, IBM Rational Rose Modeler)

Business Process Modeling Notation

Introduction

Elements

Examples

Frameworks

Aspect Oriented Programming

Introduction

(4)

Modeling

◦ The Value of Modeling

◦ EMF

◦ IBM Rational Rose Modeler

4

(5)

Who?

What is modeling?

Why model?

(6)

6

EMF Ecore

(7)
(8)

BPMN - graphical representation for specifying business processes in a business process

modeling

BPMN was developed by Business Process

Management Initiative (BPMI), and is currently maintained by the OMG (http://www.bpmn.org/)

The objective of BPMN is to support business

process management for both technical users and business users

The current version of BPMN is 2.0.2

(http://www.omg.org/spec/BPMN/2.0.2/)

8

(9)

BPMN is based on a flowcharting technique very similar to activity diagrams from UML

The primary goal of BPMN is to provide a

standard notation that is readily understandable by all business stakeholders:

business analysts - who create and refine the processes

technical developers - responsible for implementing

business managers - who monitor and manage the processes

(10)

10

(11)
(12)

Event - something that happens

Catching - they might catch an incoming message to Start process

Throwing - they might throw a message at the End of the process

12

(13)

Activity - describes the kind of work which must be done

◦ Task - a single unit of work

◦ Sub-process - Used to hide or reveal additional levels of business process detail

◦ Transaction - A form of sub-process in which all contained activities must be treated as a whole

(14)

All contained activities must all be completed to meet an objective, and if any one of them fails they must all be compensated (undone)

14

(15)

A Gateway is represented with a diamond shape

and will determine forking and merging of paths

depending on the conditions expressed

(16)

A Sequence Flow shows in which order the activities will be performed

A Message Flow tells us what messages flow across organizational boundaries

An Association is used to associate an Artifact or text to a Flow Object

16

(17)

Swimlanes are a visual mechanism of organizing and categorizing activities

Pool - Represents major participants in a process (contains one or more lanes (like a real swimming pool)) A pool can be open (showing internal detail) or collapsed (hiding internal detail)

Lane - Used to organize and categories activities within a pool according to function or role. A lane contains the Flow Objects, Connecting Objects and Artifacts.

(18)

18

(19)

Artifacts allow developers to bring some more information into the model/diagram

Data Objects show the reader which data is required or produced in an activity

An Annotation is used to give the reader of the model/diagram an understandable

impression

A Group is used to group different

activities but does not affect the flow in the

(20)

20

(21)
(22)

22

(23)

Private (internal) business processes – are internal to a specific organization and are called workflow or BPM processes

Abstract (public) processes - represent the

interactions between a private business process and another process or participant

Collaboration (global) processes - A collaboration

(24)

24

(25)
(26)

26

(27)
(28)

Visio BPMN modeler

Microsoft Visio Professional 2010, 2013 (e-academy)

Intalio

Java, Eclipse

Jadex

Java, Eclipse

JBPM

Java, Apache Ant

28

(29)
(30)

30

(31)
(32)

32

(33)
(34)

34

(35)
(36)

36

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

(37)

Aspects emerged out of object-oriented programming and computational reflection

Aspects relate closely to subjects, mixings, delegation

Since at least the 1970s, developers have been using forms of interception and dispatch-patching

Designers have considered alternative ways to achieve separation of code, such as C#'s partial types, but

(38)

38

AOP as such has a number of antecedents: the Visitor Design Pattern, CLOS MOP (Common Lisp Object

System - Metaobject Protocol)

AspectJ developed by Gregor Kiczales and

colleagues at Xerox PARC (2001)

(39)

Hyper/J and Concern Manipulation Environment offered by IBM's research team in 2001 (which have not seen wide usage)

(40)

40

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

(41)

Even though most classes in an OO model will

perform a single, specific function, they often share common, secondary requirements with other

classes

For example, we may want to add logging to

classes within the data-access layer and also to classes in the UI layer whenever a thread enters or exits a method. Even though each class has a very different primary functionality, the code needed to

(42)

42

This is the additional code that you want to apply to your existing model

In our previous example, this is the logging code that we want to apply whenever the thread enters or exits a method.

(43)

This is the term given to the point of execution in the

application at which cross-cutting concern needs to be applied

In our previous example, a pointcut is reached when the

thread enters a method, and another pointcut is reached when the thread exits the method

(44)

44

The combination of the pointcut and the advice

In the example above, we add a logging aspect to our application by defining a pointcut and giving the correct advice.

(45)

Utility for aspect-oriented languages designed to take instructions specified by aspects and generate the

final implementation code

Takes information from raw class and aspects and creates new class => woven class

The weaver integrates aspects into the locations specified by the software as a pre-compilation step

(46)

46

AspectJ - the most mature and fully featured framework

JBoss AOP - is a 100% Pure Java usuable in any programming environment

Aspectwerkz (AW) - one of the quickest and most fully featured AOP frameworks available

Nanning - a simple yet scalable aspect-oriented

framework for Java (Nanning is also nice "little" town in Guanxi province in southern China)

(47)

Eclipse IDE + AJDT (http://www.eclipse.org/ajdt/)

Create “New” + “AspectJ Project” (AspectJ Development Tools)

(48)

48

(49)
(50)

50

AspectJ Plugin for NetBeans 6.7.x:

http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.j sp?pluginid=22964

Using the AspectJ Plug-In Module for NetBeans 6.0+:

http://www.jroller.com/ramlog/entry/using_the_aspectj_plug_in1

(51)
(52)

52

Use BPMN to create a business model, and use it in a new project component related to your project theme

Use AOP or MOP in your implementation

(53)

BPMN: http://www.bpmn.org/

BPMS Process Mapping BPM: http://interfacing.com/

Visio BPMN modeler Tutorial:

http://www.interfacing.com/uploads/File/Tutorial.pdf

Business process case studies:

http://interfacing.com/Literature/Business-process-case-studies/

Intalio: http://www.intalio.com/downloads

Jadex packages: http://jadex-processes.informatik.uni-

hamburg.de/xwiki/bin/view/Download/Available+Packages

Jadex Installation: http://jadex-processes.informatik.uni- hamburg.de/xwiki/bin/view/BPMN+Tutorial/02+Installation

(54)

54

AOP: http://onjava.com/pub/a/onjava/2004/01/14/aop.html, http://en.wikipedia.org/wiki/Aspect-oriented_programming

AspectJ: http://www.eclipse.org/aspectj/

AspectJ Downloads: http://www.eclipse.org/aspectj/downloads.php

Aspectwerkz (AW): http://aspectwerkz.codehaus.org/

Nanning: http://nanning.codehaus.org/

jBoss AOP: http://www.jboss.org/jbossaop

Spring AOP tutorial:

http://technologiquepanorama.wordpress.com/2009/05/18/spring- aop-tutorial-i/

AJDT: AspectJ Development Tools: http://www.eclipse.org/ajdt/

AOP in Netbeans:

http://www.jroller.com/ramlog/entry/using_the_aspectj_plug_in1

http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?

pluginid=22964

Framework for AOP in C#: http://rail.dei.uc.pt/

Referințe

DOCUMENTE SIMILARE

Locations of the tibial nerve, popliteal artery, vein (b), and medial sural cutaneous nerve (c), and safe angles for nee- dle insertion (d).. n: tibial nerve, a: popliteal artery,

1. Enlarged spinoglenoid notch veins causing suprascapular nerve compression. Dynamic ultrasonogra- phy of the shoulder. Lafosse L, Tomasi A, Corbett S, Baier G, Willems K,

ductal orifice, and presence of a sphincter-like mecha- nism in the distal 3 cm of the duct [2].In the last four dec- ades, 22 cases with foreign bodies in the submandibular

1 Department of Physical Medicine and Rehabilitation, National Taiwan University Hospital, Bei Hu Branch and National Taiwan University College of Medicine, Taipei, Taiwan,

Transverse (a) and longitudinal (b) transvaginal ultrasound exhibit an isoechoic solid mass measuring 4 cm in size, with mul- tiple intralesional echogenic foci (arrows) and

The diagnostic accuracy of US could be improved in combination with CEUS (65.3% vs 83.7%). The diagnostic accuracy of the GB wall thickening type was higher than the mass forming

The best performance, considering both the train and test results, was achieved by using GLRLM features for directions {45 ◦ , 90 ◦ , 135 ◦ }, GA feature selection with DT and

Faced with the possible insurrection of the body and of the sensible in general, and in order to surpass the possible nefarious consequences of such a logical dead end, (clear