From: Lane S. <la...@op...> - 2003-01-21 15:24:48
|
Marc Palmer wrote: >>> Am I on the nail now? >> >> >> Yeah. You let the template author control the expert action flow. Not >> the servlet writer. In this case, the action control flow is >> delegated to a template writer's expert knowledge of the action flow, >> rule base. The programmer writes the ugly stuff like transaction >> commits, etc. > > > OK, the only thing I don't like about this is using WM as a general > purpose language. We don't have all the syntax and capabilities of a > "full" language as well as the WM philosophy consideration that it's > just for presentation. Expert rule processing is business processing rule stuff like #if ($customerInGoldClub) {#setDisccount(.10, $customer) } it is this kind of stuff that you want to expose to the web app team. > > > Is this really necessary anyway? I mean, a template will expose links > to a bunch of actions so the user clicks on them / submits forms. > These will execute the appropriate action, and return the appropriate > response. the actions must have a way to evaluate user rules, settings. this can be as simple as providing a WebMacro instance by itself for rule processing. > > > Actions will be able to support some kind of "nextAction" parameter > that indicates what should happen next after the Action executes. I do not think you want to go there. I think you leave this protocol to the user to define as required or not required. > > > i.e. an InsertIntoDatabaseAction might look for the nextAction > parameter and use some supplied mechanism to execute that action after > the insert. If the nextAction parameter is not present, it could just > return a results template with the new database contents. (for example) Again, you are making predictions about the recipe. Let's build the kitchen with a lot of clean and powerful, process-neutrality. The cooks are the web-app builders. Let them come in with their own recipes. > > > I can't see how the business rules of an application can be cleanly > coded into a WM template (or main template plus included parts). > Wouldn't it be really ugly? see above. > > > One thing I am planning to add to the idea is a default helper for > generating URIs to execute actions, so the template need not know the > details of "hidden" parameter names and so on. This concept could be > extended to support creating a single URI that will result in the > execution of several actions i.e: > > <FORM METHOD=POST ACTION="$WebMacro.executeActions( ["insertIntoDB", > "commitToDB", "queryDB"])"> > ...hidden fields containing parameters such as table name and fields.... > ...visible data fields... > </FORM> I think this is a good tool. > > > This function would make a pretty complex long URI, or put the info > into the session and return a short URI that identifies the info in > the session so the servlet can retrieve it and work out what actions > to execute. I do this now but use a #macro do the formatting. Could easily be done by a java helper tho. > > > This would make things quite modular and allow actions to be stacked - > writing to a DB and then emailing the data for example - with the > proviso that all the info necessary to perform all actions must be > available in the first request. We could allow per-action parameters > to be supplied too: > > <FORM METHOD=POST ACTION="$WebMacro.executeActions( > ["insertIntoDB:table=testdata", "commitToDB", > "queryDB:sqlselect='SELECT * FROM > testdata',template='dataresults.wmt'"])"> > > As every, thoughts welcome... but I really don't believe this webapp > will be the cure for all web application needs... just enough for 90% > of websites, and at the very least a much better replacement for > server side includes and related technologies. agreed. > > > Marc > > > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Webmacro-devel mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-devel > -- Lane Sharman http://opendoors.com Conga, GoodTimes and Application Hosting Services http://opendoors.com/lane.pdf BIO |