WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically...

12
WebObjects Matt Aguirre Lally Singh

Transcript of WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically...

Page 1: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

WebObjects

Matt Aguirre

Lally Singh

Page 2: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

What Is It?

A Java based development platform specifically designed for database-backed web applications.

Page 3: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

What Does It Have?

Scalability: built in load balancing among a dynamically configurable set of servers

Industry standards support: JSP/J2EE/JNDI support built in

Multiple client type support: Web Browser, Java Client Application, XML, SMIL, WAP…

Easy extensibility: add new web components for immediate reuse.

Page 4: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

Architectural Overview

Page 5: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

Architecture In Depth

Page 6: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

Web Components

Three Parts: HTML file Bindings file Java code

Embeddable within themselves: follows the Composite design pattern

Embeddable within JSP pages Communicate to each other & Enterprise Objects

(EOs) through Key-Value coding

Page 7: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

Example Web Component

A simple form containing two items: a textbox and a submit button

User hits ‘Submit’ and the name is shown in System.out.

Not very useful

Page 8: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

The HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML> <HEAD> <META NAME="generator" CONTENT="WebObjects 5"> <TITLE>Untitled</TITLE> </HEAD> <BODY BGCOLOR=#FFFFFF> <webobject name=Form1>Sample Form <p>Name: <webobject name=TextField1></webobject></p> <p><webobject name=SubmitButton1></webobject></p> </webobject> </BODY></HTML>

Page 9: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

The Bindings

Form1: WOForm {}

SubmitButton1: WOSubmitButton {action = submit;

}

TextField1: WOTextField {value = name;

}

Page 10: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

The Java File

public class Main extends WOComponent { protected String name;

public Main(WOContext context) { super(context); name = new String(); }

public WOComponent submit() { System.out.println("name="+name); return null; // default - means we go back to same page }

}

Page 11: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

What Happens?

When the page is requested, the value for name is taken from the Component’s instance via Key-Value Coding

The page is displayed to the user The user types in something into the textbox The user hits submit WO updates the value of name with what the user put in the

textbox WO then calls Main’s submit() method submit() prints out the string the user typed in

Page 12: WebObjects Matt Aguirre Lally Singh. What Is It? A Java based development platform specifically designed for database-backed web applications.

Key Value Coding

A method to access data in classes without relying on their interfaces

Implemented through the KeyValueCoding Java interface

The default implementation scans through reflection. Ex: to set the key foo, the following will be

checked in order: 1. setFoo() 4. _isFoo

2. _setFoo() 5. foo

3. _foo 6. isFoo