Towards Separation of Concerns in Flow-Based Programming Bahram - - PowerPoint PPT Presentation

towards separation of concerns in
SMART_READER_LITE
LIVE PREVIEW

Towards Separation of Concerns in Flow-Based Programming Bahram - - PowerPoint PPT Presentation

Towards Separation of Concerns in Flow-Based Programming Bahram Zarrin Hubert Baumeister FOAL 2015 Flow Based Programming Invented by J. Paul Morrison in the early 1970s Models software systems as a directed graph of predefined


slide-1
SLIDE 1

Towards Separation of Concerns in Flow-Based Programming

Bahram Zarrin Hubert Baumeister FOAL 2015

slide-2
SLIDE 2

Flow Based Programming

  • Invented by J. Paul Morrison in the early 1970s
  • Models software systems as a directed graph of predefined processes

which run asynchronously and exchange data through input and output ports.

  • Atomic or composite process, ports, connections, scheduler
  • Implementation (C#FBP, CppFBP, JavaFBP)

B C D

  • 1

in

  • 2
  • 1
  • 1

A in in2 in1

slide-3
SLIDE 3

Motivation

  • There are concerns in software systems which cannot be modularized

well in FBP.

  • Examples
  • Logging
  • Life Cycle Assessment
  • Costing
slide-4
SLIDE 4

Logging

a) P2 P1 P3

slide-5
SLIDE 5

Logging

Log P2 Log P1 Log P3 Log b) Log

slide-6
SLIDE 6

Waste Management Modeling

slide-7
SLIDE 7

Waste Management Modeling

a) WP2 WP1 WP3

slide-8
SLIDE 8

Waste Management Modeling

LCA WP2 LCA WP1 LCA WP3 + + b)

slide-9
SLIDE 9

Cross-Cutting Problem in FBP

  • Tangled and scattered process definitions.
  • On the one hand, one process addresses several concerns. On the other

hand, the implementation of a single concern is scattered through many places in the other process definitions.

Log P2 Log P1 Log P3 Log b) Log

LCA WP2 LCA WP1 LCA WP3 + + b)

slide-10
SLIDE 10

Extending FBP with Aspect-Oriented Concepts

  • Aspect-Oriented Flow-Based Programming (AOFBP)
  • Join Point Model and Pointcut Language
  • Advice
  • Weaving
  • Tool Support
  • AOC#FBP
slide-11
SLIDE 11

AOFBP Join Point Model

P2 P1 P3 P4 P5 aspect A pointcut

slide-12
SLIDE 12

AOFBP Pointcut Language

procType("*foo") & inPort("*","int","2") & inCon(procType("*foo"),"2..4") <PortDesignator> ::= inPort (<String>,<String>,<String>) |outPort (<String> , <String> , <String>) |port (<String> , <String> , <String>) <LevelDesignator> ::= level (<String>) <ContextDesignator> ::= child (<PointcutExp> , <String>) |parent (<PointcutExp> , <String>) <ConDesignator> ::= inCon (<PointcutExp> , <String>) |outCon (<PointcutExp> , <String>) <Designator> ::= procType (<String>) |<PortDesignator>|<LevelDesignator> |<ContextDesignator>|<ConDesignator> <ParExpr> ::= (<PointcutExp>) <UnNot> ::= ^<PointcutExp> <BinAnd> ::= <PointcutExp> & <PointcutExp> <BinOr> ::= <PointcutExp> ‘|’ <PointcutExp> <BinExpr> ::= <BinAnd>|<BinOr> <PointcutExp> ::= <Designator> |<Identifier>|<ParExpr>|<UnNot>|<BinExpr>

slide-13
SLIDE 13

AOFBP Advice

A P P

slide-14
SLIDE 14

AOFBP Advice

Before After Around

  • Observer
  • Adaptor
  • Collector

A P A P A P A P P A A Pn P1 A P2

slide-15
SLIDE 15

