WWDC2003 Session 603
Transcript
Kind: captions Language: en so this is what about pixel overview and if you intended attended the State of the Union a lot of the content is going to seem similar but we're going to go in a lot more depth than you saw on the State of the Union and we're going to cover a lot more parts of the technology so what does this session all about well it's really about power cuz web Bob because is about power and this session is about teaching you how to harness the power of web objects and the applications you right but it's also about elegance you ask a lot of veteran web objects developers why they like using web objects they say that it's very elegant and another reason they like it is because it's sophisticated and the point is not that web objects is sophisticated although it is but it helps you build sophisticated up applications and allows you to do really difficult things that other application development environments make it very hard to do but fundamentally web objects about productivity you have to write a web application so you have to get something done and what about this helps you get to market faster and write a better application the first time and well Bobby once you get it it's a lot of fun so we're going to hopefully have some fun today so we're going to learn well you're gonna learn what about objects is unless you probably know what it is but most importantly i'm going to show you what you can do with web objects now when you think of web Bobby you probably think of HTML applications but it's really much more than that because it's designed to be very flexible very modular and so you can target types of network applications that you might not know that you can so we're going to show you some unique examples and then we're going to show you how to learn and to learn web objects you need to know about the building blocks and the tools that you use to build these applications so we're going to look at each of the tools and we're going to look at each of the frameworks of the most important frameworks in any web objects application and then we're actually going to go behind the scene in running Web APIs application so you can get a sense of the objects that are involved in that application and what your role as web objects developer is in building those objects and adding value to the objects that we provide you and throughout the session the whole idea is to help you know and get a sense of how to start learning this technology so first of all what is web objects well if we can come up with a one-sentence definition that encompasses everything went babak's is about this is probably it it software made up of frameworks and tools that help you build network applications with data from multiple data sources well this is a long way of saying that really web babak's is an application server so this is another marketing talk but if you're going to build web objects applications you need to know why web objects is a good tool for the job and there are three main reasons and these are really three themes of the presentation today but first is that web objects plus you focus on business logic now lots of other apps environments force you to focus on things that you can't add a lot of value to like writing the code actually access a database like day DBZ code or writing SQL to actually get data from a database well with web babak's we take care of all the minutiae of app development that you usually have to do in other environments and it's lets you focus on writing your business logic and that's why you're writing an application in the first place and like I said one of one of the reasons lots of people like using web objects is very productive it helps you get to market faster we provide a set of rapid prototyping tool that allows you to have a working application literally minutes and from there you iterate and build this application that as wiley said in the State of the Union your one dot o application is usually better than a tu lado application that you would get in another app development environment and the web objects development provides a unique development cycle that offers more opportunities for feedback throughout the whole development cycle so rather than just gathering customary requirements at the end and showing them the final product we know that that's not the reality of software development requirements change and what Bob helps you adapt to those changing requirements throughout the development cycle so let's back up nomos you probably know what an application server is but let's provide a broad definite definition of it one application server provides the service on the web this could be a banking service or a student tracking service or some kind of travel service and the reason you're presenting it on the web is that the value of that application is only as good as many users use it so you want you have tens hundreds maybe thousands of users and it doesn't make sense to deploy this application on the desktop now for bobby's of course you can deploy distributed network applications that run as desktop applications but the point is you want to just too many people and the people who use your application they might just read the data in that application but most likely they're actually contributing to the data in your repositories and the web objects we help you use data from multiple data repositories and present that it in meaningful form in your end application and these days it's very common for applications to exchange and share data other applications so rather than an application just living in its own world we use web services and other technologies to communicate with other applications which adds value to all of them so if we can come up with a picture of what an application server is this is a very simple side form so on the one hand we have data repositories and on the other hand we have web client and the important things in it to know about web objects that doesn't matter what kind of web client these are they can be HTML clients they can be swinging desktop applications they can be web service client or almost anything you can get to through java objects and the role of the application server is to mediate between the data sources between the web client and help you get data out of those data sources and present it to a meaningful form to web pipe and of course an application server relies on a web server to actually communicate with the outside world we're going to go back to that picture throughout the presentation so keep it in mind so like I said when you think of web objects well the word web probably connotes HTML and browsers but that's not all web babak's is about well so I babak's out of the box you can target almost any type of network client most commonly people target HTML clients web browsers but also very it's very common to target swing clients these are desktop applications that run on a user's machine much like you know word or I photo or something like that and the reason you would do this is you want to provide a more rich user interface than HTML allows but also with web objects out of the box we also allow you to target soap clients generic xml clients and even something called smile which is the synchronized multimedia integration language that's supported by QuickTime realplayer other multimedia clients and we provide a specialized framework so you can build very rich multimedia applications standard based applications that have all the rich access to databases that web objects provides and because web object is written in Java you can target almost any type of network client that you can get to through java such as PDF and SVG so just like web object LP targets with any type of network client you can use data from almost any type of data source and out of the box we provide connectivity to JDBC and jndi data sources and other third parties provide connectivity to other solutions such as SI p so one of the best parts about web objects is that it allows you to access these data sources through java objects so rather than have to worry about writing your own JDBC your D&D I code to actually connect to these data sources we provide abstraction to these data sources and you interact with these objects and usually don't actually need to interact at all to make these connections these objects which are Java objects so you think in Java you think at a very high level you think in object-oriented terms and web objects does the work of connecting to data sources for you and just like it takes care of accessing the data sources it also allows you to express your business logic in Java so a common way of expressing business logic is to do it in the database so doing with stored procedures and triggers and things like that and that locks you into that database you have to write in very low level code but with lab objects we allow you to express that business logic in Java which is really a much more a much more pleasant way to write your business logic and how do we do this we do this through software that we call the enterprise objects frameworks and this is kind of the crown jewel of web objects application development this is a technology that helps you access databases helps you write your business logic and is really core the core element to any web objects application everybody you're going to become familiar with these two icons the one on the left is the icon for EO modeler a neo modeler is an application that helps you build new models which is the icon are presented on the right and these models are descriptions of your data they help web Bob they provide web objects a mapping between your relational data and java objects we're going to talk much more about that in this session so let's go into little more depth about the three types of most common types of client applications you target with web objects and the first is HTML applications and the goal here is you want to provide dunnet dynamic content and you want to provide it to web browsers you might have an online catalog and you want to provide customers with a customized look and experience when they enter your catalog with web objects you build the pages that your HTML applications express with templates and these templates are built on the ideas in a proven component model and what we mean by that is we spent a long time coming up with the best way to design these pages so you build these templates which are based on this model and the mom this component model has a lot of interesting features one the template rewrite are usually reusable so you can reuse the same templates within one application or even between applications so this is part of the the way that we help what achieve reusability but also help you get to market faster to reuse through reusability and since web objects 5.1 we've heard your request and we've also now we allow you to integrate your favorite parts of javaserver pages technology right with your well components so if there are parts of the JSP model that you like we allow you to integrate that with our component model to get the both best of both worlds it's well known examples of HTML web objects applications are apples Mac creative services providing the home page application and mail and also the apple store so another very newer type a very popular type of client application you can target with web objects is a web service application and web services there are two types of applications there are web service servers so that we say they then database content through web services which is a set of standard protocols but the other part of that is a web service client that actually consumes the data that this web service server vent to you and with web objects we allow you to build both types of applications we allow you to build a server and the client and we do this by putting a layer of abstraction on top of apache access and patchy access is open source software for helping you build web services and it's great to the software and we love it but we've made it even easier to use by providing a layer of abstraction on top that and we've even done a lot of work to provide you with plugins so that you can serialize web objects objects that you build and enterprise objects that you build so my favorite kind of web objects application actually is a java client application this is what we call client applications that are written in swing and the goal here is you want to provide dynamic content to an application that runs on the user's machine not in a web browser but just like an application it's an application that the user can double-click and as of web objects 5.2 we actually allow you to do this with two architectures we officially support the three-tier architecture which includes the web objects application server in the middle and in this architecture the app server mediates all access to the database so it's very secure and you have total control over what the clients fees but we also allow you to build two-tier desktop applications that access that allows the client application accesses the database directly so if you don't want to worry if you don't have the need for the weblogic app server in the middle you can also build that type of application which is great my favorite part about web objects java client is the dynamic user interface generation provided by something we call director java client what is this view well allow you to build these swing desktop applications without actually writing any of the swing we have something that we call the rule system the rule system helps java client produce these very rich swing user interfaces so you actually have app apps internal at Apple Java client apps that don't have any swing code in them but they're these very full-featured rich desktop applications it's a great part of the technology and what about Vic Java client also has a business logic distribution architecture what does this mean well you have business objects in any web objects application and usually these business objects just live on web based application server but when you have a Java client application you have a client that's smart we have especially these days clients are very robust they have lots of memory and very fast processors so you can actually have put some of these business objects on the client side and when you do this you increase performance and there are drawbacks of course because any time you put a Java objects on the client you can be usually you can piles and things like that but this business logic distribution architecture is flexible enough to a lot so it gives you total control over how you want to distribute your business objects and in what about weeks 5.2 we even took care of one of the most difficult parts of tedious parts of deploying desktop swing applications over the net and that's deploying the client application so we've integrated web start for you so without having to configure jnlp files or do anything we just provide a hyperlink when your application starts up the client clicks it they automatically get all the website functionality and you don't have to worry about it so that's part of the heavy lifting philosophy that web babak takes care of all the hard work for you and so this is an example of a java client application you can see it looks like the Mac os10 application it assumes the Aqua look and feel of course you can run this on other Java two platforms so you run it on windows and you get the windows look and feel and we can edit properties and edit relationships and again all of this is done dynamically on the fly as the user moves around the application so those are the three most common types of client applications you can target with web objects HTML swing and web services but I said before that web objects was designed to be very flexible and allows you to be creative and to build new kinds of applications and one of those that you're very familiar with I'm sure is the itunes music store it's actually a web objects 5.2 application on the back end and iTunes sends requests to to the web objects application and this application hands back XML that itunes then interprets and presents some cheesy music store and it's actually built with a lot of our director web technologies in the back it's very cool stuff that's just an idea of the flexibility of the web objects frameworks a lot of you to do almost anything you want build any kind of network application so if you attended the web a big State of the Union you're familiar with our new documentation site which just went live yesterday and it's actually the pages are all static pages but these pages come from a web objects application so add apple we have this running application and a couple times a day we ask the application to generate a static version of all of its pages so we create this virtual sitemap and we traverse each of the directories and and each of the nodes on this site and generate static versions of the HTML pages and we can go over to the demo machine just to give you a sense of what this means is we get all the teachers or most of the features of an application server but with static HTML so you notice if i look at the Coco documentation I can sort this list by simply clicking the column header now what I'm doing I'm not talking to an application server I'm just asking for a static HTML page that's been pre generated so this gives us the advantage of we can we can deploy these pages we can serve these pages with apache without having to worry about the overhead of actually deploying an application an application server so that's just another example of the flexibility of web objects and some different kinds of applications you can build with it so now I'd like to bring bill Bumgarner on stage to actually show you an example of how quickly it is to get up and running with the web building a web obvious application thank you [Applause] so I'd like to show you two applications one of the interesting sort of chicken the egg problems that every developer faces when you're starting up a project is you may have your database sort of kind of initializing there but you don't have any data in it and because you don't have any data in it and it's hard to build the app and you kind of want to solve both these problems so one of the focuses of the tools and you'll see this throughout all of the xcode discussions as well is that we want to keep you productive we want to keep you moving forward in your projects we want to make you happy developers and I apologize I'm little new to Apple's own learning the appropriate marketing term so i guess our tools kick ass okay so i got that in good and i'm going to show you how they kick ass I guess I'm only supposed to use it like three times there's one more so okay oh I'm sorry wrong menu item yeah so I'm going to create a new project now thank you and I'm going to create a new direct web application and I'm going to not use that name I will call it video store and my goal here is I have a video database now if I was into typing in demos I would have gone into eel modeler and actually reverse engineer the database but I've already done that so I'm going to take already existing models of my database and just build an application on top of that will call the video web because we're being original and we will choose the default actions once again emphasizing productivity our default behavior just move you to your goal and we will add a couple of yo models here which this is interesting notice that I'm actually adding multiple models this means is they again these tools what I'm showing you is very simple however the implications are complex you can have multiple databases you can have data across those databases you have relationships between data on a sybase database and oracle database front days and ldap and i'm going to choose the neutral look let me go ahead and just creates project let it build and run and and we'll see what we get excuse me now what's interesting about this demo is actually the tools i'm using here the same stuff that's used to build things like the music store and other wonderful technologies out there so here's my application it's already up and running let me go ahead and login we don't take care of security on that page by the way so that's something you should put that on your to-do list so as you can see though now that I'm in my application I've got all of my stuff my database it's just showing up all my entities which correspond to tables I can search for things I can actually even creates a new movie or I could drill down and inspect a movie now I'm happy as a developer because I can go in and I can start really working with my data and I'm five minutes into my project now of course HTML is the user interface is somewhat lacking and as mentioned we also do Java so let me actually create a new project and this time I'm going to choose direct to java client and will call this video web J continuing with our tradition of originality and again I'm running through the default answers here grabbing all the framework adding the same two yo models I'm going to steal them from the other project in this case and continuing down my default and that last screen may actually go back this is kind of neat web start so this will automatically creates a little thing that you can just kind of shove on a web page or send an email to start the application makes distribution very easy so we'll go ahead and again we're following the default path and we'll let this launch excuse me so what's actually happening here is of course the applications building etc this is a director java client so now as the application launches what you'll see is a user interface that was dynamically generated purely for my data model so there's a bunch of rules in the rule system that say okay if there's an entity that has certain kinds of attributes that are strings then you can go ahead and create a search form automatically that actually allows for very rich interaction with the data now I look at this immediate when I go you know i'm doing a video store the first thing i want to do when I'm administrating this data is i really want to focus on movies I'm less interested about my customers because I don't have any yet so there's an assistant and through the assistant you can actually go in and modify the rules that are used to drive this application so the first thing I'm going to do is I'm going to go to my main entities and I'm going to bump movies up to the top of the list and since I'm not a very good video store honor I'm going to just remove talent because i don't like actors so we'll go ahead and apply this and restart my application and as you can see already my movies are at the beginning of the list and I have no talent in my list hopefully I and for searching movies you know I really want to be able to do it by rating I have a lot of customers and want to come in and they want to get finding nemo add to work that into more marketing i'm learning and so they want to be able to search by say the rating of the movie so i can easily come in and i can say ok whenever I'm querying for a movie again this is the whole rule system I want to search by rating and I really don't want to search by plot summary that just doesn't make any sense so again I'll apply and i'll restart the app and i can come in and i can search for movies to the rated g and it'll go off and there's all my movies that are rated G notice Finding Nemo is not in the list we need to update this database but anyway as you can see I've in five minutes or so have created two applications that allow you to work fully and intimately with the data in your data stores on and what this means for you as a developer is that you could get up to speed really quickly and get into the client or the customer or your user or your mom if you're building an app for her face and say is this what you met is this what you want it let's go interactive on this look let's push our product ahead very rapidly and as was indicated earlier what that means is the 10 with our stuff usually is like a 30 with everyone else's because you're learning all the time to the development proxies now these cools a lot of people look at things like this and they're scared by it there they're you know worried that they're going to get locked into our way of presenting the information that's not true with the rule system you could actually build your own super spiffy say revenue display widget and then in the rule system say anywhere a revenue is displayed use this widget so we encourage reuse throughout all of these tools as well on and of course once you have this administrative app you start building the app facing the user then you can reuse all that code and the business logic again so you know we kick ass because you're productive and we like to support that there's my third one so I'll turn it over to printing [Applause] thank you thanks Bill and one thing bill was emphasizing there at the end is that bees we just showed you an example of the rapid development tools and frameworks that we're Bobby's provide and that those tools do everything for you but we also let you do everything on your own if you want to and they're good reasons for starting with both approaches to web objects development so now we're going to take a minute and talk about all of the tools that we provide the great set of tools we provide to build these applications so bill showed you two tools three tools he showed you when he showed you to project builder and you should use the director java client assistant and those are just two tools in the suite so project builder well this is very important because this allows you to organize your project files it provides new project assistants to help you get up and running with any of the web objects application types it's the it's the application that you use to actually compile your project and we provide a front-end to jdb the Java debugger so that you can graphically debug your web application which is a java application we also provide CVS integration so you don't have to resort to the command line to get full source control management and we provide documentation look up so you can double click on a web objects method or class name and right there in project builder see the description for that class method which is pretty cool and project builder also is part of the equation that we label rapid turnaround and rapid turnaround is a feature in web optics that allows you to make changes to your applications usually to the user interface to save the changes and to see them reflected in the running application without having to recompile and there are other tools that work with project builder to make this possible we'll talk about in a minute so I talked about you model or an imam allure is really the most important tool in web publix development because it allows you to build data model and as you saw by simply providing web objects a description of your data you can actually get full featured running applications for free but even if you're not using the rapid development tools and frameworks to build web applications you really still need to date a model because this Dale model is is how you provide the data to the templates the visual pages that you construct so how do you build these data models well yo modeler is very smart and we'll actually reverse engineer a model for you from an existing database so a lot of projects start from existing data so you simply point eal modeler to your database and like I said out of the box this is support jdbc and jndi and it looks at all the tables and all the columns and all and all the joints and it creates entities attributes and relationships from all that information so you don't actually have to worry about creating the model in many cases you may want to make tweaks to it but if you don't have a database you need to create a schema andia model can actually help you think about that schema in entity-relationship terms and then we'll write that that schema back to the database for you so it's a great data modeling tool also and we also think of EO modeler as a front end to the enterprise objects framework because it actually allows you to configure a lot of the more sophisticated characteristics of things in EOS let's will talk about more in a second so what does it you model or do well helps you map relational data structures to java objects we said that with web objects web object allows you to build your business logic in java objects but in order to do that we have to be able we have to have a way to get the changes that you make to your java objects back into the data stores so we need a description we need a mapping of that amount Sofia model or does it helps you map entity at the table attributes the columns and relationships to join and another great feature of eos and you modeler is that you can model inheritance so as a Java developer it's common to build inheritance hierarchies into your application so you might have a person superclass and you might have concrete subclasses of it such as student teacher administrator if you're at an educational institution well this is a very natural way to think in Java in object-oriented terms but when it also be nice if you could translate that hierarchy into something that persists in a relational database well we fully support that with eos and you'll modeler allows you to map your java inheritance hierarchies to your relational tables a new model also helps you build fetch specifications which are descriptions of the data you want to fetch which also usually include things like store notaries you can do all of these things in code in fact you can even build models in code but you a modeler is we provide it because it's a lot easier to do it with a graphical tool so if you're building web HTML applications you need to build these page templates I was talking about so we provide a tool that helps you do that called web objects builder and fundamentally it's an HTML editor but especially is it it helps you write these page templates and these page templates and web objects are made up of something we call dynamic element and a dynamic element is just what it sounds like it's an HTML element whose values and characteristics are resolved at runtime and what objects builder has collections of these dynamic elements on pallets if you drag out these elements you put them on your templates and you connect them up to your enterprise objects and so that's that's how we say that integration that web babak's builders integrated with enterprise objects it knows about the entities in your data model it knows about their attributes it knows about the relationships these are things that your yield model provides and mob objects builder is also plays a part in this thing we call rapid turnaround so in many cases you can make changes to the HTML templates you build in web of weeks builder save them refresh the page in the client browser and see those changes reflected without having to recompile rebuild your application so this is one way one way that weblog helps you get to market factor by removing some of these steps in the development process so we touched on rapid development and rapid development is one of the cool features of web objects and it includes a number of tools so there are three types of client applications that you can target with the rapid development frameworks one is an HTML client there's a Java client a third is a web services client in each of these types of client applications has its own assistant an assistant these assistants are front ends to the rule system so the real system is is we consider it kind of like a black box it's very smart and knows how to do all these things but to interact with it you need to write these rules these rules can kind of be hard to learn to write so what these assistants do is they provide valid configurations and valid combinations of these rules that you can just choose in a graphical user interface which has a result of writing these rules for you and this enables code free rule driven so how these tools all work together well we divide the web objects development workflow into three general phases the first is a data access phase second here's the business logic phase and third is presentation logic and each of the tools have a specialized role in each one of these phases so in the data access phase of course the goal is to get data or get a description of the data in a JDBC database a jndi directory into an eel model file and you use you a modeler to do this so that's really the first step and once you have this description of your data then you're ready to write your business logic and in web objects you write your business logic in Java so when you edit your Java files in project builder so this is the business logic phase of the workflow and after you've done that you work on your presentation logic so you use web babic builder to build HTML templates you use director java client to build 20 obligations but you can also use interface builder this is the same interface builder that you use to build carbon and cocoa applications for mac OS 10 we've actually extended it so when you build a java client interface and interface builder we actually write out the swing for you so in this case we're not dynamically generating user interface on the fly as the user moves around the application but we're actually using a chunk of static swing that interface builder generates of course you can integrate both the static interface and the dynamic interface in the application so if you need very precise control over one particular window in your application you can do that in interface builder and finally if you're building a web services application whether you're building the server side or the client side if you're building the server side you use something we call d web services assistant and if you're building a client where you can build browser based web service clients with the web objects frameworks but you all might also be interested in building a web service client to target something like Sherlock and so we show this workflow we show the arrows going from one side to the other well it doesn't mean that you have to finish the data access phase before you move on to the business logic phase and then finish the business logic before the presentation logic you can go back and make changes that in any one of these realms but this illustration is just here so you get an idea of how the tools work together ok so we've talked about we've shown you a demo of HTML applications and Java client applications but what about Web Services I'm going to bring on the world's foremost Jamaican Chinese web objects developer on Sage Romney saying shows the demo of web services of my Baba cool thanks Brent so first off you guys know about web services and how print explained that with access we're able to bring web services to web objects or vend web services through web objects on top of that we've added a technology that we call director web services which makes it even easier to start building a web services server so I'm going to start a new project and I'll choose direct web services is my application type and I'll choose a silly name so I prefer to again go through all the default settings choose the movies model and I'll just build and launch the application so what it's going to do is put together a list of the entities in my model and figure out exactly what should be vended as a web service it'll give you a set of defaults and you can go and tweak those and customize it and the application that we use for tweaking the web services settings is another assistant the web services assistant so we'll plug in this URL that is that was given to us and poof you can see here we see we have a service and we take the approach of being paranoid for our web services so none of the services are turned on by default so nobody can go in and start sending random soak for these services anything that's not specifically enabled is disallowed so we'll go ahead and enable our special default web service called appropriately enough default web service so we'll add an entity to our default web service as far as public entities go once once I've added this entity you can look over here in the service list and we'll add a couple of operations so what we've done here is go through the entity that we've added and looked at what such specifications are defined and as well as just what what arguments should be exposed as web service arguments so we haven't written any code yet and we've always done is focused on our business logic and already we can already publish a web service let's start by just moving a couple of entities out I just want to search on rating for my movies let's say we'll remove these we can change what arguments are sent to the web service and what return values are sent back to the web service client let's just say we're interested in the title the rating again and we can also from this list here choose to see the studio name we can go through relationships when we're returning values from the web service so all this again is going through the rule system and changing values only in the rule system you don't have to write any code to change the settings for your web service let's go ahead and return or try and test this one of the things about web services by the way you you really have to put together a Wizzle file web services description language file saying what arguments you expect and what results the the client can expect to get back from invoking a web service rather than have to write all that for you write all that yourself director web services generates all of this lovely XML for you so you can go ahead and be productive immediately like testing the application so we'll search for all rated G movies we'll get back a list of all the rated G movies good look for PG and test it so one of the things that you also notice is we haven't had to go through and write any access code we haven't had to do anything actually parsing the wisdom our selves we've figured out the director web services assistant can actually parse the wisdom and put up a dynamic you I so that we already have something that we can use to invoke the web service and test it if we go back you can see if we add a title as an input argument we get rating and title as the as the UI to test with click and rate look for all PG movies actually one other thing we can change the operator that is used so we can look for case insensitive like on the title look for all PG movies that start with S so and there aren't any g movies to start with that so it's a simple example of how quickly you can get running up and running with a web service application using the director web services technology it's very simple very easy to use and you should use it back to brim thank you Ron so there's something we need to emphasize about the demos you've seen today now they demonstrate that you can go very far in a web objects application without writing any code and that's true everything you saw here today is what you can get in the trial version of Ebonics and in the box when we buy it but web objects is not a toy it's a programmers tool you really need to be a programmer to use it now we take care of a lot of the difficult things for you so you don't have to be BA so you don't have to be a DBA to write web Alex application that uses multiple databases but you do need to be a programmer a Java programmer to really build a usable application so you can go far but we don't want to give you the sense that you can go all the way in application development with web objects without knowing how to write a little bit of code so after saying that we need to talk about how all of this is how we make all this possible so let's talk about the building block behind every web application and the building blocks are something we call framework well what's a framework a framework is software and it provides a lot of pre-built functionality that you plug into another way of thinking about this is a framework knows how to do a lot of things the web objects frameworks know how to access databases they know how to generate HTML they know how to do web services stuff well they don't know what to do they don't know what you want want them to do so you have to brought provide information you have to tell them tell the framework what kind of data you want to fetch or what your page templates look like so a key idea about frameworks is that they do all the driving and all the heavy lifting well what does this mean well they know how to do a lot of things and one of the the most common obstacles that new web of objects developers face is that they start writing all this fancy code to do all these things that they think they need to do when actually the frameworks do all this for you so you need to learn to trust but these frameworks actually know what they're doing and that your goal your role as a web objects developer is to understand the frame works well enough to know how to harness the functionality they provide so you write less code and when you write less code you write bug and you write a better application so the weblogic frameworks have been around for a long time web objects was actually the first application server a long time ago and becomes around for a long time these frameworks have had a lot of years to get really good to the point that we say they incorporate a lot of the best practices of object-oriented programming and they actually share a lot of these best practices with cocoa apples other object oriented not framework for building desktop applications and I want to talk about three of these because they're really important one is key value coding when you start reading the web objects documentation you're going to see this all over the place and you look at the API reference and talk to people and they're going to talk about key value coding well what is this well it simply encompasses the classic object-oriented design paradigm to encapsulate the thing that varies well what varies in an application what varies is how your objects provide access to their data they might provide access to the data through an accessor method preferably or through an instance variable and how in the name of that accessor method or instance variable could be different well what key value killing does it abstract away all of that diversity and how their object and how objects present their data and allows you to access dated by key or by name and if you'll see you later on this is very powerful because if we have business objects that have very complex relationships in them we can actually get to the data in those different objects simply by traversing what we call a key path and this is all enabled to t value coding name based look up another important idea is delegation it's kind of a complex thing and you don't need to know about it to get started but we said that the web objects frameworks are very flexible and one way they're flexible is that the class designers the people who designed the classes in these frameworks provide opportunities for you to customize these classes and they do it through something we call delegation and this is a way for the class designer to say at this point in this object execution I want to provide other developers a way to intercept things and provide custom functionality so rather than requiring you to actually subclass one of our classes and override a bunch of things we provide things called delegates which provides you a great deal of flexibility and model view controller is another key idea in the web objects frameworks this is a paradigm you're probably all familiar with and in what about Reese development it means the same thing it means that we divided we think about the objects in weblogic in three different realms the model realm which is your data in your business logic the view realm which is what your user actually sees and interact with and the controller which is the glue between the two so let's talk about three of the frameworks that every web objects application no matter what type of client you're targeting will use the first of the foundation framework this is a set of powerful vast collection and utility classes things for managing your applications data structures it's important to understand that the foundation framework doesn't replace the JDK classes it's actually built on top of them and it complements the JDK classes but like I said web babak's has been around a long time and it's actually not written in Java originally it's a lot of these classes predate a lot of the JDK classes and they're very mature and provide a lot of really really great functionality a lot of what you can actually don't get in the standard Java classes the foundation framework also provides an infrastructure for notification in a web objects application you have possibly hundreds or thousands of objects running at runtime and usually they need to communicate with each other maybe a user makes a change to a Business Objects well chances are that other objects depend on the state of that object well a notification architecture allows those objects to communicate in a way so the objects are very loosely coupled so we have another object that we introduced which is called a notification center and an object's tell a notification center when something when their state changes or when a certain event occurs and other objects tell the Notification Center do they want to know about when other objects change their state so in the end we have like this dynamic nervous system of objects communicating with each other without directly having references to them this is one of those other great best practices of programming that the MOBOTIX frameworks incorporate foundation framework also provides basic infrastructure for validating the data in your objects and as a 5 web objects 5.2 includes the xml serialization classes that make it very easy to serialize web objects and enterprise objects so the web objects framework this is the framework that bootstraps all types of web objects applications so whether you're living in HTML a swing or a web service web objects application this framework helps you get up and running and it manages something called a request-response loop clients send requests into your application server the web objects framework helps you dissect that request and in the end after you've all your business logic and application logic have made the decisions they need to make it helps package up a response and sends it back out to the client we talked about the page templates and the infrastructure for that is rooted in the web objects framework the most important thing that mobotix framework does is it manages state we all know that the web is inherently stateless there are no facilities for tracking state on the web so that's really what what one of the main roles of an app server is to provide state and there are three realms of state there's global application state data that you want all of your users in every session in your application to share there is per session or per user state so if you want to provide a customized personalized experience to each user as they enter your site you need to store the state for that session and even within a given page you may need to keep track of the session if a user requests that page again so the webelos framework manages state in those three realms so we introduced the enterprise objects frameworks before so if you having a hard time understanding of what this actually is there are two industry standard terms that will give you a sense of what it accomplishes one is entity relational modeling others object relational mapping and these are ways of thinking of your data in higher level terms and tables and columns and joined thinking about them more abstractly as an object like we said this takes care of writing all that low-level code that you as a human should ever have to write the framework takes care of it it's much more reliable than you writing you know for joins to traverse a complex relationship and allows you to focus on business objects like we said so one thing you have to trust about using EOS that's what we call it is that java indications you make so implications to make on your objects actually results in the end in certain database operations such as select inserts and updates so once you learn to trust that you're going to get a lot further as objects developer so there are two really important terms in EOS we're talking about business objects well your business objects are actually instances of something we call an enterprise object and these enterprise objects live in an editing context the editing context is a container and I bring these up now because in any when you start actually writing code in an application these are two of the the types of objects you'll be interacting with most often this is a really important set of frameworks but we got have two slides on it there we go so it also includes a high-level qualifier language so when you need to write a description and tell us what kind of data you want to fetch what we allow you to do this in Java with a very english-like syntax so rather than have to worry about the joint you need to write and all of the appropriate sequel you're right in very high-level qualifier objects that didn't get transposed down to the database layer we manage joins for you like I said and yo F introduces the idea of T path so very quick example if we have an address object referred to by the address key and we have a street property in that object we can get to that data simply by using this chain of keys and this is all enabled by p value coding like we discussed before and us provides automatic transparent access to multiple data sources so if you want your business objects to be composed of data from an Oracle database and a front front plates database they can do this and you don't really have to think about it and you have includes the validation infrastructure that allows you to provide validation on properties so on the data in your objects and you might want to validate that data at certain points in the applications execution if a user requests to save data you want to make sure you want to validate the data before you actually it actually gets to the database and UF provides its infrastructure like I said there's also very rich support for inheritance in enterprise objects so we're talking about framework so what where does your code how's your code work with the frameworks well if the enterprise objects framework is on the database side and the web objects framework is on the client side your business logic plugs in the eof and your application logic logic plugs into the web objects framework and the inner running appliqué clients send requests in they come in through these web server which words it to the application server the web of extreme work takes over and helps you make sense of that client requests in the in conjunction with your application logic and your business logic perhaps that user requested data and if so you f will help you get that data out of a database and put that data to get that data in the form of objects which you can send that you pass back through your application you use that those objects to populate these page templates that you write and then the web experiment a response that gets sent out to the client we talked about rapid development and we're running a little short so behind the scenes so this is a one of the examples that ships with the web objects product it's called I shacks it allows it's a front end to the real estate database that you saw in no you didn't it's a front end to a database we ship as one of examples which is a real estate database so how does this page happen what's what's going on behind the scenes to actually produce this page well the first layer is HTML there's this page is made of HTML well where does this HTML come from well it comes from one of these low components and this component happens to be the search page component and this component includes a bunch of dynamic elements the values the content of these dynamic elements is resolved at runtime so well components we touched on briefly before their page templates they're made up of standard HTML Javascript and other web content but most importantly they're made up of these dynamic elements more components are reusable and nestable so you can reuse a component within your application it's very common to have a common page wrapper component that all the pages all the components in your application use you only have to write that component one and you can put it in all of your templates so you get the same that same field without writing more code components are synchronized and they communicate with one another each component has a Java object behind it and that's really key so this isn't just a component is not just a set of HTML with a little bit of JavaScript ER you know maybe even sequel and it like other kinds of component models but there's actually a Java object behind these components so this allows you to store state and lodge k with other Java objects such as your business objects the more components have full access to session and application data so if you need to provide a customized personalized experience on a particular page you have access to a user's session please dynamic elements things like we said there HTML tags their characteristics and values are determined at runtime let's look at an example so in that I shacks example page that we showed you see slides ago there's a pop-up menu and the pop-up menu allows you allows you to narrow down the scope of your search it allows you to choose a state so each dynamic element has a number of different attributes and you bind these attributes to values in your business objects static values may be whatever so in this case we're calling out the value attribute and the value attribute is bound to a key path we talked about Chi paths before so in this case it's looking for an object that's resolved by the name T and it's looking for the abbreviation of that state such as VA for California so at runtime that lists that that 50 state list element list will not include the full name of state but rather the abbreviation ok so we're talking about development we're almost done here so but once you're done developing application you actually need to deploy it and if you attended the web public State of the Union we introduced new ways of deploying your applications in Panther server with jboss and there are two sessions dedicated specifically to this so please go see them but I want to cover two very quick things today there are two types of deployment there's a standard rebeck deployment using our tools and deployment infrastructure and there's servlet deployment which allows you to deploy your web babak's application as a servlet in tomcat and jboss weblogic etc ok so in sum with web objects you write less code you get a lot of functionality out of the box for free the objects you write are usually reusable the enterprise objects framework allows you to build database independent application so you make might start developing your application on one database and move to another production database when you're finished when you deploy we have a lot of innovative very cool technologies like the rapid tools and frameworks for doing rule-based development and we allow you to end up we provide a number of flexible deployment options so how do you get started there are thousands and thousands of pages of documentation on web objects we suggest getting started with beasts for first web applications will take you through building an HTML application includes a number of tutorials and the ideas that you learned in there are really applicable to all kinds of web-based applications so your feet of developing a web service application you should still start with that book the familiars familiarize yourself with the concept and using EO modeler not only teaches you how to use EO modelers but it also introduces a lot of the important concepts in the enterprise objects framework and if you want to learn more about the dynamic elements that we provide for you there's the dynamic elements reference and if you're unfamiliar with project builder or even if you are familiar with it there are a few things that are unique to web babak's development that a lot of people are confused about at the beginning so so consult that specialized project builder for web objects developers document clear it all up who to contact we always love to hear your feedback your ideas for the product so web objects an apple com is probably the best way to get a hold of us you