Changes for page Best Practices-Starting From Scratch
Last modified by Klaus Berkling on 2011/09/06 00:31
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -10,43 +10,28 @@ 10 10 11 11 == Use WONDER == 12 12 13 -=== Why? === 14 - 15 15 [[WONDER>>Project WONDER-Overview]] is a huge set of frameworks that fix and extend WebObjects in many, many ways. For more than five years, Apple barely updated WebObjects, and that shows. There are bugs that date from 2003 still unfixed, there are almost no new features. WebObjects 5.4 is a nice release that includes a lot of fixes and some new functionality, but it was only released in late 2007, with Leopard. During all that time, though, the community hasn't been sleeping. The WONDER team wrote thousands of lines of code, and made them available for the rest of us. 16 16 17 17 The WONDER framework most people use is ERExtensions. This framework is probably the biggest in WONDER, and contains a lot of great functionality you don't want to live without. Some of it's features are: 18 18 19 19 * XHTML generation. Although WebObjects 5.4 finally provides XHTML compliant code generation, WONDER was the only way to achieve that in previous WebObjects versions. I mention this feature first because it actually was the feature that made my start using WONDER in first place. 18 + 20 20 * Automatic EOEditingContext locking. This feature is huge. We'll talk about locking a lot in later sections, but trust me, you'll want WONDER to handle the locking for you. No more unlocked contexts to be corrupted while you edit them, and no more deadlocks and locked contexts lying around. 21 -* Collections re-implementation supporting Java Generics. This means that you may create an NSArray, NSDictionary or any other "NS collection" typed to a class or interface. I don't actually like this feature, because I'm a LISP lover and I see this as unnecessary constraints. Anyway, I mention this because I admit it may improve the code quality in some ways, and because WONDER implementation is, in some ways, better than Apple's (Apple delivered generics support for collections in 5.4). 22 -* COUNT SQL query generation. This is a very, very useful feature, at least for me. There are many times when you just want to know how many objects are selected by a query, but you don't want the objects themselves, specially because we may be talking about tens of thousands, or more. Think something like Amazon querying its system for the number of books sold this month. The query results would be huge and unpractical to manage in memory and time, and an unacceptable overhead if all you want is the count. WONDER provides a very easy way to do COUNT (and COUNT UNIQUE) queries. 23 -* Extra qualifiers. Sometimes WO qualifiers are simply not enough. WONDER provides some handy qualifiers. Some of them are buggy and may not work, it's not one of the best quality WONDER features, but at least it's there, and it's open source, so you can fix any bugs you find. 24 24 25 - Thereare many, many morenicethings about EXExtentionsframework. You would be really boredif I described only 10% ofthem.Besides ERExtentions, thereare also a number ofcoolextra frameworks inWONDER. Here are some ofthem:21 +* collections with attachements 26 26 27 -* Ajax Framework - provides a really easy way to add Ajax calls to your application. Ajax Framework integrates Ajax in the WebObjects Request-Response loop in a very intelligent way. You program all of the Ajax stuff as you program normal component actions. An action method is called, you do whatever you want, and return a component (usually null). The defined block of the page is updated. No page reload, the user is happy, and you are more than happy because you actually had to do nothing (well, almost). We'll look at Ajax Framework later. 28 -* ERJavaMail - useful framework for managing email. 29 -* ERPrototypes - A collection of data model prototypes for popular databases. You may use this framework or create your own prototypes, but **do** use prototypes. If you are lost, don't worry, we'll look at this later. 30 -* ExcelGenerator - A [[POI>>http://poi.apache.org/]] wrapper framework for generating Excel documents, a very useful feature in many web applications. 31 -* ERPlot - A [[JFreeChart>>http://www.jfree.org/jfreechart/]] wrapper for generating nice-looking charts on your web application. 23 +* count and count unique 32 32 33 - Bynow, youmust be thinking why would you make thelearning curve even worse by learning WONDER and WO at the same time. After all,it's a lot of frameworks, a lot of information and, unfortunately, not a lot of documentation.25 +* qualifiers 34 34 35 - The point is: **using WONDER will actually makeit easierto learn WebObjects**. WONDERfixes a lot of bugs and providesalot of easier solutions, like EOEditingContext automatically locking, that would otherwise drive you mad if you use pure WO. So, the best option for you to learn WO easily is to use WONDER, at least ERExtensions. Although it seems you are complicating your life, you are really making it (a little) easier.27 +Other frameworks: 36 36 37 - ===What WONDER version should you use? ===29 +* Ajax 38 38 39 -Ma ny of us, WebObjects developers, are very conservative about upgrading andliving on the bleeding edge of the technologies. WebObjects is used for real business, where many millions of Euros are involved. So, normally the advice would be: use the stable version.31 +* Mail 40 40 41 - Well,WONDER is different. WONDER is updated very fast, and at the same time the WONDER team makes a big efforttokeep itstable. There are manysmall fixes every week, that will improveWONDER reliability, and new big featuresare usually included as optional, off by default. So, my advice on this is, use the [[nightly build>>http://webobjects.mdimension.com/wonder/]], or, even better, [[the CVS head source code>>http://sourceforge.net/cvs/?group_id=45176]]. Keeping the source code on disk will make it easier if you want to fix a bug and submit a patch. Instructions for compiling and installing the framework are included in the CVS. To install the nightly build, just uncompress it and dump all the frameworks into your /Library/Frameworks/ directory.33 +* Prototypes 42 42 43 - ===How to integrate WONDER with your application ===35 +* Excel 44 44 45 -If you are creating a new application, you can just do the following after installing WONDER in your system: 46 - 47 -1. In Eclipse, choose "New / Other..." from the File Menu. A window will appear asking you what type of file do you want to create. 48 -1. Open the WOLips folder, by clicking on its disclosure triangle, and choose "WOnder Application". 49 - 50 -That's it. This will create a new WO application, ready to be used with WONDER. 51 - 52 -If you want to integrate WONDER with and existing Application, you must follow **all** the steps described in the [[integration page of the WONDER wiki>>WONDER:Integrate Wonder Into an Existing Application]]. Note that it's not just adding the frameworks to the project, you really have to make all the code changes described there (it's easy to do, but don't skip it, or you'll have problems). 37 +* Graphs