domain-driven software development with aspects and ontologies pavel hruby, microsoft domain...

22
Domain-Driven Software Development with Aspects and Ontologies Pavel Hruby, Microsoft Domain Specific Modeling Workshop, OOPSLA 2005

Upload: wesley-kelley

Post on 16-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Domain-Driven Software Development with Aspects

and Ontologies

Pavel Hruby, Microsoft

Domain Specific Modeling Workshop, OOPSLA 2005

Level of Abstraction of Domain Language

Business Domain Interactive Systems Domain

Other Domain

Resources, Events Agents

Invoice, Sales Order Payment

Transaction

Object, Class, Method

Lev

el o

f ab

stra

ctio

n

Sales Domain

Object-Oriented Domain

Concepts of Domain Language correspond to Ontological Categories

• Domain ontology answers the question

what kinds of concepts exist in the

domainstockflow

provider

recipientEconomic Resource

Economic Event Economic Agent

increment decrement

Economic Resource Type

NoseFruity. Raisins, especially dates, orange peel.

PalateBeautiful balance of dark, syrupy, fruity, maturation flavours and cedary, oily, marshmallow, characteristics from the spirit itself.

FinishGentle, long, warming, lemon grass, spice.

AuchentoshanSingle Malt Scotch Whisky12 year oldLowland44,3%

70cl £33.99

Economic Resource Type

SizeMale killer whales, or bulls, average 5.8 to 6.7 m (19-22 ft.) and usually weigh between 3,628 and 5,442 kg (8,000-12,000 lb.). Females, or cows, average 4.9 to 5.8 m (16-19 ft.) and usually weigh between 1,361 and 3,628 kg (3,000-8,000 lb.).

Body shapeA killer whale has a sleek, streamlined, fusiform (tapered at both ends) body shape.

ColorationStriking black and white coloration. The dorsal surface and pectoral flippers are black, except for the area below and behind the dorsal fin. A white 'eyespot' is located just above and slightly behind each eye. Killer whales are counter-shaded; they are dark on their dorsal surface and white on their ventral surface. 

Qajaq USA T-Shirt$14.99

Relax in this high quality (Hanes-Beefy-T) white T-shirt with a full-color Qajaq USA logo silk-screened on the front. The back is plain (for you Skin-on-Frame minimalists out there).

Economic Resource Type

Conflict

• Ontologies are designed to be general−the same categories for all systems in the

domain

• Business applications must meet specific

user requirements−all systems in the domain are different

Additional modules often cross-cut the Domain Objects.

EconomicEvent

Economic Agentstockflow from

to

Account

Economic Resource

Group

Economic Resource

grouping

Calendar

EconomicEvent Group

EconomicAgent Group

grouping grouping

stockflowtype

participationtype

Number Series

Possible Solution

•Ontological Categories -> Domain Objects

•User Requirements -> Domain Aspects

User Requirements( Aspects )

Software Application

Domain Ontology( Objects )

Domain Language and Application Model

«instance of»

«instance of»«instance of»

«instance of»

«instance of»

Customer

Sale

Payment Receipt

Item

Money

Economic Agent

Economic Event

Economic Resource

recipient

provider

reconciliation

outflow

inflow

duality

participation stockflow

«instance of»

«instance of»

Ontological Categories (Domain Language)

Application Objects

Economic Resourcewith Description Aspect

«economic resource» Product Type

Logo

Product Description

Distillery Description

Distillation Technology

Media = Picture

Media = Text

Media = Text

Media = Text

Model of Description Aspect

Name

Description Aspect Type

REA Entity 0..*

0..*

«instance of»

Media

Description Type

Description

Text

Textual Description

Picture

Graphical Description

Internet Address

Web Page

Aspect Type

Application Model

Model of Identification Aspect

ID ruleLast Number

Serial Number Setup

Identification String

Serial Number

0..*1

NameAutoNumber (Y/N)Unique (Y/N)Mandatory (Y/N)

Indentification Aspect

Group0..*

REA Entity 0..*

1..*1..*

Name

Identifier

Name

Identifier Setup

«instance of» «instance of»

1..* 1

Aspect Type

Application Model

Customer

Sales

Payment Receipt

Item

Cash

Economic Agent

Economic Event

Economic Resource

IdentificationAspect

AccountAspect

DescriptionAspect

«recipient»

«provider»

«outflow»

i«nflow»

duality

participation stockflow

Identifier Setup Type

Identifier Type

Picture Text

Account Type

Increment Type «aspects»

Customer

«aspects»

Sales

«aspects»

Payment Receipt

«aspects»

...

Item

«aspects»...

Money

«recipient»

«duality»

«outflow»

i«nflow»

DecrementType

Name Setup

Name

instantiation configuration configuration

instantiation

Ontological Categories

Application Objects

Aspect Categories

Application Aspects

Configured Application Model

«aspects»

Group

Number

Number Setup

Customer Account

Increment

Decrement

Number Setup

Number

DescriptionType

Customer Account

Increment Decrement

Cross-Cutting

Ontologies

Picture

«provider»

Domain Ontology

REA

Picture

containmentDomain Model

Other Consequences

• Model Transformation −addresses non-functional requirements

• System Level Architecture−ontology defines a minimal

implementation component

Layered AchitecturePresentation Layer

«economic agent» Customer

«economic event»Sale

«contract»Sales Order

«economic resource»Product

0..*1

10..*

Business Logic Layer

«card form» Customer

«list form»Sales Order «card form»

Product

0..*1

0..*

0..*

Persistence Layer

«table»Customer Table

«table»Line Item Table

«table»Sales Order Table

«table»Product Table

0..*1

10..*

Model Transformations

This transformation might exist

This transformation does not exist, because ”user role” does not exist in business document domain

«model»Report

«model»Business Logic

«model»Persistence

«model»Presentation

«model»Business Document

«model»Security

«model»Other

transformationtransformation

transformation

transformation

transformationtransformation

REA Component

«agent» Customer

«decrement» Sale

«increment» Payment Receipt

recipient provider

reconciliationoutflow

inflow

«economic transfer» Sales Component

«resource» Item

«resource» Money

System Level Architecture

Sales

Financing

Marketing

HumanResources

Procurement

Money

Legend:

Resource Flow

Port (semantics of flow and port specified in UML 2.0)

Brand NameItem

Labor

Other Domains?

• Transaction Systems (business-logic)

• Transformation Systems−compilers, encoding, decoding

• Interactive Systems−office applications, games, user interface

• Other...?−can they be designed in the same

way?

Implementation of Domain Categories

Economic ResourceMetamodel

( Categories )

«economic resource»Cash

Application Model( Application Objects )

«instance of»

CashRuntime Model

( Instances )

«instance of»

• Are the Principles of Designing

Business Software applicable to

Other Domains?

−my question to the workshop