Last modified by Klaus Berkling on 2011/09/06 00:31

From version 35.1
edited by arroz
on 2007/12/16 21:24
Change comment: There is no comment for this version
To version 37.1
edited by arroz
on 2007/12/16 21:50
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -50,3 +50,31 @@
50 50  That's it. This will create a new WO application, ready to be used with WONDER.
51 51  
52 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).
53 +
54 +== Keep all the model functionality on a framework ==
55 +
56 +Many web application are not really a single application. Even if the end user interacts with only one application, many times you need to create back-offices, maintenance application that run scheduled jobs, etc.
57 +
58 +When you need to do it, you basically have two options:
59 +
60 +1. Duplicate all the model code you need. That's, obviously, bad bad bad.
61 +1. Create the new application, link it to your model framework, and you're done.
62 +
63 +It helps keeping most of your code in the model. Maintenance tasks usually have to do complex operations that share code with the main application itself. So, keeping it all in one place avoids code duplication and makes your life easier.
64 +
65 +Besides, it's really easy to create a framework:
66 +
67 +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.
68 +1. Open the WOLips folder, by clicking on its disclosure triangle, and choose "WOnderFramework" (or "WebObjects Framework" if you don't want to use WONDER).
69 +
70 +Then, you need to link your application to the framework:
71 +
72 +1. Right-click on your application project icon, and choose "Properties" from the contextual menu.
73 +1. Choose "Java Build Path" from the list on the left.
74 +1. Click on the "Projects" tab on the right.
75 +1. Click the "Add..." button and choose your framework. Click "OK" to close the projects window.
76 +1. Click "OK" to close the project properties window.
77 +
78 +Done. Now you're project is linking with your framework. If you think this is overkill, think again when you need to do a maintenance application of a backoffice. You'll love the time you spent separating the model code from the application. Also, this helps you write better code, because model code shouldn't need to know anything about the presentation layer. If you try to do that in your framework, you'll get an error, so you really can't do it! :)
79 +
80 +If you don't want to create the model framework now, at least take the advice of keeping the model layer fully independent from the presentation layer. This will make it easier if you decide, in the future, to separate the model code to a framework as described here.