Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical...

10
Features of IDS Features of IDS within the within the Java OO Framework of Java OO Framework of WebSphere WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

Transcript of Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical...

Page 1: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

Leveraging OO Leveraging OO Features of IDS Features of IDS

within the within the Java OO Framework of Java OO Framework of

WebSphere WebSphere

Michael Chaney

Technical Director

ChainLink Networking Solutions, Inc.

Page 2: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

Object Oriented DesignObject Oriented Design

Advantages– Code re-use– Simplified application design– Lower cost of ownership

Disadvantages– Initial development requires higher expertise– More upfront development effort required

Page 3: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

IDS AdvantagesIDS Advantages

Storage of arbitrarily complex data– Inheritance (OO)– Polymorphism (OO)

User defined typesUser defined functions

– C, Java, SQL

Functional indexes

Page 4: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

Web Object ExampleWeb Object Example

All web content stored in single table

create table web_content (

id integer primary key,

object web_object_t

);

Objects stored within user defined web_object_t base type

Page 5: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

Web Object InheritanceWeb Object Inheritance

g if_ t

jp eg _ t

t i f f_ t

im ag e_ t

h tm l_ t

p la in_ t

xm l_ t

te x t_ t

f la sh _ t

m sw o rd _ t

p d f_ t

a pp lica tio n_ t

w e b_ ob jec t_ t

Page 6: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

SQL ExampleSQL Example

Functional indexcreate index i_web_content_type on web_content

( content_type(object) );

Convert PDF document to HTMLselect object::html_t from web_content

where content_type(object)='application/pdf';

Page 7: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

Java Object AccessJava Object Access

... java.util.Map map = conn.getTypeMap();

map.put(“web_object_t", Class.forName(“WebObject"));… map.put("pdf_t", Class.forName("PdfObject"));conn.setTypeMap(map);

...ResultSet rs=statement.executeQuery("select * from web_content ;”);while (rs.next()){ WebObject wbObj=(WebObject)rs.getObject(“object”); out.write(wbObj.embed()); // embed into HTML page}

Page 8: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

Java Object ImplementationJava Object Implementation

public class WebObject implements SQLData { private String sql_type=“web_object_t”;  String getSQLTypeName() { return sql_type; }           void readSQL(SQLInput stream, String typeName) { ... }            void writeSQL(SQLOutput stream) { ... } ... /// implementation details ... public String getContentType() { … } // object mime type public String embed() { … } // embedded display within HTML public InputStream getData() { … } // Get native object date bytes}

Page 9: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

WebSphere Native Object DisplayWebSphere Native Object Display public void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {// ...

ServletOutputStream out= response.getOutputStream();ResultSet rs=stmt.executeQuery(

"select object from web_content where id="

+ request.getParameter("id") );if (rs.next()){ WebObject wbObj=(WebObject)rs.getObject("object");

response.setContentType( wbObj.getContentType() ); InputStream data=wbObj.getData(); int c=data.read(); while (c>=0 ){ out.write(c); }}

}

Page 10: Leveraging OO Features of IDS within the Java OO Framework of WebSphere Michael Chaney Technical Director ChainLink Networking Solutions, Inc.

Questions?Questions?

Contact: Michael Chaney

Technical Director

ChainLink Networking Solutions, Inc.

[email protected]