WWDC2001 Session 606

Transcript

Kind: captions
Language: en
so hi and welcome to session 606 a java
client my name is andreas danke I'm
still the match of the web objects rapid
development team and before I dive into
director Java client I'd like to quickly
summarize what Java client is so who is
seen session number 609 this morning
okay thank you so most of the content of
the session will be based on the session
16 at 9 but if you missed it I don't
think there was too much information
that you will get lost this time so Java
client is a technology for creating
three-tier desktop applications the
client to you the client process
displays the user interface and
interacts that the user the server is an
AB AB object application server and it
accesses the database and the database
30 year stores the data the important
pieces are of information on that the
client never accesses the database
directly it always goes through the
server so the server has full control
over the access that the client has to
the database and the other interesting
information is that Java client uses
HTTP as the standard communication
protocol between client and server so
you get the connectivity of an HTML
based application but you get a much
richer user interface Java client uses
the Java foundation classes swing as the
user as the fitted layer so it's basic
platform independent it just requires
JDK 1.3 Java client is localized with I
actually forgot to talk about this this
morning but if you do localization you
do it the same way as with cocoa so you
have multiple versions of your files
like my 2 interface files and you just
give them you know special extensions
like - German or - English and then it
goes to the localized versions at
runtime and Java client is really
designed for the intranet it's not the
technology you should use on high
traffic Internet sides because it takes
a long time to start applets when they
have to download classes or at least you
have to install client start program and
then having the installation process all
this means that you can't use
the internet so director Java client
makes developing Java client
applications really easy it's actually
so easy that we map object engineers
often compared to instant coffee for
which you just have to add some water as
you know now in our word you don't
create instant coffee if you create
instant applications instead of water
you just have to edit you model but I
promise you you can create Java client
applications much faster than you can
drink your coffee
so dr. Java train is an infrastructure
that is designed to help you to develop
Java client applications it does so by
providing you a lot of predefined
application functionality you can make
use of and it also does so by relieving
you from the burden to create user
interfaces by hand and interface builder
instead it generates user interfaces
dynamically based on information it
finds in your new models that saves you
a lot of time and also money if you
think it's ideal for prototyping
purposes but we know that the default
application that you can generate by
just analyzing the ear model would
probably not be the application you want
to deploy to users in fact we think we
know that we will hardly ever need the
application in a way that you can just
ship it to your user so that's why we
design director Java client to be very
extensible
it's very easy for you to plug in your
own customizations and if you offer you
a lot of techniques you can use to
customize the default application and in
this session I want to show you those
techniques so we have a lot of topics I
want to cover first of all I want to
show you how to create directed Java
client applications I want to walk you
through a default application so that
you know what the predefined
functionality is that we provide I want
to introduce you to the architecture
that is used to talk to Java client
applications I want to talk about
controllers and the rule system you will
find out what that is and I want to
focus a lot on customization so how can
you customize the default application
and in the end I want to give you a few
good reasons why you should really use
directive job I really want to burn it
in your brain so first of all I'd like
to
under sang to come up on stage and give
you a demo of how to create a Java
client application so we could switch to
the demo machine thank you I get so many
demos here I have to use the script No
so this time you want to use a little
more complex new models this morning you
use the rate of this simple education
model just looped around a person this
time we use our movies and rentals
models that can be the web objects 5 so
there are two models that work together
have some movies database and there's
some kind of event and store information
based on top of that so those are the
two models and I'm just going to project
data it's the new project choose the
right project type it's the director
Java client application do the name
and this time we had two frameworks the
one that we used this morning Java
client class loader which makes our
demos very easy and the Java client
business logic framework which contains
our two models the movies and the
rentals model you will actually find
that that all the in all the exams with
the objects file so those are the two
models the assistants place the ones
that it found in the frameworks and
that's it just say build and launch the
project now
and the interesting piece about this
project is that there are no client-side
components
there's no interface file you find there
are no classes for the client-side
because everything is generated
dynamically on the fly so in the
meantime the project was compiled and
starting right now and this is our Java
client launcher that connects to the
server so this is the UI that you get
just without doing any programming this
is the default application so if you see
a subset of the entities displayed here
those are the most important entities of
the modern studio tel and movies and for
every entity we have you know a query
interface where we can enter qualifiers
so runner says just searching for some
studios right now and then he's
switching back to movies and we can
search there's way now he's searching
for our movies for the title and you can
also a pen trace so we just append it to
the previous search result all the
movies that start with an S and now
we're going to take look at some details
of this movie
so if you see the information about the
movie it's safe at the top of the window
there's the studio and then in the tab
view we have a display of all the
various relationships and if you want
you can get more information about the
talents there just by pressing the Open
button so just leave it like that and
maybe you can close that window again
and then that's last step let's select
the studio so if you want to assign a
new studio to this movie press on the
select button to get a motor dialogue
that we can search for Studios and then
just select any and it's that easy so
thank you Ron you could switch back to
the slides so as you can see it's fairly
easy to create relatively complex
applications right if you just just took
a few seconds to run to the assistant
and it already generated us fairly
user-friendly application that you can
use to edit and display all the data in
your database let's take a look at the
architecture of the application this is
the guy diagram from this morning so
this is a normal Java client
architecture if you've missed the
session this morning don't vary the only
thing that is important to take away
from here instead in dr. Java client we
had components to both the client and
the server side and the client side we
had this layer called new generation a
new generation is responsible to make to
initialize the do not dynamic user
interface generation and just make sure
that the application still does
something sensitive even if you don't
give it any user interface and on the
server side the generation has a layer
has a component that analyzes the ear
model and the base details the client
how the UI should look and this layer
this server side component of your
generation is based on the same
technology that they use for diak today
I will talk a little bit about the root
system in this session if you want to
get more information about the please
come to a session of a six-night way if
that's tomorrow direct web and my
colleague McGarry we talked about the
rich is so much more than
so let's take a look at the client and
direct a Java client on the client side
everything is done with controllers you
can consider controllers to be the glue
between the user interface and the
structure of UF objects that is
necessary to display and edit your data
that sounds a little bit like the EU
associations that you got to know this
morning the controllers are actually
much more they don't only register for
some events and send some strings back
and forth they actually know how to
create and layout a user interface that
is appropriate to edit your data and
they also know how to create the UF
objects they're necessary so editing
context display groups associations
control let us know how to create all
that and on top of that that you should
implement a fairly complex piece of
application logic so as I said basically
the whole application entire to Java
client is implemented in terms of
controllers and you can probably imagine
that for a complete application you need
various types of controllers to take
care of different tasks so that all the
controllers can still work together
nicely dr. Java trying to finds one
class for your controller and everything
is is a subclass of this one class if
you really distinguished four categories
every application needs some kind of an
instance the text care of starting the
application and manages global
parameters in the application that user
defaults document management stuff like
that that's usually called an
application object and so directed Java
client has an application object which
happens to be a controller there are
also you know just purely UI related
tasks just you know switching some views
in the tab view just managing Windows
stuff like that and those kind of
controllers because I'll just use
interface controllers and then the most
complex controllers are what we call the
entity level controllers those are the
ones that really define the flow of your
application they handle business logic
on the level of the business objects so
they know how to you know query for
objects you know how to display lists
they know how to create forms to edit
the objects and the fourth level are the
property level controllers which take
care of your business logic on the level
of the single
property so they have you know they
create text fields combo boxes to depict
lists and those are the property level
controllers now controllers are
organized in a hierarchy and that is
important because when the user
interface is generated it basically
reflects the hierarchy or the views that
are generated for the user interface
reflect the hierarchy of the controllers
so when a control that creates a view
for the user interface that view is
placed inside the view of its super
controller the best way to understand
that I think is to just look at it as an
example so the right side of the slide
we have a fairly simple window that has
a toolbar at the top assuming the text
field and then a tab view at the table
and the plot summary which is probably
something like a text area so the
controller hierarchy necessary to
generate this window would look like the
one that I have on the slide so there
would be window controller at the top
there would be two of our controller
displaying or the actions that can be
performed inside this window you find a
text view controller and the tab view
controller and since we have two tabs in
the tab view there are probably two sub
controllers the table view controller
and the text area control and that's it
since we have two columns we also have
two color controllers actually so what
we know so far is that the client is
implemented in form of controllers but
where do these controllers come from but
how do we do we tell the client what
kind of controllers to generate let's
first take a look at how we take the
client well director Java client uses an
X and a format and control us the
hierarchies of controllers are just
described in XML and you know when you
find the typical text for every
controller type that we have we have a
tag so for the control the hierarchy of
the slide before you know you can see
there's a window controller there's a
tool bar controller text book
controllers and then they specify some
labels and have additional attributes so
this is the way we tell the client but
where do we generate this XML
but I already told you that the most
important resource of information to
generate the user interface is your new
model but the ear model is not something
you want to send to your client first of
all it opens all kinds of security holds
if you do that and second of all it's
just a lot of data that you will need to
send it so much better place for the ad
it's the server side and this is that
this rule system comes into the game the
root system is the mechanism that
generates the information how the client
should look like in behave and I will
talk about a few details on the
following slides but there are few
things I'd like you to know and keep in
mind before you can go into the details
first of all most rules are defined in a
fairly abstract way if you write rules
they're usually independent of the
concrete ear model that you have they
are not related to you know an entity
with a good name they're usually related
or they are very often related to just
you know entities the certain criteria
so what that means is that rules are
fairly abstract and can be applied to
multiple applications right to multiple
models so the root system is a very
convenient place for you to define your
own look and fear so but doing it you
know by changing the world system and
and defining a set of rules you can that
you can apply to your whole application
speed you can define your own cooperton
look and feel for all your client
applications that you create also very
important is that the root system is a
very convenient place for localization
and talk about that a little more but
keep this in mind and again it's based
on the same technology that active APIs
using
you can consider the root system to
basically be a question/answer mechanism
questions you can ask the root system
are what kind of windows are available
my client education other questions are
what kind of background color should I
use for my text fields or should I
should I actually use the text field for
this kind of property or should I use an
image view those are the those are the
questions you can ask basically
everything that is defined or everything
that appears on the client side you know
it's the answer its response to the
question that you sent to the root
system and the answers to these
questions are given in the form of what
we call rules director Java client
defines a set of default rules right
that come to the framework the director
Java client frameworks and it's very
easy for you to define your own custom
rules now in dr. Java client the client
only asked fairly high-level questions
right if you could go and ask the server
all the details it kind of color should
I use what kind of its widget but there
would be a lot of communication right we
don't want to do that so the client only
asked the basically when it starts up
requests a certain set of you know
status information what kind of minutes
are available and then from there on it
will only ask for detailed descriptions
of complete windows so that we avoid too
many round trips between client and
server the client will also not ask for
all the controller hierarchies at
startup time right that would take a
long long time so it only asks for the
detailed window descriptions then when
you actually appears on the screen so
when the user activates the window so
the client asks high-level questions and
only one window at a time
and when it does ask for a window it
provides a certain amount of input to
the root system and I listed it here the
first one is the question so what kind
of window are we actually interested in
is the normal window is the modal dialog
is actually just a primitive controller
which are they kind of just a little
piece of the UI that's you know
independent of a window those are the
questions also what kind of task is the
user performing right now what kind of
you know window do we have to create is
the query window is the list window is
the deform the windows related to a
given you know to one complete
the entity of the past identity to the
root system and then there are two more
things that passes the Platinum passes
some platform information and some
language information the default root
system does not make use of the platform
and the language but it passes it anyway
just so that you can make use of it if
you want to do platform or language
specific customizations let's take a
look at all the objects that work
together to make the set the client
starts up it uses indirectly Java time
you use a special application class it's
the subclass of this new application
that we use in the Nama Java client it's
got your dynamic application and it's
responsible for initializing the dynamic
UI generation and its most important
task is to create the so-called new
controller Factory
the controller Factory is the object
that requests you know all the
information from the would system and
instantiate controllers so when we start
up if you make some root system requests
to the server and find out what kind of
windows are available what kind of extra
should I provide to the user and the
root system on the server side but then
take a look at two types of files
first of all the EU model this is the
most important resource for the root
system and then the so-called d2w
monitor d2w models are the fights that
store the rules and you can basically
consider it to be the UI model right if
the EU model which describes your data
it's the data model into the d2w model
that describes your UI so the root
system will analyze you know all these
files and come up with an answer to the
question and send this back as XML then
the controller factory uses this XML
description that is kind of a template
for controllers to create the concrete
controller hierarchies and those know
how to create the user interface the UF
objects they're necessary to edit your
data and then when the user works in the
UI he or she might trigger some action
that X requires to open you know other
types of windows so there's a controller
that registers for some events and when
it has to open other windows this event
will be basically forwarded to the
controller factory and then the
controller factory we make another round
trip to the server request new
xmlhttprequest
one of the strongest features of the xml
generation is that it's based on the web
objects component model so we generated
xml we use both xml nodes adjustable
component the use dynamic elements like
war repetitions of all conditioners and
the use so-called d2w components which
are special components that connect to
the rule system d2w components use the
so called d2w context and the d2w
context is an object in the root system
that stores are the input parameters
that came from the client source of the
object that basically manages the rules
and it's the entry point for you to fire
was to ask for the the answers we call
that firing rules so that's actually a
very very strong feature because you can
use the complete dynamic elements engine
to generate X may write set of general
dynamic HTML you can all generate
dynamic XML and director Java client
provides you two tools you can use to
change rules first one is the assistant
before they seen that this morning
actually no we didn't but I think we saw
yesterday in one session the assistant
is a tool that runs inside your client
application and that you can use for the
basic customization tasks and if it gets
more complicated you have we used the
full development tool running on the
desktop it's called the rule editor and
you have to use the rule system at the
word for the advanced customization
tasks for example if you want to change
the startup sequence right completely if
you want to introduce login panel it's
before the query window appears stuff
like that then you would have to go into
the rule editor and I'd like to ask Ron
to come up again and you'd like to
demonstrate the assistant and through
alias to you so if you could switch to
the demo machine
okay we are connecting to the same
server that degenerates to the same
application that you generated the first
demo and if you're in development mode
in the Tools menu find an additional
menu item called the assisted so this is
the assistant it has you know there's a
tab view for different kind of
information
it displays the you know I would be
figured out what kind of entities are
important it displays what kind of
attributes you use for creating and
displaying there's some more stuff in
the middle and last step there actually
displays the XML descriptions that we
use for the various types of windows so
if you want to look at the query window
and this is the XML views so this is the
XML be used for the cleaner right so
it's easy for you to inspect and see the
rules that you wrote actually you know
do the right thing so did we want to do
I think we wanted to go and change a few
of the properties so we'll start with
the entities we first of all moved the
user entity from the main entities the
main entities are the ones that appear
in the query window so we don't want the
user there we want to reorder the little
bits that studio appears first and then
movie first and then studio and talent
and then we just press on the Reese save
the changes every person to restart
button
and as you can see now our application
has already changed a little bit but the
user disappeared we only have these six
entities left in the Carolina now let's
modify how we can search for movies so
instead of searching for the title and
the plot summary the bowl team let's
search for the title the category the
rating of the movie maybe the studio and
before we apply these changes directly
to the UI let's go and look at the
studio query form it's the name of the
budget that sounds like just fine so
let's go on and go to the talent so as
you can see the assistant follows you in
the UI who had an updates to the place
where you currently are so if you just
want to search for not-stupid first name
there the reason why there's no control
for the photos they're there to traffic
and thought out this is that the photo
is and it's data object it's an image
and there's not really something you can
enter in the UI so it didn't even
generate a text view to it so that's
just you order that that the last name
appears first and then save and restart
the application so now as you can see we
have different set of very properties
for the movie click on talent also okay
see last name is first now and then
first name
now I think it's the last step we wanted
to go into the rule editor right and
actually I can you open that window
sorry so as you can see if you look at
the plot summary it just uses to see a
text field there right let's say we want
to customize that to instead of using in
a text field to use a larger text area
you know the scroll bar you could do so
in the assistant by going to the widget
pane and adjusting the parameters but we
want to demonstrate how to use through
it as we do it by hand and we'll so why
don't you create the client application
then the project builder there's this
user d2w modifier so we open that in
Rueda tur see these are the rules that
the the assistant already generated for
us right we're going to add a few to
them so it's going to be a little bit of
typing for
as a starting point he
I think it's easier for you if you just
yeah one for the first one
so would you support use a qualifier
that basically determined whether this
rule applies to the current environment
and you just you know we duplicated one
of the woods that was there already and
just modified just because it's a little
easier
so as you can see the Bezier oh the
qualifier that describes you know the
plot summary replies to an entity with
the name plot summary for form and
you're looking for widget controller
right now so if you want to give the
answer to this question what kind of
widget controller should be used for the
plot summary
no answer is to be in you text area
control
just delete those three and duplicate
the first funny bit okay so just
duplicate that one okay you want to
modify a couple of parameters for the
single digit or I've already said it's a
new text area controller we also want to
give it a minimum hide
we wanted to be vertically resizable
and we don't want it to use the labor
component because this text area is the
only rigid in this tab view anyway so we
don't need a special day before them so
just save that and then you're compiling
our application
I'm just starting it again
okay it runs - searching for another
movie again opening that one
and as you can see now instead of using
a single text view if you have a text
area that has a minimum size fully
resized right okay thank you wrong
so as you saw the movie edit it's a
little more complicated to use
alright that's why we have the assistant
the assistant will help you with the
first tasks of customization you can you
know select the entities you want to see
in the query window you can you know
actually switch the widgets the same
tasks that we just performed in realtor
you could do in the assistants much
easier there but if you have very
advanced tasks of customizations you can
go to the rule editor and now I'd like
to talk a little bit about localization
because you know the localization scheme
that cocoa and Java client by default
uses that you have multiple versions of
your interface files right one for the
English one one with German leads but
that's pretty inconvenient and very hard
to maintain because if you want to make
one change you have to change much but
it files and title Java client dr. Java
can everything is generated dynamically
anyway so also all the labels appearing
in the UI are generated dynamically so
how could you use the rules how can you
use the word system to perform
localization and the first thing you
need to know is that by default
Java client leaves the generation of the
labels titles every time use the
generation of the labels just to the
client the client just performs some
kind of beautification with you know
entity names attribute names
relationships names that's how the
labels appear if you want to change that
you can actually use the root system and
force the labels to be part of the XML
so as I already said before the client
will passed some language and platform
information to the root system the only
thing you have to do is you have to
write a few rules to return a localized
labor and when you get the slavery from
it's up to you one next one suggestion
could be you could go into your ear
model use the user dictionaries and then
add a localized version of every you
know attribute and property name or
entity name to the user dictionary in
your model and then your root system
could actually access the user
dictionary in your ear models you could
write one single rule to determine the
label but it's probably more convenient
for you if you write multiple ones one
to beautify or you know to look for
entity labels want to look for property
or attribute and relationship
Davers but the advantage of this
solution is that you do it in one place
you don't have to maintain multiple
fires right at at the same time you you
know you have probably one string table
or maybe it's part of the ear model in
the user dick trays but just one sing a
place for you have to maintain the
localization information you don't have
to edit multiple nib files so the rural
system is really much faster to do
localization then if you do it by hand
and I won't have time to show you an
example of this but if you go to the
sixth session six five directive F but
then actually Miguel has a concrete
example running a localized application
now I'd like to spend some time and try
to explain you why the default
application looks like it does when
directed Java client starts and analyze
the ear model and the first step is to
categorize the entities in the model it
distinguishes between three categories
the first one is the list of our main
entities main entities represent the
most important objects in your model
those are the ones that appear in the
query window the second category is at
the enumeration entity's innovation
entities are very similar to manatees in
the in the sense that they represent
like you know it's self-contained unit
but they are they are very simple
objects they only have very few
attributes they are usually used in pick
lists so if you want to have you know a
list of states list of countries a list
of continents maybe movie ratings those
kind of things are represented by what
we call enumeration entities and
everything else is what we call
dependent entities dependent entities
represent you know detail relationships
of main entities let's look at an
example so this is a model you know we
see couple of entities see a group drawn
talents and movies and the relationships
the actually director Java client uses
the most important information inside
the model it finds it uses other
relationships and if it looks at this
model here it will probably find that
you know there's a talent and talent
photo entity and we'll probably find
that the tenant photo is owned but
tell an entity right it's dependent on
the tender entity Italian father cannot
exist without a talent so it will make
the tenant folder dependent entity and
the talent the main entity the same
store for movie roles the rewards depend
on talents right they cannot exist
without a talent so the first thing it
finds is there's mainly talent and too
dependent entity is telling photo and we
wrote the root system looks further if
we find that there's also movie entity
and plot summary in voting also
dependent on movie so there's another
main entity movie and more dependent
entities and rating matches the
description of an enumeration entity I
gave you so far and the rating is used
inside some pick lists you know their
reference by a movie and so this is a
numeration entity the second step for
the root system is to categorize
properties and again use four categories
first of all use the list of query
attributes so those are the three
properties those of the properties you
use for searching for objects there are
list properties those are the ones that
you use if you display tables of objects
and their form and properties which we
use you know the input fields or these
are the properties to generate input
fields for if you want to edit an object
the fourth category is the identify
category and it's used whenever you
reference an object for example in error
messages or if you just you know want to
display quick information just a little
bit of information about a relationship
you usually identify attributes when it
has this information the root system can
determine what windows are available in
the client application it obvious would
have a career even though if it has if
the model contains enumeration entities
it will also generate an enumeration
window for every main entity the root
system we create a form window with the
detail user interfaces and also for the
main and main entities if we create
modal dialogues that you can use to
select objects you know then you want to
assign values so you add modal dialogues
that you can use for selecting the
objects for the relationships the modal
dialogue that we saw in the demo was
that we select the studio for example so
both movie and studio main entities
and generally the more dialogue for the
studios to search for monster back so
this is the information that the root
system has to determine when the
application starts and it will then sent
this information to the to the client
and from there on the client we make
explicit round trips to get the detail
information about every single window so
that's the next step when the client
asks for it if you would determine the
concrete widget layout in just an
example for forum windows the heuristics
that we use are you know we use rows and
columns for attributes you know that it
depends on the number of attributes that
you have how many columns we choose or
the mandatory to one relationships two
main entities are displayed in boxes so
if we remember the main at the movie
window it had box for the studio all the
other relationships wouldn't switch
controller which is usually tab view and
keep in mind for the enumeration
entities the root system generates
simplified if you sorry I forgot about
that the reason why we distinguish
between main entities and in relation
entities is that for enumeration it is
you can create much simpler user
interfaces you don't need more dialogues
and all this you know big user interface
we can just create a combo box or maybe
simply pick pick list so the rules are
similar we find that the reference
enumeration DT and then perform windows
generated simplified user interface
typically combo boxes or pick lists now
I'd like to spend a little more time on
customization
there are three levels of customization
the first one we already got to know the
to its word are the assistant who editor
the first level of customization means
you're working on the level of rules but
that has the advantage woods are fairly
abstract that can be applied to much B
models often and they're very simple to
maintain and to change the second level
of customization is what we call
freezing freezing means that you bypass
the rule system and you hard-code the
XML that's supposed to be used by the
client or your hard code interface files
so the user interface layout right enter
at X 5 4 X Amalia went to nip 5 for the
user interface files freezing means that
you stop the transition into traditional
development but your heart called you
eyes right or the behavior of the client
the third level of customization is very
actually really back to traditional
development you actually write source
code right the most common tasks are you
know subclassing using subclasses of our
controller classes to change the default
behavior or if you don't like the
complete flow of the application you can
programmatically change the controller
factory behavior which can give you a
very different flow to the application
if you freeze XML you bypass the rule
system you can decide whether you know
to use just static XML to adjust the end
result right or you can mix the xma the
dynamic elements so you can use more
repetitions or conditional it's rather
d2w components to still generate parts
of your user interface dynamically just
use an XML template around it you can
decide to freeze complete windows or
just little parts of it it's up to you
and the more dynamic elements you use
the more your XML becomes through your
template right we have some kind of an
excellent template that is responsible
for this layout the formulas that I
described to you the attributes at the
top zone columns the relationships to
main entities you know in boxes the rest
of the tab view you can change that
completely by using you know different
kind of template when you use frozen XML
you have to register that the root
system the way to do that is you just
write a rule as detailing the word
system don't do the normal stuff just
use this x-mas to find an answer if you
freeze interface files you bypass the
root system and even the generation of
the UI on the client side you basically
tell the client exactly this is the UI
so you should generate that gives you
full control over every single pixel in
your UI
again you can choose you know to just
freeze a little part of your window or
you can freeze the complete window
if you only freeze parts of the window
then you can be views of so-called sub
control areas if you freeze parts of the
window that means that you will still
have some sub controllers that are
dynamically generated some pieces of
your venue are still dynamic and some
controller areas are just empty views
empty boxes you can place in your
interface fire and then the still
dynamically generated user
controllers or the views of those
controllers go into this place so you
can point the client directly to where
to place the steel and amity generated
you eyes I will show that to you in a
minute
again if you freeze interface files like
the freezing xma you have to register
with the root system so you have to
write rules for interface files you
probably have two by two its first of
all you have to tell the root system
that there is an interface file and
second of all you probably want to tell
it to suppress the generation of you
know additional sub controllers if you
don't do that the root system will still
generate all the normal sub controllers
and use the UI that comes from your
interface file so in the Tools menu
write code right then you can do
everything you want but if you don't
like what we are doing in our
applications you can change it there are
so many things you can do that I can't
even list them but the most common tasks
are you know you can subclass controller
classes to support you know your own
custom widgets if there's a visit that
you wrote yourself and you want to have
an association for it you can write a
controller for it right and that way you
can easily get it into the dynamic UI
generation if you want a different
layout mechanism if you don't like rows
and columns you can write a controller
that just lays out the digits in a
different way if you want you can you
know work with the qualifiers and
specifications that you generate you
know if you want to change the way we
fetch object from the server you can do
that in the controller's
if you want to add additional access to
a UI right we have to default extras
like safe we word and we do other stuff
then you know controller subclass and
controller classes is a convenient way
for you to get that into your UI and I
already mentioned that if you don't like
the flow of the application at all you
know if you don't like query windows you
don't like for minutes you won't have
one application to use just one big
window
you know in this quickly unusable you
can do that and you do it with the
controller factory there are two ways
you can do it you can either use your
own implementation of the controller
factory so you can use a subclass or
view probe as an alternative if you
provide you with some delegate methods
you can use and you can implement it
depends on your needs whether it's
enough to use delegate or not
so I'm actually have a demo for that and
although the slide says everyone is
going to give it I'm going to give it
myself because there's so much clicking
that would be hard to synchronize so if
you could switch the demo machine
I prepared a project that I want to use
to show you some customization
techniques and start the server now
Kate's done I use the typical Java
client launcher to connect to my server
process
and what I did in my for my for the stem
application I first of all used the
assistant you know to modify you know
the main entities innovation duties I
set some minimum sizes that's why the
career even already comes up with a nice
size i modified you know the query
attributes of movies studios customers
etc and I used some special
customization techniques like freezing
to modify the movie window so it's not
pretty but it's highly visible what I
did so this is really different than the
window you saw before the so first of
all you know we regroup the widgets at
the top that's not a special box for
studios right all the text fields are in
one box now also we use you know
multiple columns in the middle but not
for all the ditches there's some
additional you know information for the
user what happens if he or she presses
one of these buttons actually there's a
new text field that displays the number
of roles it's the same for the directors
and for the plot summary we change the
layer pretty dramatically and also
please note there's a little button here
in the ditional action the UI if I press
on that one it's actually opening both
talents right all the talents that are
playing role in this movie are open
automatically so let me show you what I
had to do to get this to work go to my
project
first of all the server I didn't change
anything
well there's a tool but the standard
classes like application they didn't
change the session didn't change they're
still the main component there's my
icons fire but these are all the normal
components of about the objects
application and then I grouped
everything else that is you know
specific to the customization this
additional group let me show you the
user d2w modify so these are the groups
these are the words that I wrote with
the assistant as you can see and I
mostly change property lists you know
what you use for querying and set some
minimum sizes for some windows you know
I determined that I wanted his labor
components or you know change the
resizing behavior of some of the
controllers and change the type of
controllers so in this case you know use
the checkbox control instead of a normal
text field I use the text area
controller those are all the things that
you know I can just do with the
assistant then I also use some frozen
XML and some frozen interface files and
as I described before I have to write
some rules to register those frozen
components that the rule system this
first rule here uses the key archive so
this one is the this is the word that I
use to create an interfere to register
an interface file at the root system its
name plot summary form it's an interface
file for this piece of the UI I'll show
that to you in a second and then for the
same context I had to use this rule here
but I mentioned before that any two
words if I want to work the frozen
interface files it says generate
sub-controllers for words so i suppress
all the generation and of the of
sub-controllers because i want i have
everything in my interface file and this
one is through that i used to register
frozen XM a movie forms the name of a
voc component that contains my ex ma and
the Stillwood that registers it with the
root system so let me show you the
interface file first of all
and where interface Peters launching
should be fastener
so this is the interface file yes you
can see I was just interested in
changing the layout for this piece of
the UI right so all I have to do in mind
of is file specify the widgets that I
need in this particular you know view of
the tab view and you know you can choose
which pieces you want to put an
interface file and which ones you would
have put want to put in XML the movie
form here's a vogue component this is
the xma I started with the XNA from the
assistant I mentioned the assistant went
to this X and a view and selected what I
already you know but the root system had
already given me by default and then
copied this into this flow component and
modified it by hand so as you can see I
you know I introduced this box
controller and then you know these are
the two columns for the text view
controllers that we saw and now it's a
mix there you know the other dynamic get
for you know the other Bowl components
so I can you know I have frozen XML or
you know the static xma and I can mix
that with other web objects so that
other boat components if you look at the
watch fire you can see that by using you
switch component which is another
subclass of d2w component and this is
you know this is a way to plug into the
root system again right i created the
template using some XML but some of the
X some of the UI is still generated by
the root system which means that they
can still access it and modify it that
the assistive also as you can see to
display the number of roles and
directors I used to four components it
actually turns out that they are the
same so I created a reusable component
called count display
you know that just has some other web
objects complaints in there
you know it's a static labor controller
it's a text view controller and as you
can see I'm just using votes and any
nodes to specify the content of this so
there's a works in any node for
component controller which groups in
labor controller and the text view
controller and the last thing I want to
point out to you is to plug in my
controller class I just specify the T in
the X in area it just gave it another
class name so I'm using a form
controller I'm using a special class
name this class is here and as you can
see it subclasses your form controller
this is the code I had to ride to Omar
the talents this method here registers
an action which busy is responsible for
creating this button in the UI at the
top right of the window this is a method
that determines that this pattern should
be enabled or not and this is the
concrete implementation of the action so
you can see I'm just getting the editing
context asking for the talents getting
the global IDs and then I'm using the
controller factory to create you know to
open the form windows for this closed
for these global IDs so that's all I had
to do to make this happen
okay if you could sit back to the slides
[Applause]
Isao you a few reasons why you should
use director Java clang and the most
important one to me is that you end up
with a much better development process
if you start you know projects that the
traditional development you first of all
have to write some application logic you
have to create some user interface files
and you know what they all subject to
change anyway because the first time you
show this to your customers they will
change their mind it's obvious the same
so the title Java client you can
actually focus on the business logic
first you start with the database and
your model and maybe implement business
code you just create a default
application and this default application
is already able to execute your complete
business logic so you can or you go and
show this to your customers they could
try out a business process with it
you know if you want to show them a
little more hard we look like it you
know in the end you can go and customize
with your system or that's a rule editor
or if it's not good enough you can free
some XML but you know it's piece by
piece you only do what you need to do
and you still focused on your business
logic it's really important and then
just in the end and the customers say ok
this is the business process I want it's
doing all the right things
I just want to polished UI then you go
and head and go ahead and fine-tune your
application but the important message is
really the directive Java client you
always you always have the working
application that you can use to execute
your complete business logic so the
benefits are there first of all it's
very fast and efficient to develop a
directory online because so many pieces
are done for you automatically it also
allows you to react quickly to
requirement and so database changes
because a lot of the changes in your
business model are picked up
automatically by the woods but you don't
have to go and change interface files
for that it's just happens automatically
for you since you use a lot of
predefined application functionality
your testing time should also be reduced
right he already gave you this
functionality you don't have to write it
again we did some testing with it
maintenance of director Java client
applications is easier because it's
mostly data-driven you know if you don't
have to write a lot of source code for
it
and maintaining and editing data files
you know X and ay offenses so it's much
easier and much less error-prone than
writing source code and again you can
focus on your business logic so before
we go to questions and answers I'd like
to give you a few tips for using data to
our client the first one is try to use
it for every project you know it's
directive Java client is Java client
it's not different just a different way
to start a project and to maintain the
project prototyping is so much easier
and that the customization techniques
that we have freezing XML and freezing
interface files you can smoothly
transition into traditional development
so the other piece is the other tip is
try to define reusable components you
know you're used to that if they're
objects anyway create frameworks you
know that contain common words if you
want to define your corporate look at
for you put it in a framework right if
you develop things like login parents
reporting put it in the framework you
can use frameworks and reusable code
just like a Java client if you can do
with any other application also keep in
mind that localization is so much easier
to talk to Java client and it might
actually make your deployment it is
simpler the reason for that is that if
you want to upgrade your application if
you want to change you know you want to
fix it back you can off do so on the
server side because the root is two
lives on the server so by upgrading a
service system you can fix bugs in your
client side and that might produce you
know the need to install upgrades on the
client machines so diner Java client
makes your life really easy it generate
applications dynamically based on
information you find in the new model
there's a lot of predefined
functionality if powerful customization
techniques and it's a smooth transition
into traditional development and it's
designed for extendibility right it's so
easy for you to plug in your own
controller classes your own source code
so before we go into Q&A I'd like to ask
one of our long-term of objects
developers here from Cote Feb to come up
on stage and share some of his
experiences at active Java clan with you
so in the last year or so we had the
opportunity I'm bill Bumgarner with code
fat we had the opportunity to do a
number of projects that used either
direct to Java client Java client or
direct to web in this particular context
they're really all kind of the same
thing because they all build on each
other and the the key thing is that it's
real I mean this this is real technology
this has led us to great success stories
in the field being able to deliver
technologies to our clients that work
they work quickly and to be able to
deliver those things quickly one of the
other changes we made in the last year
as we move to an extreme programming
process one of the fundamental tenets of
that process is that you want to deliver
early and you want to deliver
iteratively and often what that means is
that when you're working with the client
you want to hand them an example of
their data live of their business live
as quickly as you can so that they can
start to interact with it so they can
take ownership of it and so that they
can start providing you with feedback so
you can customize this stuff quickly to
meet their needs and what we found with
these technologies because they're so
centric to not steering you in the
direction of building monolithic pages
or monolithic user interfaces that are
very inflexible they're much more about
building little components and providing
these rules that drive the components to
work together to provide the ultimate
solution that in that context of
iterative development we were able to
work with the clients to provide
solutions for them very quickly that met
their needs and as their business
changed as the project changed we were
able to change with it
one of the key things is that as
software developers were experts in
software development when we're working
with a client and I mean in any market
not just consulting services
but shipping shrink-wrapped products if
even like Andres at Apple ultimately his
client is Apple when you're working in
that kind of a context you you want to
you are the expert in the technology
your client is the expert in the
business you want to work with them to
provide the best business solution if
you were the expert in the business and
the expert in the technology why are you
working with the client in the first
place just take over the world yourself
but that's not the case and these tools
really provided us to deliver to the
client these solutions very rapidly to
give a specific set of examples we have
a particular set of interfaces where the
client came to us very late in the
project cycle said you know we really
want to have custom date editors
throughout the user interface so we sat
down builds a little date editor widget
and then tested it out in one specific
small context one very tiny piece of
user interface turned around went into
the rural editor and said to the rule
editor any entity that has a data
attribute where the data attribute needs
to be edited use this widget suddenly
our whole user interface is using this
new widget set I can't think of another
technology where we could do that so
it's real use it it's very cool
okay the typical reminder the robotics
lab is open at 6:00 today please vote
for the Raptors best app server the
additional sessions I recommend for you
to see dr. Webb tomorrow also there's an
advanced enterprise object framework and
an advanced java client session tomorrow
all of them in this room and typical
contacts
you