Upload
clarktony
View
464
Download
1
Embed Size (px)
DESCRIPTION
Citation preview
LEAPA Language for Architecture Design, Simulation and
Analysis
Tony Clark1, Balbir S. Barn1, Samia Oussena2
1Middlesex University, London, UK2School of Computing, University of West London, UK
April 18, 2012
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 1 / 44
Plan
Problem, Hypothesis, Solution.
LEAP.
Use-Cases.
LEAP-based Research Areas
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 2 / 44
Architectural Complexity
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 3 / 44
Proposal
Identify the key features:I Components, port, connectors.I Information models, highly structured data.I Specification of behaviour, state machines.I High-level operations, complex where necessary.I Event processing.I Simulation.I Text for definition, diagrams for understanding.
Identify use-cases.
Incrementally extend features as necessary.
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 4 / 44
The LEAP Tool
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 5 / 44
Data Models
component library {
model {
class Reader {
name:str}
class Book {
name:str}
assoc Borrow {
reader:Reader;
book:Book
}
}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 6 / 44
Syntax Checking
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 7 / 44
Invariants
component library {
model {
class Reader { name:str }
class Book { name:str }
assoc Borrow {
reader:Reader;
book:Book
}
}
invariants {
reader_can_borrow_3_books {
forall Reader(n) in state {
(length([n | Borrow(Reader(n),_) <- state ])) <= 3
}
}
}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 8 / 44
State
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 9 / 44
State
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 10 / 44
Ports and Interfaces
model {
class Reader { name:str }
class Book { name:str }
assoc Borrow {
reader:Reader;
book:Book
}
}
port manage_readers[in]: interface {
register(r:str):void}
port manage_books[in]: interface {
borrow(r:str, b:str):void}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 11 / 44
Specifications
component library {
model { // Reader, Book, Borrow...
}
// ports manage_readers, manage_books...
spec {
register(r:str):void {
pre not(Reader(r))post Reader(r)
}
borrow(r:str,b:str):void {
pre Reader(r) Book(b) not(Borrow(_,Book(b)))post Borrow(Reader(r),Book(b))
}
}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 12 / 44
Operationscomponent library {
model { // Reader, Book, Borrow...
}
// ports manage_readers, manage_books...
operations {
register(r) {
new Reader(r)
}
borrow(r,b) {
find reader=Reader(r) in state {
find book=Book(b) in state {
find Borrow(_,book) in state {
error(’book ’ + b + ’ already borrowed’)
} else new Borrow(reader,book)
} else error(’no book: ’ + b)
} else error(’no reader: ’ + r)
}
}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 13 / 44
Simulation 1
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 14 / 44
Simulation 2
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 15 / 44
Simulation 3
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 16 / 44
Simulation 4
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 17 / 44
Simulation 5
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 18 / 44
Simulation 6
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 19 / 44
Simulation 7
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 20 / 44
Data Representation
model {
class Faculty {
name:str;schools:[Department]
}
class Department {
name:str;groups:[Group]
}
class Group {
name:str;members:[Staff]
}
class Staff {
name:str;age:int
}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 21 / 44
Constructing Trees
init {
new Faculty(’Engineering’,[
Department(’Maths’,[
Group(’Pure’,[
Staff(’Dr. Piercemuller’,60),
Staff(’Dr. Eager’,30)
]),
Group(’Applied’,[
Staff(’Prof. Lappin’,57),
Staff(’Mr. Qip’,40)
])
]),
Department(’Computing’,[])
])
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 22 / 44
Comprehensions
operations {
staff_names() {
[ name | Faculty(_,departments) <- state,Department(_,groups) <- departments,
Group(_,staff) <- groups,
Staff(name,_) <- staff ]
}
staff_over(age) {
[ name | Faculty(_,departments) <- state,Department(_,groups) <- departments,
Group(_,staff) <- groups,
Staff(name,staff_age) <- staff,
?(staff_age > age) ]
}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 23 / 44
Recursive Functions
operations {
staff_names() {
letrec get_names =
fun(data)case data {
[] -> [];
h:t -> (get_names(h))+get_names(t);
Faculty(_,departments) -> get_names(departments);
Department(_,groups) -> get_names(groups);
Group(_,staff) -> get_names(staff);
Staff(name,_) -> [name]
}
in get_names(state)}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 24 / 44
Rulescomponent order_processing {
port authorization[in]: interface {
finance(id:int):void;manager(id:int):void;procurement(id:int):void
}
port dispatch[out]: interface {
order(id:int):void}
operations {
finance(id) { new Finance(id) }
manager(id) { new Manager(id) }
procurement(id) { new Procurement(id) }
}
rules {
order: Finance(id) Manager(id) Procurement(id) {
dispatch <- order(id)
}
}
}Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 25 / 44
State Machines: Messagesport authorization[in]: interface {
// Messages are received when specific
// authorization is received. The order
// id is supplied...
finance(id:int):void;manager(id:int):void;procurement(id:int):void;complete(id:int):void;reset():void
}
port dispatch[out]: interface {
// Sent to the output port when the
// order is complete...
order(id:int):void}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 26 / 44
State Machines: Types
machine(Start:start) {
// Types are used to define states.
// Types may be named and then used in
// the rest of the machine...
type start = Start
type finance = Finance(int)type manager = Manager(int)type procurement = Procurement(int)type end = End(int)
// Transitions...
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 27 / 44
State Machines: Transitionsmachine(Start:start) {
// (finance
// (manager procurement + procurement manager)
// complete reset)*
go:start->finance
finance(i) Start->Finance(i);
multiple_finance:finance->finance
finance(i) Finance(i)->Finance(i);
got_manager:finance->manager
manager(i) Finance(i)->Manager(i);
got_procurement:finance->procurement
procurement(i) Finance(i)->Procurement(i);
end1:manager->end
complete(i) Manager(i) -> End(i) { dispatch <- order(i) }
end2:procurement->end
complete(i) Procurement(i) -> End(i) { dispatch <- order(i) }
reset:end->start
reset End(i) -> Start;
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 28 / 44
State Machines: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 29 / 44
State Machines: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 30 / 44
State Machines: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 31 / 44
State Machines: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 32 / 44
State Machines: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 33 / 44
State Machines: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 34 / 44
State Machines: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 35 / 44
State Machines: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 36 / 44
Communication: Definitioncomponent container {
component sender {
port output[out]: interface {
m():void}
init { output <- m() }
}
component receiver {
port input[in]: interface {
m():void}
machine(0:int) {
t:int->int m 0->0 {
print(’RECEIVED MESSAGE’)
}
}
}
init {
connect(sender.output,receiver.input)
}
}Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 37 / 44
Communication: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 38 / 44
Communication: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 39 / 44
GUI: Contacts
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 40 / 44
Manager
component manager {
// Ports changed and manage...
operations {
add(n) {
new Contact(n);
changed <- show([name | Contact(name) <- state])}
remove(n) {
delete Contact(n);
changed <- show([name | Contact(name) <- state])}
}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 41 / 44
GUI
component gui {
display = jcomponent(’frames.GUI’)
// Ports manage and update...
add_button = Button(’add’,fun(e) manage <- add(e.contact))
operations {
show(data) {
display.in <- display(
Table(
[[Text(n),delete_button(n)] | n <- data] +
[[Input(’contact’,’’,10),add_button]]
))
}
delete_button(name) {
Button(’delete’,fun(e) manage <- remove(n))
}
}
}
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 42 / 44
GUI: Execution
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 43 / 44
Use Cases and Research Areas
Simulation.
Refinement.
Alignment.
Goal modelling and goal modelling.
Analysis of non-functional properties:I Cost.I Performance.I Security.
Architectural Patterns.
Product Lines and Configuration.
Slicing.
Testing.
Publications: [3, 1, 2, 4], InfoSys SETLAB Briefings, WAMBSEWorkshop. ICSoft alignment paper submitted.
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 44 / 44
T. Clark, B.S. Barn, and S. Oussena.Leap: a precise lightweight framework for enterprise architecture.In Proceedings of the 4th India Software Engineering Conference,pages 85–94. ACM, 2011.
Tony Clark and Balbir S. Barn.Event driven architecture modelling and simulation.In SOSE, pages 43–54, 2011.
Tony Clark and Balbir S. Barn.A common basis for modelling service-oriented and event-drivenarchitectures.In 5th India Software Engineering Conference, IIT Kanpur, ISEC 12,2012.
Tony Clark, Balbir S. Barn, and Samia Oussena.A method for enterprise architecture alignment.In PRET at CAISE 2011, 2012.
Tony Clark, Balbir S. Barn, Samia Oussena (Universities of Somewhere and Elsewhere)LEAP A Language for Architecture Design, Simulation and AnalysisApril 18, 2012 44 / 44