WWDC2003 Session 609

Transcript

Kind: captions
Language: en
my name is Miguel Sanchez I'll be doing
the first half of the presentation and
they will have our star documentation
wire branch and come up and do the
sector the second half so if you're in
this presentation I hope you're
interested one in web objects and two
that you want to learn how to quickly
develop your applications how quickly
well the most of optimistic developers
here in the cloud will probably want
something like this you want a magic
button that says build my application
and then you press that magic button and
then you get your web objects
application and if you saw the demos how
many of you were here last yesterday for
the tech overview so you'll see some of
the demos well a lot deeper in this
session but you'll see you know that we
get pretty close to this this kind of
rapid development so we're going to
teach you several things the maintenance
how to get how to build at with objects
applications within minutes or within
seconds if you have a very fast compile
machine but now you guys you at your old
developers I can't hide things from you
you know that it's not that easy I mean
you're ultimately here to type kodel at
some point to the meat of the
application is to teach you how to do
the incremental customization of your
web objects applications until you get
your final deployment up and the
underlying methodology we're trying to
cut to bring across during the session
is one a way of developing your
application that is that is more
data-driven and rural driven and in
which you can use your traditional web
objects techniques but you're you're
writing less code yet you're achieving a
lot more so that's what we want to get
across the you guys you might have heard
the term directed Star that's another
way of referring to the web objects the
rapid development technologies web
objects has three main kinds of
applications that you can develop you
have the traditional HTML with objects
front end application a swing
application and what
service applications each one of these
facts has it set of tools and frameworks
which we call direct to something so
it's we have the director web
technologies to director java client and
the director web services so this
presentation is about that whole last
row all the direct to start technology
so rather development is not one
particular application there's no magic
button like I showed you there so
there's a project builder system but
there's no rapid development application
anywhere think of it as a set of tools
and frameworks that help you build your
applications faster how do we achieve
this the main thing we give you is a lot
of pre-built functionality and default
application behavior so there's a lot of
stuff pre-built for you we also execute
the application in a slightly different
way than your traditional web of this
application we rely a lot more on your
data and a description of your data that
you give us to make decisions at runtime
and help you write less code and it's
also a common process used to LA across
the three kinds of web of these
applications like you saw on the last
like the very very high level view of
how you develop applications using rapid
development is what we ask from you is a
description of your data we want you
guys to tell us this is my data these
are the table some i'm working with so
only week we're not psychic yet but will
we're working on that one and then we
would get a description of your data
give it to us and right away we give you
a default application running within
seconds if you have a g5 but then then
you come in right i mean your developer
you're being paid to write the code and
you want to customize your application
to fit the needs your needs so you're
going to go through several steps of
iterating until you get your final
application okay now so let me go back
one now some people don't think that the
first application we give you is very
important because it
I'm up on the screen very quickly the
important thing to note about that
application is that you have a running
application from the very start of your
project and those of you that use some
sort of agile process development or
extreme programming you know you guys
know how important it is to have
something in a running state to to get
the immediate feedback and and your
customer so we give you a default
application and it's a very important
default application you might not look
exactly like the application you
ultimately want but it's running and as
you customize you customize and it's
always running okay and that is a very
very big benefit you guys get out of
using the rapid development technology
so we said what we want from you guys is
a description of your data model this is
the common denominator in all of the
rapid development technologies we assume
that the data you're handling can be
represented in some sort of entity
relationship mapping and we also assume
that what you want to do with your data
are things like inserting the leading
searching listing editing so that's what
we're good for you if you're doing some
major statistical analysis or other
kinds of stuff we don't really help you
that much how do you give us a
description of your data for this you
use something called an eel model and
those of you that are familiar with eos
this is what eof is for example you
would have your data in a database for
here's a company database but you don't
what you know that one of the benefits
of with objects is to keep you away from
the database I mean you want to want to
ultimately use your Java objects so
there has to be some sort of mapping
definition between those two those two
worlds and you're probably going to have
more tables and there's going to be more
objects and you have to tell us how they
map and there's more importantly there's
going to be relationships between
objects which exists at the database
level is foreign keys and source keys
but in your in your object graph you
just want to call a company method and
then to get back an instance of the
company class so the mapping stuff that
is the data United your data
definition and that's what we need from
you and we provide tools to help you
build this this quickly so if you give
us an eel model for those are for those
of you that are more familiar with us if
you give us a new model we can give you
a lot of functionality you need to give
us in your model now let's jump right in
and introduce the example we'll be using
throughout the whole presentation I know
that finding nemo is a good movie but I
I have preferences for another animated
movie The Star Wars series and over the
years I've been collecting a bunch of
Star Wars plastic Star Wars collection
little action figures you've probably
seen them in the in the stores so
memorabilia like magazines and stuff so
this is by data center right we're going
to build an application that allows me
to manage my Star Wars collection
database does anybody else could like
flower stores here okay well one there's
two geeks in this room there so that's
my data said I have a database that
represents my collection so I have
tables for an item the item table
reference and each row in the item table
is one of the toys I have I have the
idol the items represent characters in
the movie so I have a character table
with with the normal character names
that you are familiar with of Kevin
characters are categorized or the
humanoids are the droids for my purposes
I also consider ships to be characters
they appeared in a particular movie and
they showed up at the stores in bio in a
particular toy line the toy line refers
just to the kind of packaging they came
in and how much they cost sometimes so
with that I'm going to bring up Brent so
that's my data set like I said what we
have some that so now I'm playing the
role of the developer I have to give you
I have to give webobjects a description
of my data set let me just show you that
I already have a pre-existing database
it's an open base database there's my
data okay so you would have some of your
data if you don't have data you would
probably have a database that you
one eventually used so you would have
your you're just your simple they table
definitions even if there's no data in
so you have your have your data then we
use this tool called ill modeler this is
where we start seeing rapid developing
right there it's called yo modular but
part of parts of your monitor our rapid
development where we do here is we say
give us a connection to your database
and we ask we answer a set of default
questions and we click finish and we
create a default mapping for you so you
don't have to go in and create all of
this all of this yo model entities we
give you the default mapping that we
think we just go in read your database
schema and create a new model so for our
purposes that's it I mean that this is
so what we all we want to do and this is
the entity relationship view of the
model so what do you what the tool did
was for each table we saw that you had
we created an entity and for each column
in that table we created an attribute so
that our mapping okay we're going to
save the model and then we go to project
builder and we create one of the project
types we're going to be using director
web for this first demo so one of the
project types we have is the director
web project type just call it anything
the main thing you have to keep in mind
when you're creating a director web
project type is all we need to know is
what is your model and that's the step
where Brad said this is my model which
which is saved this is the part where we
create the application for you in
seconds so we click Next finish and
compiling if we go through the project
we haven't generated any code for you
other than the default Excel files that
are required in project in web objects
applications it's compiling in the
background when Bryce is changing the
fall so you guys can see the code we're
launching that we have a running
application okay so this is you saw this
yesterday we're going to log a
and we have a query page where we can
search on all of the entities we have in
our database we're going to go to the
first one the characters so we look we
get a list of all the characters in my
database if we want to edit a particular
character we click on the edit page we
go to the edit page let's go back to the
homepage we want to see all the pictures
in my database go to the photos ok so
those are some of the pictures i have in
my database of the toys i have and so
that's that's rapid development you have
to fully running with objects
application ok so that's the part we
give you at the start great but that's
not what I want it to look like right so
let's start customizing it let's go back
to home first and let's do a very basic
customization we go to the item list
page and edit edit item first just click
on any one of those items so we have the
edit page for the item for each one of
the toys and when you give you all the
default fields we figure it out you had
in your database but you don't want to
show all of them you only want to show
three you only want to show the name of
the item the movie came from and the
condition that the toy is in so what we
do is we click branches clicked on that
button on the left that said customized
we bring up a little java applet that
allows you to hide and remove feel so
what he's going to do is going to say I
don't want to show all of those two four
six eight fields I only want to show
seven fields so he goes into the athlete
and he gets rid of all of them other
than the name of the item the movie and
the condition that the toy is in now
watch this we haven't written any code
now recompiling nothing we click update
in the in the apps in the applet the
request goes to the server the page
refreshes and you see your change okay
so that's also something where do we do
that we're going to be talking a lot
more about in rapid development you see
your changes right away this was a very
basic customization but there will be
more complex customizations and your
application it's always running ok now
let's just look at the project for those
of you is I haven't seen I'm sure that
will
savina far we've seen director webb
bridge for those of you that haven't
seen directive I just want to point out
that this is not blind cogeneration we
don't have any code any files in your
project that generate those HTML pages
for you we're doing that all dynamically
on the fly behind the scenes so there
this is not blind coin generation okay
so that's the end of the first demo
thanks Fred back to slide please so we
just showed you what director weapons
direct to web if the set of frameworks
for the end tools that allow you to
quickly create HTML with objects
application that was the first column in
that slide I showed you at the start ok
we do that by giving you a lot of
pre-built page templates and we're
driven by the description of your of
your model data driven and we're also
driven by a bunch of rules which we have
to make decisions at runtime so we're
rule driven but ultimately you can
customize your applications however you
want what kind of page templates do we
give you we have the query old page
template which is automatically
configured to show all of the tables you
have in your model once you click on a
particular search we have a list page
template where we show you all the page
results it doesn't show you this on this
live but it's a multi page search so if
you have a lot of results you can you
can paginate through them and and see
all of yourself we have an edit
relationship page where you want to when
you want to associate one object with
another we have the edit page some pages
have more than one look to them for
example here we have the simple edit
page where we just have the fields laid
out but we also have the tabs edit page
where you can or you can hide some
fields in certain tabs so that's at the
page level at the property level you
have all kinds of properties you have
dates numbers strings so we have a lot
of property level components for example
here i'm showing you five different
kinds we have a normal text field a
hyperlink a little embedded browser a
collapsible component where it says four
characters matrix of buttons okay so we
give you a lot of pages and we give you
a lot of property levels
opponents and you can combine them and
use them how you want so that's how we
achieve making things faster for you so
we have this pages now you might be
wondering okay you have this page this
templates pre-built for us for us but at
what point do you decide what to show on
them how do you actually configure them
under on the fly for that we use the
rule system okay we make decisions on
the fly to show exactly the fields that
are relevant to the database that you're
handling so think of the rule system as
a basic expert system it's a
question-and-answer system you give it a
state you tell it this is where I am
this is what i'm doing and i wanted i
want to know certain certain things
about the current state okay to get to
that it searches a collection of rules
it's also a recursive system so it might
you might find several rules along the
way before it ultimately gets the result
you want and I'm talking about it here
in the director web session but it is
the same rule system that is used across
all kinds of rapid development
applications rule system manages rules
what's the rule a rule in the simplest
form is something like this it's we have
a condition which is pretty much the
thing that has to be true for the rule
to be valid the rule the condition is
just a qualifier it says here well this
rule is valid when the task is list and
the entity you're handling is moving and
then we have a right hand side which is
the value of the rule which is the thing
you can derive you can deduce then the
knowledge you want to encapsulate it
gives you a more detailed example how
did we get to configure this page with
the rule system we have a template in
the director web framework that list
list list all of the rows how do we know
that you want those two particular roles
that you want the long name of the movie
and the short name of the movie we first
initialized the state that we're in for
that we use an instance of a class
called d2w context think of it as a
dictionary for now and ninety percent of
the time you don't even
to be handling a d2 EE context directly
so this is just for so you understand
the behind the scenes of what's
happening in the rule system we
initialize the content we say the
current tax we executing is a list is
listing and the move and the current
entity we're dealing with is a movie and
what we want to know is what fields we
have to display in the column we feed
that context into the rule system the
rule system searches through its rule
database firing other rules along the
way but it ultimately comes to something
like this and it says if the task is
list and the entity is movies and the
display fields are the long name and the
short name of the movie and it gives you
back that result okay and once we have
that results we can use that in our page
templates to you to use to configure
your page how do you access the rule
system how do you actually type in your
rules or like I said you will you're not
always directly writing rules in the
rule system an indirect way of accessing
the rule system is the director Weber
system which is just which we just show
you in the first demo you're not
thinking about rules you're just
thinking about which feels you want to
hide and what things you want to show
where so that's an indirect way of
accessing the rule system so the
director web assistant allows you to
change properties and pages changes
happen immediately and we generate rules
for you but you don't think about them
this is the general layout of the
director web assistant the left-hand
side of the assistant shows you which
task and which entity the information is
relevant to the middle part of the
screen shows you what properties are
available for you to show within that
task for that particular entity and the
rightmost side of the page of the window
shows you is where you specify which
widgets you want to use to display a
particular particular property a more
direct way of accessing the rule system
are accessing the rule databases by
using an application called rule editor
rules are don't be overwhelmed by rules
rules are property list you can open up
a rule file and it's a text file the
rule editor is a nice way of displaying
those rules its properties list if you
open up a rule file you
to see all of your rule at the top you
click on one and then you for a
particular rule you select you see the
lead to qualify your part of your rule
and then the value part of the move the
value you can derive so these are two
ways of accessing the rule system the
rule system is the main thing that you
use to customize your app even though
you might use it indirectly you also
customize your out by changing your data
model because we're relying on the
description of your data to see which
things would describe we put on the
screen so if you put more stuff in your
model we put more stuff in your page you
can add custom rules to configure
further and this is where it starts
getting interesting now you can start
you can plug in your own custom widgets
if you don't like the ones that we
provide for you and you can transition
into more into more traditional web
objects techniques but there's the cost
alright nothing comes for free right
week we can't give you all the magic and
then have you all do all your magic and
all that happen at the same time so just
be aware of this equation we're doing
all of these decisions for you at
runtime where we're trying to be smart
about your model and your rule and we
have control of the page template so the
more you want to give us for us to give
you that control the less we can do for
you okay so the more dynamic your
application is the page templates live
in our world if you want more access to
those templates we can give it to you
but at that point you're writing your
own code you're writing your own HTML
and it's harder for us to make decisions
at runtime so the more you customize the
less dynamic that you do some dynamic
flexibility in your application so the
rule of thumb here is that your
application is probably going to contain
dozens and dozens of pages so don't be
eager to get access to the HTML into the
Java right away only only customize and
only write code in the parts that you
really really are hitting a wall with
the stuff we give you leave the other
stuff alone and then and then little by
little customize the pages so you'll
you'll you'll you'll get a lot of
benefit out of that now let me summarize
the director web process to get an
initial application you use your modeler
you create your definition of your data
you get a model you feed that model into
project builder and you get a default
application within one minute how do you
start customizing it you use the
director weather system which is the
applet that runs alongside your app or
you can write more rules in the rule
editor or you can refine your model and
we take we pick up those changes or you
can do some basic HTML changes and then
your app starts looking a little more
like what you wanted we're going to do
this in a minute and then you can do
fairly advanced customization you can
write your own custom HTML with objects
components to plug in our pages you can
write more sophisticated rules or
ultimately you can get the full access
to the page template that we're using to
generated so we give you everything
there is your Java there's your HTML you
deal with it now okay so at that point
you get the application that you want
let's demo this in our second demo so
I'm going to ask for Brent to help me
out again you might quit the browser
first in room so we can restart from
this one so what we're going to do is
we're going to start out with the
application we just created and we're
going to get a little more sophisticated
with with our widgets for that one some
of the some of the code will be using in
the second demo was pre-built because
that's my code like it would be your
code in your in your own custom in your
own custom application and it lives in
the framework right now it's a very
simple framework is just for demo
purposes it contains things like an
image which I'm going to include into my
application and a little custom
component so it's a framework now let's
go back hide that framework and create a
new project a new project a new direct
or project we're going to be doing the
same thing the only reason we're doing
it again and we're not starting from
that project we just showed you in the
first demo is we wanted we wanted you to
be aware of this stuff and this brand is
not going to specify which model were
using is instead going to be specifying
which framework he wants to add to the
default of the default direct web
application and the framework contains
the models that we're going
pick it up automatically so everything
here is very similar he's just going by
creating a director web application the
only difference is that he also said
that he wants to link in this additional
framework so we're linking the framework
but initially we're not doing anything
with the framework so the application
should look the same we're not
generating any code yet it's launching
right now the only thing that we have in
our project is the reference to oh no
that's in the framework now we can show
you that in our project comes up ok so
we login this is the same application
that we had before we just we just got
to it in it in a slightly different way
we've never get around ok first thing
very simple thing you want you might
want to change is the overall look of
all of your pages we give you a blue bar
along the left-hand side maybe blue is
not your favorite color or maybe you
want to do something else so let's let's
do a very simple thing let's look let's
change the look of all the pages by
adding a banner that says star wars
along the top because this is my Star
Wars collection application one of the
components you have in your project is
called the page wrapper the page wrapper
specifies the overall look and layout of
all of your pages in this case it says
just a blue bar there's a menu that
always shows up on the left and then the
content shows up on the right so we
always want this vendor to show up at
the very top so what brent is going to
do is he's going to add an image
component at the very tough and each is
going to say I want this image the image
Star Wars banner which is the resource
in my framework to show up its
resourcing the rapid development
framework this is another part where
rapid development comes into play we're
not doing any code we're not doing any
recompile all he's doing is changing the
HTML and saving but web objects has
something called rapid turnaround and
all he has to do is refresh the page and
would pick up the banner so now that he
navigates around we have the banner
follows him around ok it's a very simple
HTML page but I'm sure all of you have
some photos
graphic designer or something that or a
group like that in your in your
companies where they want you to have
the particular look of the company so
you have access to the overall layout
now let's do something something more
more interesting let's go to the list
page for the item this is this page for
the item yeah so by default we're
showing you the name of the item the
secondary name of the item the notes on
the item but you know this is I mean the
coolness about this application is that
you see the images so I want to show the
images here so let's add the image
column to the to this list face so I
already have a primary photo data method
in one of my objects i just added using
the web assistant and I click update and
now i'm adding i have all of the default
colors we had plus the image column okay
so we have a default we have the default
image implementation that's great you
know what this default implementation
isn't very good it's the images are kind
of big and the image takes one whole
column and the way I want to develop my
application I want all of those four
columns one two three four to be
collapsed into one column and I want to
lay a little different so I want the
image on my left and then right
alongside the image I want the four
fields of the things we don't give you
that interactive web okay that's not a
problem because you can write your own
custom component and plug it into into
the application we already wrote this
custom component you've seen our
framework it doesn't do much I mean we
just didn't write it at this moment to
not to not have any typing mistakes but
it's a very simple component it's going
to show you the image on the left and
the four fields that we were showing us
columns right next to the image and show
the bindings when you write a custom
component what you have to be aware of
is that we direct the weather is going
to give you two things the object that
we want you to render and the key that
we want you to render so you're going to
get those two variables in and once you
know that those two things exist you can
do whatever you want in your code and
associate the bindings
now how do you use it in your
application this component is already
pre-built free compiles now what what
brent does is he adds he removes all of
the column and leaves only one
particular column and then look at that
the pop-up he's going to click on the
lad the very last entry in the pop-up is
I want to use my own custom component
for he clicks custom component you type
in the name of your component and it's
your formatted item component we click
update and and there's your custom
component ok so it's a very simple
component in this case but you might
want to have more sophisticated things I
just wanted you to show I just wanted to
show you guys how to plug in your own
HTML this is one of those places where
you're plugging in your things you're
plugging in your HTML and your little
snippet of Java code but you're not
getting full access to the page so it's
still dynamic you can still add columns
to that page and using the web
assistance and you're not getting full
access let's say that you ultimately get
to the point where this page you want it
to be a lot more sophisticated and you
just want full access to that Java and
that HTML for that you go to the experts
setting in director in the web assistant
and one of the options there is freeze
component every time you see the word
freeze we mean give me access to the
java and the HTML so you freeze the
component we go back to the project and
you see that we generated all of this
all of this code for you and put it in
your project so now you have full access
to the list page you have all of the
HTML you have all of the java but now
it's yours now notice that we only
really froze the list page if we go to
the edit page or if you go some more off
somewhere else we can still use the web
assistant and configure our application
there but the list page because we reach
the limits of director web we wanted
full access to it okay so it's not blind
code generation and that's all that's
that's it for this demo so if we go back
to slides
so that's the end of the director with
section now bring Brent up to actually
speak sorry and he'll do the java client
part of the talk thanks for go well
directly web is great because we can get
HTML applications without writing hardly
any code but when we want to get
customized the application we can write
code and we can't have access to all the
HTML and Java that we need but hTML
interfaces are great but sometimes you
need a little bit more sometimes you
need a desktop interface sometimes you
want a richer you I something that
allows your users to browse your data
more quickly in a different kind of way
and for that web objects provide the
technology called Java client so before
we talk about director Java client let's
talk about Java client so just like
direct web builds on the HTML frameworks
and tools that web Bob provides director
java client builds on top of the java
client technologies so let's go back for
a moment to our most optimistic idea of
what rapid development is so just like
in director web it'd be great if we
could have an application on the system
that just said build my application but
rather than building a web application
in HTML application it could build a
swing application that runs on the
client as a desktop application rather
than in the browser so we can get you
pretty close to this just like we do in
director Web so let's step back so what
is java client well java client allows
you to build distributed applications
applications that you distribute over
the web these are three tier
applications that include a web objects
application server in the middle and the
web objects app server access to the
database do the enterprise objects
framework and like I said these are
swinging desktop applications that users
use just like any other application on
their system but what this adds up to or
a multi-platform eof application so this
is one of the huge advantages of having
EOS in Java so rather than be limited to
one platform you have you have available
to you any Java to platform to deploy
the client application of course the
middle pier the app server access to the
database using us and because we have
this app server you can
they can control and mediate all access
to the data store so in a two-tier a
client-server application in which the
client has direct access to the database
you don't have as many opportunities to
secure that data but in a three-tier
setup you have all the control you need
and because it's a web objects
application server you have the full
support of web objects sessions so you
can provide using the customized
experience even within the swing desktop
app and of course these applications you
can bundle them as double clickable
applications or deploy them through java
web start so that's a Java client is so
what is directed to have a client add on
top of that well just like direct web
allows you to build HTML web
applications quickly strike java client
log easy to build swing applications
quickly again both of these technologies
share a lot of characteristics they're
both data in rule driven but unlike
director web which uses components and
dynamic versions of web components to
generate HTML directory java client is
it something we call controllers to
generate swing it relies on the real
system to generate the user interface so
just like you saw Miguel go through how
the real system works and how it figures
out how to generate a particular page
java client does this the same way this
is the same rule system in the same set
of rule but it produces a swing
interface instead and just like director
web has the number of different tasks
for editing data for editing
relationships and traversing
relationships java client also has
multiple tasks and java client
introduces some new tasks that are
specific and more appropriate to desktop
applications we're going to talk about
some of those and just like with direct
web director java client has many
customization techniques so the default
app isn't exactly what you want we
provide you a lot of interesting ways to
customize the application so again this
helps you change that your development
focus allows you to write to focus on
the important things which are your
business logic the important things in
writing a desktop swing app is not
writing the swing it's something that
has to be done it can be a buggy process
but we take care of it for you so you
can focus on the most important part of
your application which is the business
logic and just like with direct web you
can get a working prototype fully
functional in minutes or seconds and I
say in hours because my idea of a java
client prototype is something that is
be fully functional that evening it can
include a very rich login panel and we
provide framework to do all of that so
you can have a really functional
prototype in hours and part of this
development focus is that we allow you
to have a complete working application
throughout the whole life cycle of the
app okay so let's review the director
java client process it's very similar to
the director web process it all starts
with a data model and use the o modeler
to create that data model use project
builder to create the default
application but what you get instead is
a swing application customization
techniques just like directive direct
web has an assistance that allows which
is the front end to the real system
allows you to customize the application
we provide something call the director
Java client assistance so this is
actually an application of swing
application that runs inside of the
client application and allows you to
make customizations on the fly without
writing any code and if you really get
comfortable with the rule system you can
actually write your own rules and
roulette roulette eter just like you can
with director web and in the course of
customizing react may find that you need
to refine your real model maybe you need
to add some attributes contented here
and you want to make a relationship that
well the 2-1 is too many and you can do
that in most cases we synchronize the
changes you make in your real model and
because we're doing dynamic user
interface generation you see those
changes reflected right away so director
Java client has some advanced
customization techniques so I talked
briefly about the idea of a controller
class the controller class is analogous
to a low component and just like you can
freeze and extend and write your own
well components and ggw components for
direct to h2 director web applications
you can write and extend the controller
classes in Java client so if you want
total control over a particular user
interface in a Java client application
we allow you to do that in an
interesting feature of Java client is
that you can actually use interface
builder the same application that you
use to build Mac OS 10 carbon and cocoa
you is to build static swing interfaces
so we actually write out swing classes
for you and you can integrate these
swing classes into your direction Java
client application and when you do this
it doesn't mean that your whole
application suddenly becomes
it's full of these static swing classes
you can target this a particular part a
particular window of your application so
you get the best of both worlds you get
the dynamic functionality of director
Java client but in some cases where you
need precise exact control over the
layout of you I you can get that too and
you want to get really fancy with the
rule system you can start to write your
own custom assignment classes we talked
a little bit in the technical / you
yesterday about inheritance in EOS which
allows you to think about your data in
object-oriented terms well you can
actually extend the rule system this is
something that I've done to provide some
support for inheritance in the rule
system so in the end you can get a Java
client interface that looks nothing like
what you get out of the box for free
from us but by writing a little swing
and by learning about the real system
you can get the exact interface you want
and we re going to build this one you
see on the screen ok so these
controllers are very important so they
weren't a couple slides to their own
like I said they're analogous to well
components and they really implement
client functionality and they do this
between there's a glue between your
business objects between your data and
between the user interface so they look
at the description of your data that you
provide us in your eel model this can be
the same email model that you use in the
direct to web application or even in a
traditional web publix application of
any type so by looking at your eel model
different types of controllers are
responsible and generate different parts
of the client applications so there are
four main types of controllers there are
application level controllers which are
responsible for bootstrapping the client
application and are responsible for
getting all the other controllers up and
running there are user interface level
controllers which are responsible for
drawing and particular knowing how to
draw windows or modal dialogs and their
entity level controllers which look at
the entities defined in your model and
create an appropriate user interface for
them and there are property level
controllers which use your expressed in
the client as a particular widget
whether it's a text field a text area or
an image view and these correspond to
the attributes in your data model so
these controllers work together to form
a hierarchy and this hierarchy provides
the complete description of a client
application and of each user interface
within the client application and we'll
look at the director java client
assistant which actually will show you
the controller hierarchy throughout your
application so this is a very abstract
view of what the controller hierarchy is
so we see that this particular hierarchy
is enclosed by window tags and these
aren't the actual tags it's just
abstract for our purposes here so that
window is encompassed by a window tag it
also includes an action button
controller which is responsible for
drawing the toolbar and a tab view
controller which is responsible for
drawing the tab so you don't really need
to worry about the details of this right
now but if you're curious about how we
build up this interface and the
components behind it we use controllers
in this controller hierarchy ok so well
how does all of this happen this is kind
of a complicated slide but I'm sure some
of you are interested so the client
application starts up and they need to
generate a user interface so how does it
do this well it relies on an object
called the controller factory so it says
with the controller factory give me a
window for something it could be for a
particular entity or it could be a
controller for particular widget well
the controller factory knows how to do a
lot of things but it needs to rely on
the rule system for a lot of this a lot
of the information so it tends to
request to the rule system now the real
system lives on the server and it lives
on the server because you're ill models
in your roof files live on the server
and it's mainly for security and
performance reasons so now you have a
sense of where these objects lie on the
client-server divide so the rule system
then is contacted by the controller
factory and it may need to consult your
rule models and your data models for
more information so it packages an XML
description of these controllers and it
hands it back to the controller factory
then the controller factory is
responsible for creating this hierarchy
that we talked about before in the end
which you get is a user interface in
your application so this is all
described in the documentation again you
don't really need to know about it but
it gives you a sense of of all the work
that's going on behind the scenes so I
said there a number of customizations
techniques in director Java client and
let's go over them now so there's the
assistant and the assistant is a very
high level of customization technique
and it's very low cost and these are
listed roughly an order of cost the more
you customize your application and the
more advanced technique you use just
like with director web you lose a lot of
dynamic flexibility now the nice part is
you can make the decisions about you can
choose a customization technique on an
interface by interface level so you
don't have to say well I want to freeze
the XML hi controllers for my whole
application now you can say this one
window is really important and I need to
have total control over this particular
window so you freeze the XML for that
window so let's go go through these you
can write your own custom rules like I
said in rule editor you can extend
controller classes so all of the windows
you see em on on the screen are backed
by a controller class if you want to
tweak the functionality of a particular
window you can simply subclass on these
controller classes and provide that
custom functionality and like I alluded
to you can actually freeze the
descriptions of these controllers and
edit the tags manually if you want and
you can use interface builder of course
to build static interfaces and you can
actually interact programmatically with
this controller factory object so behind
the scenes in a running application the
controller factory is constantly being
talked to and and the application is
constantly making a request to it but
you may want to do that programmatically
it's a very powerful way to get a
particular interface and of course you
can write your own controller classes
and we're going to show you I think all
of these customization techniques in
this demo okay so I'm going to
I'm going to start a new application
then use the same model that we use in
the HTML the director web application so
I'm going to select director java
clients and just going to take the
defaults for now and then we'll select
the same model like I said and you
notice this Web Start pain here these
allow you to configure the parameters
for the jnlp file that we dynamically
generate for you that allows you to
provides the client application without
you having to do anything more about it
so I'm going to build and launch the
application and while that's building
and launching let's just look at what
project builder created for me so this
project template is actually simpler
than the director web project we created
it contains just that the class is that
web objects needs to bootstrap a Java
client application so there are two web
components we see in our resources we
have Star Wars model and one of these
rule models but there's really we're not
doing code generation as Miguel said
it's all happening on the sly this is
going to start up and you see rather
than starting in a browser we have this
swing application ok we'll figure that
out in a second and as a number of
interesting features so I can search for
items in the gells collection and then
get the results back here I can drill
down and look at the form of one of
these but one of the best things you get
for free is undo and redo so I'm just
going to change a couple things here and
change item name and save it I'm going
to select different conditions for the
item and I'm going to select the
different movies now Miguel is not going
to like that I'm doing this but because
we have full undo and redo it's not
going to matter so I'm going to undo
what I just did you notice that episode
3 change back to episode 5 and the
condition change back to what it was and
the item name change back so you get all
of this for free and yes you can write
your own undo managers and things like
that but will I do it when we do
for you so that's one of the best
features of Java client so let's look
for a minute at the assistance if it's
the first customization tool in the
first hand I want to draw your attention
to is the XML painting and the XML pain
allows you to view what we call the
specifications and these are the
controller hierarchies for each of the
user interfaces in your application so
let's look at this item form window so
this is a forum window for an item
record and identify that over here and
we can see just like you saw on the
abstracts lied about the controller
hierarchy we see that it's enclosed by
this frame controller which was
corresponds with the window tank on that
slide and we have this actions button
controller that corresponds to the
action buttons so in the state of file
button here is one way that you can get
ahold of this XML if you want to
customize it and move things around if
you want to do things that the assistant
doesn't allow you to do now we encourage
you to use the assistant to make all the
customizations that you possibly can in
it and then to move on to the other
customization techniques so let's
customize this app so it's nice seeing
the results of my search in this table
view here but I really want to see a
photo the photos of these items just
like they did it in the direct web app
well how do I do that well I actually
wrote a framework that provides this
custom functionality and i'm going to
add it to project and then we're going
to go through and i'm going to show you
we're going to walk through the
framework now if you can understand what
it's doing and I'm going to add it both
to the application server target and the
web server target the web server targets
correspond to the client application in
this case and because clients today are
very smart and have a lot of processing
power we can actually ask the client to
do a lot of things so it makes sense to
have a client perform some of these
functions so I'm going to rebuild a
project now that I've included this
framework and what do I what I expect to
see is rather than see the results of
the search in the table view I want to
see photos so let's bring the framework
up while that's building
takes just a second almost there so
again i am all i've done is i've added
this framework to the product so what I
expect to happen when I search for items
and I going to search for everything you
can search with wildcards of things like
that all the item names that have darts
in them alright so you see I get the
results back in this resizable window
just like that I can actually click on
the results and see more information
about them and I have a tooltip there
and all of that so how does it happen
well like i said this uses a lot of the
advanced directive java client
customization techniques so let's look
at it actually look at the framework so
the first thing we do is when the user
clicks the fine button we need to in a
sense intercept that request and take
control of the application at that point
so I'm using the rule system to do that
so let's open up this rule files in the
framework so it says for the query task
and we're querying on an item for a
controller that's an entity controller
item is an entity in my model use a
different class so rather than use the
query controller class which is the
default the EO curry controller class
which is the default use this custom
quick controller class so if i look at
my framework for a class named query
controller we see that it's a subclass
of view of query controller so it
doesn't do much but the most important
thing it does is it overrides the fine
method and this allows me to take
control when the user clicks find so I
get the fetch specification that direct
director java client constructs for me
so when the user clicks find clicks fine
here dress java client is constructing a
description of the data that the user
wants to fetch based on the queries the
query parameters they've entered so now
i'm making an indication on the
controller factory we talked about this
controller factory object and that you
can do very powerful things by
interacting with it programmatically so
i'm asking it to open a window for
another task and in this case the task
is
scroll well where does that come from
it's not one of the default task but
it's a task that I defined in my rule
file and so what I'm saying with this
rule is that when asked for the scroll
task provide a window and the window
that I want to provide is corresponds to
the definitions in the scrollview
components you're all following me so we
go to back to the framework and I have a
component called scrub you can fun it
and it's a DW component so we use dtw
templates in java client is actually the
templates for a lot of these controllers
so don't really need to understand that
but the important thing is that this
contains throws an XML so this is part
this is an XML hierarchy for the
description of the window that I want to
display so it includes a frame
controller with a bunch of tags it
includes a single text field controller
with static text but most importantly it
has this generic controller tag and this
controller tag specifies another class
in this class is a scroll view
controller class so again I looked at my
project for scroll view controller well
what is this it happens to be a subclass
of view of widget controller and I'm
subclassing you a widget controller
because it already provides a lot of the
functionality a lot of it's smart to
actually display a swing widget but I
want to write a new widget so I override
this method to return a new widget and I
don't know much about writing swing but
you know I spent half a day and went to
the Sun docks and I could figure enough
out to actually write that scrolling
component so here I'm actually writing
my own swing and plugging that widget
into the client application and the
images are actually instances of jbutton
actually a subclass which allows me to
click on them there so we're using a lot
of the advanced customization techniques
and as you can see you can get the
precise kind of user interface you want
thank you
take from I'm sorry so we talked about
director web we talked about director
java client the last thing we had on the
introductory slide voice director web
services we won't talk about that
because in this slide because there's a
whole session on director web services
on Friday what I want you guys to keep
in mind if you go to this session is the
process when you're hearing about
director well they're introduced web
services a lot more in this session but
there'll be a part of the presentation
will to talk about director web services
so keep the process in mind you're also
starting with a model you're also
getting a default apps for free and
you're also using customization
techniques very similar to the ones we
showed you here so that's all and if you
want to know more about director web
services go to the session 6 12 on
friday summarizing what we talked about
today we talked about the rapid
development technologies to direct the
star world you come in at the very
beginning by giving us a model at the
description of your data use director
web director java client or direct the
web services and we give you a default
application for free you use an
assistant the special assistant in
depending on which technology using but
they're going to be similar
functionality and you start doing basic
customization by doing in direct
manipulation of the rules and you can
get very like roll up your sleeves and
do heavy duty HTML java or xml all the
stuff you you guys do it with objects
developers and you can plug in bits and
pieces of your of your components into
our running into a running application
until you finally get to your customized
application so that's that's the end of
our session today the roadmap this is
what objects stay in this in this room
too if you haven't noticed we have a
bunch of what object sessions all day I
think session is important relevant to
this one our advanced eof at the end of
the day here and the creating web
services session on Friday contact page
you've probably seen this a lot of
a lot of times and this one is important
brent has put in a lot of work in
writing a lot of books and documentation
for the director work there to start
technologies and the rest of the doc
team and he's got some books here and we
have a book for direct way of a book for
direct java client the advance the us
both so there's a lot of places to start
out and QA I'll put these slides back
while wearing the Q&A you guys because
we never leave them long enough are you
guys
you