Curs 4 Adrian Iftene Adiftene@info.uaic

Transcription

Curs 4 – 25 Octombrie 2010Adrian Ifteneadiftene@info.uaic.ro

Portalul este funcțional! Tot ce ați lucrat pânăacum să puneți pe portal: State-of-the-art – ca pdf Ingineria cerințelor – ca pdf Diagrame UML – ca imagini (jpg) SVN-ul este funcțional! Tot ce veți lucra deacuma să puneți acolo și să-mi dați drepturi decitire!Termen limită: 27 Octombrie2

Planificați-vă a doua întâlnire cu persoana carevă coordonează la practica de cercetare!Termen limită săptămâna a 8-a!3

Recapitulation course 3 Modeling (EMF, IBM Rational Rose Modeler) Business Process Modeling Notation IntroductionElementsExamplesFrameworksAspect Oriented Programming Introduction Terminology Frameworks AspectJ (for Eclipse and Netbeans)4

Modeling The Value of Modeling EMF IBM Rational Rose Modeler5

Who? What is modeling? Why model?6

EMF Ecore7

8

BPMN - graphical representation for specifyingbusiness processes in a business processmodelingBPMN was developed by Business ProcessManagement Initiative (BPMI), and is currentlymaintained by the OMG (http://www.bpmn.org/)The objective of BPMN is to support businessprocess management for both technical users andbusiness users The current version of BPMN is 1.2, with a majorrevision process for BPMN 2.0 in progress (Beta 2)9

BPMN is based on a flowcharting technique verysimilar to activity diagrams from UMLThe primary goal of BPMN is to provide astandard notation that is readily understandableby all business stakeholders: business analysts - who create and refine the processes technical developers - responsible for implementing business managers - who monitor and manage theprocesses Business Process Execution Language executionlanguages10

Flow Objects Events, Activities,Gateways Connecting Objects Sequence Flow, MessageFlow, Association Swimlanes Pool, Lane Artifacts (Artefacts) Data Object, Group,Annotation11

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 process13

Activity - describes the kind ofwork which must be done Task - a single unit of work Sub-process - Used to hide or revealadditional levels of business processdetail Transaction - A form of sub-process inwhich all contained activities must betreated as a whole14

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

A Gateway is represented with a diamond shapeand will determine forking and merging of pathsdepending on the conditions expressed16

A Sequence Flow shows in which order the activities willbe performedA Message Flow tells us what messages flow acrossorganizational boundariesAn Association is used to associate an Artifact or text toa Flow Object17

Swimlanes are a visual mechanism of organizing andcategorizing activities Pool - Represents major participants in a process (contains oneor 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 poolaccording to function or role. A lane contains the Flow Objects,Connecting Objects and Artifacts.18

19

Artifacts allow developers to bringsome more information into themodel/diagram Data Objects show the reader which data isrequired or produced in an activity A Group is used to group differentactivities but does not affect the flow in thediagram An Annotation is used to give the reader ofthe model/diagram an understandableimpression20

21

22

23

Private (internal) business processes – are internal to aspecific organization and are called workflow or BPMprocessesAbstract (public) processes - represent theinteractions between a private business process andanother process or participantCollaboration (global) processes - A collaborationprocess depicts the interactions between two or morebusiness entities.24

25

26

27

Visio BPMN modeler Microsoft Visio Professional 2010 (e-academy) Intalio Java, Eclipse Jadex Java, Eclipse JBPM Java, Apache Ant28

29

30

31

32

33

34

35

AOP is a programming paradigm which isolates secondary orsupporting functions from the main program’s business logicAOP increases modularity by allowing the separation of crosscutting concernsAOP includes programming techniques and tools that supportthe modularization of concerns at the level of the source code36

Aspects emerged out of object-oriented programmingand computational reflectionAspects relate closely to subjects, mixings, delegationSince at least the 1970s, developers have been usingforms of interception and dispatch-patchingDesigners have considered alternative ways to achieveseparation of code, such as C#'s partial types, butsuch approaches lack a quantification mechanism thatallows reaching several join points of the code withone declarative statement37

AOP as such has a numberof antecedents: the VisitorDesign Pattern, CLOS MOP(Common Lisp ObjectSystem - MetaobjectProtocol)AspectJ developed byGregor Kiczales andcolleagues at Xerox PARC(2001)38

Hyper/J and Concern Manipulation Environment offeredby IBM's research team in 2001 (which have not seenwide usage)EmacsLisp changelog added AOP related code in version19.2839

Cross-cutting concerns - aspects of a program whichaffect other concernsAdvice - additional codePointcut - point where additional code is executedAspect - the combination of the pointcut and theadvice40

Even though most classes in an OO model willperform a single, specific function, they often sharecommon, secondary requirements with otherclassesFor example, we may want to add logging toclasses within the data-access layer and also toclasses in the UI layer whenever a thread enters orexits a method. Even though each class has a verydifferent primary functionality, the code needed toperform the secondary functionality is oftenidentical.41

This is the additional code that you want to applyto your existing modelIn our previous example, this is the logging codethat we want to apply whenever the thread entersor exits a method.42

This is the term given to the point of execution in theapplication at which cross-cutting concern needs tobe appliedIn our previous example, a pointcut is reached whenthe thread enters a method, and another pointcut isreached when the thread exits the method43

The combination of thepointcut and the adviceIn the example above, weadd a logging aspect toour application bydefining a pointcut andgiving the correct advice.44

An open source application framework for JavaThe first version (Rod Johnson) was released with thepublication of book Expert One-on-One J2EE Designand Development in October 2002The framework was first released under the Apache2.0 license in June 2003. The current version is 3.0.4The core features can be used by any Java application,but there are extensions for building web applicationson top of the Java EE platformIt is very popular in the Java community as analternative to, replacement for, or even addition to theEnterprise JavaBean (EJB) model45

Inversion of Control containerAspect-oriented programmingData accessTransaction managementModel-view-controllerRemote Access frameworkConvention-over-configurationBatch processingAuthentication and authorizationRemote ManagementMessagingTesting46

Join point: a point during the execution of a program Introduction: declaring additional methods or fields onbehalf of a type Target object: objectbeing advised by oneor more aspects AOP proxy: an objectcreated by the AOPframework in order toimplement the aspectcontracts 47

A point during the execution of a program, such asthe execution of a method or the handling of anexceptionA set of join points is described as a pointcutIn Spring AOP, a join point always represents amethod executionIn my words: a locus of points where execution willhappen48

Declaring additional methods or fields on behalf of atypeSpring AOP allows you to introduce new interfaces(and a corresponding implementation) to any advisedobjectFor example, you could use an introduction to make abean implement an IsModified interface, to simplifycachingAn introduction is known as an inter-type declarationin the AspectJ community49

Object being advised by one or moreaspectsAlso referred to as the advised objectSince Spring AOP is implementedusing runtime proxies, this object willalways be a proxied object50

An object created by the AOP framework in order toimplement the aspect contracts (advise methodexecutions and so on)For example, in the Spring Framework, an AOP proxywill be a JDK dynamic proxy or a CGLIB proxy51

Utility for aspect-oriented languages designed to takeinstructions specified by aspects and generate thefinal implementation codeTakes information from raw class and aspects andcreates new class woven classThe weaver integrates aspects into the locationsspecified by the software as a pre-compilation step52

AspectJ - the most mature and fully featuredframeworkJBoss AOP - is a 100% Pure Java usuable in anyprogramming environmentAspectwerkz (AW) - one of the quickest and mostfully featured AOP frameworks availableNanning - a simple yet scalable aspect-orientedframework for Java (Nanning is also nice "little"town in Guanxi province in southern China)53

Eclipse IDE AJDT (AspectJ Development Tools)Create “New” “AspectJ Project”54

55

aspectpointcutadvice56

AspectJ Plugin for NetBeans es/PluginDetailPage.jsp?pluginid 22964Using the AspectJ Plug-In Module for NetBeans 6.0 :http://www.jroller.com/ramlog/entry/using the aspectj plug in157

58

Use BPMN to create a business model, and use it ina new project component related to your projectthemeUse AOP or MOP in your implementation59

BPMN: http://www.bpmn.org/BPMS Process Mapping BPM: http://interfacing.com/Visio BPMN modeler utorial.pdfBusiness process case -process-case-studies/Intalio: http://www.intalio.com/downloadsJadex packages: iki/bin/view/Download/Available PackagesJadex Installation: iki/bin/view/BPMN Tutorial/02 InstallationjBPM: http://jboss.org/jbpm60

AOP: ,http://en.wikipedia.org/wiki/Aspect-oriented programmingAspectJ: http://www.eclipse.org/aspectj/AspectJ Downloads: werkz (AW): http://aspectwerkz.codehaus.org/Nanning: http://nanning.codehaus.org/jBoss AOP: http://www.jboss.org/jbossaopSpring AOP m/2009/05/18/springaop-tutorial-i/AJDT: AspectJ Development Tools: http://www.eclipse.org/ajdt/AOP in Netbeans:http://www.jroller.com/ramlog/entry/using the aspectj plug PluginDetailPage.jsp?pluginid 22964Framework for AOP in C#: http://rail.dei.uc.pt/61

Portalul este funcțional! Tot ce ați lucrat până acum să puneți pe portal: State-of-the-art -ca pdf Ingineria cerințelor-ca pdf