AOFBP Network Definition

<Attribute> ::= name |type |parent <PortFilter> ::= in (<String> , <String>) |out (<String> , <String>) <PortCtor> ::= <Identifier> (<Type>) <ProcRef> ::= <Identifier>() <Param> ::= <Identifier> = <Value> <ParamList> ::= <ParamList> , <Param> | <Param> <ProcCtor> ::= <Identifier> (<ComponentID>) |<Identifier> (<ComponentID> : <ParamList>) <ProcExp> ::= <ProcRef> |<ProcCtor> |<Connection> |this <Value> ::= <ProcExp> [<Attribute>] |<Number> |<String> |<Object> <InExp> ::= <Identifier> <ProcExp> |<PortCtor> <OutExp> ::= <ProcExp> <Identifier> |<ProcExp> <PortFilter> |<PortCtor> |<Value> <Connection> ::= <OutExp> -> <InExp> <Network> ::= <Network> ; <Connection> | <Connection> <NetworkDef> ::= network <ComponentID> <Network> end

network sample "some data" -> X P1(Componenet1); P1() Y -> Z P2(Component2) K -> R P3(Component3); end

slide-16
SLIDE 16

AOFBP Aspect

<NamedPortFilter> ::= <PortFilter> as <Identifier> <PortFilterList> ::= <PortFilterList> , <NamedPortFilter> |<NamedPortFilter> <AdviceType> ::= before |after |around <Collector> ::= collector <Identifier> (<PortFilterList>) : <PointcutExp> <Network> end <Observer> ::= observer <Identifier> <AdviceType> : <PointcutExp> <Network> end <Adapter> ::= adapter <Identifier> <AdviceType> : <PointcutExp> <Network> end <AdviceDef> ::= <Observer>|<Adapter>|<Collector> <PonitCutDef> ::= pointcut <Identifier> : <PointcutExp> <Statement> ::= <PonitcutDef>|<AdviceDef> <StatementList> ::= <StatementList> ; <Statement> |<Statement> <Aspect> ::= aspect <Identifier> <StatementList> end

slide-17
SLIDE 17

AOFBP Architecture

AOFBP# Engine Aspect files Aspect files AOFBP# Scheduler AOFBP# Weaver C#FBP Scheduler C#FBP Components C# AOFBP# Aspects C#FBP Networks Aspect files Aspect files Aspect files Network files C#FBP Engine

slide-18
SLIDE 18

Examples

aspect logging pointcut all_processes: procType("*");

  • bserver logger before: all_processes

this in("*","*") -> arguments L(Logger : name= this [name], type= this [type]) end end

slide-19
SLIDE 19

Examples

aspect LCA pointcut p: inPort("*","waste","1..*");

  • bserver process_LCA () before : p & ^isComposite

this in("*","waste") -> WASTE_IN lca_process( LCAComponent: p_name= this [name], p_type = this [type]); lca_process() LCA -> LCA (LCA) end; collector composite_LCA(out("LCA","LCA") as inventory): p & isComposite inventory -> values AP(aggregation); AP() result -> LCA (LCA) end end

slide-20
SLIDE 20

Related Work

  • At the moment none of the FBP implementations have addressed the

cross-cutting-concerns and provided mechanisms to implement them. PyF, DSPatch, Pypes , and NoFlo.

  • AO4BPEL (A. Charfi and M. Mezini. 2007) improves the modularity and

increases the flexibility of Web Service composition.

  • Composition Filters (L. Bergmans and M. Aksit. 2001) provides

separation of concerns for object-based systems.

slide-21
SLIDE 21

Conclusion

  • Address the cross-cutting concerns in FBP.
  • Propose an aspect-oriented approach to FBP called AOFBP to support

aspect-oriented concepts in FBP.

  • Provide means to specify sub graphs of the processes in a network as

join points and to add mechanisms for advice to substitute the subgraph with alternatives as future works.