Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

Embed Size (px)

Citation preview

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    1/26

    Oracle in Open Source projects

    Oracle in

    Open Source ProjectsBerry van Halderen [email protected]

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    2/26

    Oracle in Open Source

    Outline

    About Hippo

    Architecture Hippo software and open source

    The storage problem for (open source) software packages

    Interoperability and standards

    JCR and JPA/JDO

    How this ties into Hippo and Oracle

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    3/26

    Oracle in Open Source

    About Hippo

    Hippo develops and provides services for its

    Content Management System (CMS)

    Develop Open Source software;

    Participate in open standards;

    Web and Java-based content software;

    Hippo works directly for customers, but wants to focus as softwarecompany.

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    4/26Oracle in Open Source

    Just a glance...

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    5/26Oracle in Open Source

    The advantages of being open

    Customers have ensure maintainability

    Base software developed by more than one company

    Can provide confidence of correctness and checks

    Allows customer or third party extensions

    More modularized applications

    Better interoperability

    No free lunch, still requires support and customization

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    6/26Oracle in Open Source

    Architecture

    Central repository delivering common functionalities

    Applications are CMS, websites, ...

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    7/26Oracle in Open Source

    Architecture

    All applications, even CMS are just web applications

    Central repository delivering common functions

    Get, retrieve, search documents

    Versioning

    Workflow

    Hierarchical storage

    Typed and unstructured data

    Locking

    Repository itself persists into files, databases, etcetera

    All communication and storage should be performed using thecentral repository

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    8/26Oracle in Open Source

    Why a repository?

    Extended, application domain specific functionality, needed.

    SQL 'standard' to diverse and generic for single software baseto work.

    Repository uses simple database model andfilesystem to store data.

    Because all applications use repository as storage,back-end specific storage is hidden.

    However repository still has to deal with back-enddifferences.

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    9/26Oracle in Open Source

    Advent of abstraction layers that are application specific

    jdbc/repositoryDataSourceorg.apache.slide.store.impl.rdbms.OracleRDBMSAdapterSLIDE_SLIDE_false

    Usage of adapter layer in software;

    Internal, application specific, abstraction on storagesystem used.

    However each software module will have its ownadapter

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    10/26

    Oracle in Open Source

    How does Hippo use Oracle

    No oracle specific development because applicationbase must be generic;

    Just like any other database and application server

    Product should run within any application container andusing any back-end storage.

    Small compartimized component provide

    connection to back-end store.

    http://flickr.com/photos/92011777@N00/228570232/

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    11/26

    Oracle in Open Source

    It was just too simple

    Two problems, first:

    Open source projects are technical subprojects, notend-applications.

    Multiple projects are put together in one application. Each project potentially its own storage adapter.

    Second: we're not alone

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    12/26

    Oracle in Open Source

    Other repositories out there

    We want inter-operability

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    13/26

    Oracle in Open Source

    Standarization

    How independently developed software can co-operate;

    Standardize

    Best effort standardization:

    Application domain, rather than full generic; Mostly on API, quering just as basis;

    Open source requires open standards to be involved.

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    14/26

    Oracle in Open Source

    Standarization approaches

    I.Application interoperability

    II.Storage abstraction layers that capture applicationdomain knowledge

    I. Java Content Repository: JCR

    II.Java Persistency:

    Plain Java objects mapped to database storage.

    Java Standards (JSRs):

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    15/26

    Oracle in Open Source

    Java Content Repository (JCR)

    JSR-170, JSR-283 in preparation

    Standardized API for Content repositories

    This is not a generic database access

    But a Java API for accessing content in webapplication domain for CMS, DMS, etcetera.

    http://flickr.com/photos/openthreads/234957983/

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    16/26

    Oracle in Open Source

    JCR provides

    Versioning

    Hierarchical storage

    Locking

    Observation Hierarchical type management, but also

    unstructured content

    But no workflow,

    and leaves query languages partly open.

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    17/26

    Oracle in Open Source

    Example

    Import javax.jcr.*;

    Session session = repository.login();Node node = session.getRootNode().getNode(documents).getNode(artists/queen);

    Node album = node.addNode(A day at the races, nodetype:album);album.setProperty(year, 1976);album.setProperty(genre, new String[] { pop rock, progressive rock });

    Node song = album.addNode(Teo Torriate, nodetype:song);song.setProperty(length, 357);

    session.save();session.commit();

    queryManager.createQuery(SELECT * FROM nodetype:song WHERE length > 300, Query.SQL)queryManager.createQuery(/documents/artists//[@length > 300], Query.XPATH);Query query = queryManager.getQuery(session.getRootNode().getNode(/queries/stored);

    QueryResult result = query.execute();for(NodeIterator iter = result.getNodes(); iter.hasNext(); ) {

    node = iter.nextNode();}

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    18/26

    Oracle in Open Source

    Object Relational/Content Mapping (ORM/OCM)

    Plain Java object programmingpreferred by developers

    Not the intricates of having tofetch and store data, fetchgroups

    OCM provides layer that mapsJava objects to a databaseschema.

    Once initial Java object isobtained, all referenced objectsare also available.

    Fetch groups allow application-

    Java class Database

    Mapping description

    Database connectordescription

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    19/26

    Oracle in Open Source

    Object Mapping Standards

    Alternative standards: JPA and JDO (plus Hibernate, etc.)

    Differences in expressiveness, but all use same approach:

    Mapping description file, or

    Annotations Plus back-end storage descriptor

    Mapping allow application domain knowledge

    and seperation between storage method and code.

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    20/26

    Oracle in Open Source

    JDO / JPA Annotations

    @Entitypublic class Employee implements Serializable {

    private int employeeId;

    @Idpublic int getEmployeeId() { return employeeId; }

    @JoinColumn(name="MANAGER_ID", referencedColumnName="EMP_ID")public Collection getManagedEmployees();

    }

    @NamedQuery(name="findAllEmployees",query="SELECT * FROM EMPLOYEE WHERE MGR=1"hints={ @QueryHint={name=TopLinkQueryHints.BIND_PARAMETERS} }

    )

    Annotations in Java5 describing how to map to schema:

    Specialized queries can be used too, if really needed:

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    21/26

    Oracle in Open Source

    JDO / JPA Mapping description

    Alternative to use mapping description

    Here, also targetted queries are possible.

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    22/26

    Oracle in Open Source

    OCM and JCR do not conflict

    OCM and JCR do not conflict:

    OCM on top of JCR

    http://flickr.com/photos/17271969@N00/16402704/

    Browse, versioning, etc by JCR.Programming paradigm by OCM

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    23/26

    Oracle in Open Source

    Oracle and open source / open standards

    One view is that for Oracle open source is just anotherapplication

    this is rightfully so..

    Oracle wants to be the information provider to all applications

    Open standards promote this, and allow open source providesto integrate with Oracle products.

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    24/26

    Oracle in Open Source

    Oracle involvement in Open Standards

    Is Oracle involved in Open Standards?

    JSR-4

    JSR-21JSR-15

    JSR-10

    JSR-24

    JSR-30

    JSR-37JSR-40

    JSR-43

    JSR-45 JSR-48

    JSR-51

    JSR-56

    JSR-69

    JSR-72JSR-74

    JSR-76

    JSR-94JSR-99

    JSR-106

    JSR-107

    JSR-115

    JSR-121

    JSR-123

    JSR-126

    JSR-128

    JSR-131

    JSR-133 JSR-138

    JSR-139

    JSR-142

    JSR-144

    JSR-147JSR-155

    JSR-156

    JSR-160

    JSR-163

    JSR-164

    JSR-165

    JSR-167

    JSR-169

    JSR-171

    JSR-174

    JSR-175

    JSR-176

    JSR-181

    JSR-182

    JSR-186

    JSR-187

    JSR-188

    JSR-198

    JSR-199

    JSR-72

    JSR-200

    JSR-201

    JSR-202

    JSR-203

    JSR-204

    JSR-207

    JSR-208

    JSR-212

    JSR-215

    JSR-223

    JSR-227

    JSR-233

    JSR-241

    JSR-250

    JSR-251

    JSR-254

    JSR-262

    JSR-264

    JSR-265

    JSR-269

    JSR-270

    JSR-276

    JSR-277

    JSR-284

    JSR-289

    JSR-291 JSR-292

    JSR-294

    JSR-295

    JSR-303

    JSR-305

    JSR-306

    JSR-309

    JSR-310

    JSR-316

    JSR-322JSR-318JSR-317

    JSR-315

    JSR-314

    JSR-313

    JSR-301

    JSR-299

    JSR-296

    JSR-286 Portlet 2.0JSR-255

    JSR-262

    JSR-252 JavaServer Faces 2.0

    JSR-247

    JSR-245 JSP 2.1

    JSR-244

    JSR-243 JDO 2.0

    JSR-225

    JSR-224

    JSR-222

    JSR-221

    JSR-220

    JSR-206

    JSR-196

    JSR-173

    JSR-172

    JSR-170 JCR

    JSR-168

    JSR-154JSR-153

    JSR-152

    JSR151

    JSR-127

    JSR-117

    JSR-114

    JSR-112JSR-110

    JSR-109

    JSR-101

    JSR-88

    JSR-73JSR-67

    JSR-53

    JSR-52

    JSR-31JSR-26

    JSR-12 JDO

    JSR-16

    JSR-19 JavaBeans

    JSR-5

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    25/26

    Oracle in Open Source

    Oracle does JCR

    Oracle involved in JCR (JSR-170, 283)

    Oracle involved in JPA/JDO (JSR-243, 220, ..)

    Implementations for JCR, JDO/JPA (TopLink)

    Standards allow for interoperability

    e.g. Use specialized Hippo JCR together with Oracle JCR tools

    Or Oracle JCR combined with Hippo JCR;

    Application programmers can use same interface, and just point to different

    implementation when addressing specific needs.

  • 8/22/2019 Ogh20071212 b.van Halderen m. Schapendonk en m. v.d. Plas

    26/26

    Oracle in Open Source

    Wrapping up

    Open source and open standards target less vendorcentric development and better interoperability;

    Attention in open source world to use openstandards

    Application domain solutions

    rather than end-application specific or too generic;

    use localized queries that can be tailored to back-end.

    Open source developers and

    other vendors co-operating in

    open standards.

    http://flickr.com/photos/thepartycow/296816170/