impedance mismatch 2.0

14
Impedance mismatch 2.0 BouvetOne 2010-01-28 Lars Marius Garshol, <[email protected]>

Upload: lars-marius-garshol

Post on 15-Jan-2015

1.280 views

Category:

Technology


1 download

DESCRIPTION

About the impedance mismatch between object-oriented languages and semantic technologies.

TRANSCRIPT

Page 1: Impedance Mismatch 2.0

Impedance mismatch 2.0

BouvetOne 2010-01-28

Lars Marius Garshol, <[email protected]>

Page 2: Impedance Mismatch 2.0

Impedance mismatch 1.0

• Objects and relations have different structures– causes lots of extra development work– a well-understood problem today

?

Java objects Tables

Page 3: Impedance Mismatch 2.0

Impedance mismatch 2.0

• Objects and semantic technologies have the same issue– this is not well understood, however...

?

Page 4: Impedance Mismatch 2.0

And the solution is...?

• I don’t suggest that I have it– what I am suggesting is that we need to think

more seriously about this problem

• This talk sketches some approaches– I would be very interested in feedback on

them

Page 5: Impedance Mismatch 2.0

Some important concerns

• Whipuptitude– how easy it is to get something up and running

• Manipulexity– how complicated data/interface you can handle

• Knowledge of TMs– is it possible to shield some developers from

TMs?

• Testability– how easy is it to do automated testing?

• Flexibility– how hard is it to change the application?

Page 6: Impedance Mismatch 2.0

The one-layer approach

• Write lots of JSPs– put your queries in the JSPs– off you go

• Messy, but effective– high whipuptitude, but brittle– limited manipulexity– usually lots of boilerplate code

• Difficult to test

JSP

JSP

JSP

Page 7: Impedance Mismatch 2.0

Write a domain model

• Write a domain model– put as much business logic as possible inside– hide all Topic Maps queries in it– then build JSPs as a thin layer on top

• Scales to higher manipulexity– much easier to test

JSP

JSP

JSP

Domain model

public class Person { public String getName(); public String getEmail(); public Date getDateOfBirth(); // ...}

Page 8: Impedance Mismatch 2.0

But...

• Very low whipuptitude– takes a while to figure out how to approach

writing this code– lots of scaffolding to do before you get started

• Wasn’t one of the benefits of TMs flexibility?– now any ontology change has to be followed

by an update to the domain model– this is slow and a lot of work– compared to an RDBMS and an OR-mapper, is

this really any faster?

Page 9: Impedance Mismatch 2.0

Generate a domain model

• Use a tool that generates the model– obviously, it must allow custom extensions– saves effort by avoiding most of the routine

work– business logic still has to be written manually

• Scales to even higher manipulexity– whipuptitude no longer quite so bad

JSP

JSP

JSP

Generated domain model

Custom code

http://www.networkedplanet.com/ontopic/2007/07/topic_map_objects_research_pap.html

Page 10: Impedance Mismatch 2.0

To make this work...

• Use schema + annotations as input– also conventions instead of config, where

possible– allow ontology annotations to provide

additional generated business logic, where possible• (.NET allows partial classes, avoiding subclassing)

• Generated code not to be edited– all custom logic in separate subclasses

• Might be able to use tolog rules to implement some of the business logic without Java

Page 11: Impedance Mismatch 2.0

A portlet approach

• Use generic components for display– at least as far as possible– these rely on configuration and ontology

annotation– note: components reflect interface, not the

domain

• Enormous whipuptitude– manipulexity probably limited

JSP

JSP

JSP

TreePortlet

RelatedTopics

TopicList

Page 12: Impedance Mismatch 2.0

Ontology changes

• All applications have some ontology expectations– however, using a generic approach these can

be minimized– sometimes to the point where no code

changes are required for certain ontology changes

• However, this requires the use of generic components– usually also requires some forethought– with a traditional domain model this is not

really possible

Page 13: Impedance Mismatch 2.0

Evaluationwhipuptitude

manipulexity

One-layerapproach

Self-written domain model

Genericportlets

Generated domain model

Page 14: Impedance Mismatch 2.0

But what do you think?

• Would any of these approaches really solve the problem?

• Do we need more?• Do we need something entirely

different?