dm = document.lastmodified; if (date.parse(dm) != date.parse(date()) && date.parse(dm) != 0) document.writeln("last modified: " + dm); last modified: 01/07/2003 01:15:37
页面开发者 - 趋向于从基于页面的视角来看待web应用.目前为止,这一类人为数众多,他们的重心倾向于jsp, asp, php, cold fusion等等基于模板的技术.他们一般对javascript与vbscript这样的脚本语言也比较熟悉. 【程序编程相关:Windows XP下Eclipse+C】
barracuda - framework comparisons 写作本文的目的是为了提供对barracuda与struts的详细分析.我们首先关注于它们各自大体的架构,然后再就关键问题进行比较/对比. 开发方式 framework概要 barracuda 客户端接受能力 事件模型 表单映射与验证 xmlc 本地化 组件模型 struts controller model view utilities 未来的发展方向 比较与对比 用户界面方面 界面表示与程序逻辑的分离 页面设计 标签库 用户界面布局 本地化 对多种类型客户端的支持 support for multiple client skins client capabilities client accessibility 流程控制方面 事件处理 mvc / model 2 工作流程 服务器端 form映射与验证 错误处理 组件模型 组件复用 scalability throughput volume 与开发工具的集成 page tools ides开发方式 - 当我们进行web应用的开发时,很难去夸大不同开发方式间的差异.不过,如果经过更进一步的观察,我们还是可以识别出一些现今的开发方式上的分化.
开发者类型 - 今天,有两种截然不同的开发者正在创建web应用: 【推荐阅读:J2ME (Java 2 Micro E】
开发工具 - 循着相似的线索,我们能看到两种截然不同的开发工具与上面提到的两种开发者相对应: 【扩展信息:黑客组织敲诈多家国内网站 QQ停摆另有隐】
java开发者 - 趋向于从以应用为中心的视角来看待web应用.这些人更喜欢用强数据类型的面向对象语言,比如java, c++或是smalltalk来编码,并且经常使用servlet技术来进行web应用的构建.
基于页面的工具 - 一般指类似于dreamweaver, ultradev与frontpage这样的可视化编辑器.
传统的ide - 一般是指类似jbuilder, netbeans/forte, visualage或是visualcafe这样的开发环境.
然而这些都是显而易见的,如果我们能够更为清晰地描绘出这些差异将会很有意义,因为许多web while these are obvious generalizations (and there is undoubtedly overlap!), it is valuable to delineate this segmentation, as many web frameworks will gravitate towards one or the other ends of the spectrum.
interestingly, none of the development tools that exist today really make it easy to develop webapps (at least not to the extent that a tool like vb made it possible for corporate developers to easily build applications without a lot of specialized programming knowledge). ultimately, we feel these tools are lacking primarily because a suitable presentation framework infrastructure -- capable of supporting the challenges of the http req-resp paradigm, with its necessary separation of presentation and business logic -- has not yet emerged. such a framework will be critical if we ever hope to see tools that unify the designer roles and developer roles and allow the rapid assembly of web application and web services from reusable components.
framework summaries - we want to start by taking a high level look at how each of the various frameworks approaches the problem domain: making it easier to build web apps. we begin by looking at barracuda (since we know that best after all ;-) and then look at some other leading efforts.
barracuda - the barracuda presentation framework is built as a series of layers that depend on the servlet 2.2+ api, each of which can be used independently of one another. in terms of audience, barracuda definitely aims at the java developer end of the spectrum (with the idea that tools integration will ultimately make the approach more accessible to page author types).
at the highest level, the barracuda architecture can be summarized by the following diagram:
the key features of barracuda are summarized here:
client capabilities - automatically identifies client capabilities (browser type, target locale, etc). event model - maps client requests to first class event objects; dispatches events to all interested listeners; guarantees that an http response is generated. form mapping & validation - converts http form parameters into first class java objects and provides a powerful validation mechanism to verify them. xmlc - compiles html, wml, and xml documents into dom template objects that can be manipulated programmatically. localization - automatically creates localized versions of the dom templates for additional locales. these templates can be loaded based on a target client locale. component model - uses familiar ui widgets with strongly typed swing-style mvc interfaces to dynamically populate the dom templates with data. the dom can then be rendered and returned to the client browser.a detailed explanation of these areas follows:
client capabilities - barracuda begins by identifying the client´s capabilities. in particular, it can determine:
client type -- what kind of client are we dealing with (nn, ie, etc) as well as the specific version of the client client scripting capabilities -- what kind of scripting is supported (javascript, vbscript, wmlscript, or none) along with the specific version information target output format -- what kind of output the client expects (html, wml, xml, etc) as well as the specific version of markup supported target client locale -- the client locale informationthis information is available throughout the entire request-response cycle, making it easy to perform custom processing based on a client specifics.
event model - the barracuda event model is all about routing -- it´s responsible for turning http requests into first class event objects, dispatching the events to interested parties, and then making sure that an http response was generated. there are a number of specific features:
makes it easy to implement model 2 style flow control by utilizing a 2-phase dispatch loop in which all request (control) events are processed first, followed by all response (view) events. allows for true event driven programming on the server since events are first class java objects (not just strings or method names) and any event can have multiple listeners event handlers can be implemented using inner classes, just like in swing integrates with the component model, meaning you can add listeners to components and your server-side event handler code will automatically get invoked when an action occurs on the client events are hierarchical in nature, making it very easy to make an application secure (by controlling what events can be fired without needing to modify the actual event handler code) and robust (by ensuring that a response will always be generated, even if the developer forgets to handle a view event) the model is fundamentally scalable -- event handler instances are lightweight and short-lived (lasting only for the duration of a req-resp cycle) and event dispatching is fast (no reflection / introspection)as a final note, the barracuda event model is based on interfaces, making it fully pluggable (you could easily substitute your own event dispatching mechanism if need be). in addition, while the model is tuned for the http req-resp paradigm, it could also be integrated with other non-response based protocols (ie. smtp, jms, a 3rd party scheduling system, etc).
form mapping & validation - once the event model has routed control to the proper location, it is often necessary to examine a client´s input parameters before actually generating a response. this is where barracuda´s form mapping & validation layer comes into play:
easily map http form parameters into first class java objects based on key name and data type (string, boolean, integer, date, long, short, double, float) provide default values if an expected parameter is not present provide a number of prebuilt validators (notnull, validtype, equals, maxlength, minlength, range, digit) to handle common validation tasks in a reusable fashion support the the notion of custom validators to express specific business logic validation requirements allow for validator aggregation, by which any number of simple validators can be used as building blocks for more complex validation behavior support for nestable validation exceptions, making it possible to catch either the first exception or all exceptions on a collection of datathese features make it easy to get data back from the client in a form that is more easily handled on the server.
xmlc - once we have converted data that came from the client into something more useful than raw string data, we usually need to respond in some fashion (ie. the do-something-on-the-server phase). if we are following the model 2 pattern, this might involve updating some kind of "model" via jdbc, rmi, ejb, etc.
barracuda offers no help yet imposes no restrictions on what you do in this stage. instead, it waits for the render-a-response phase that inevitably follows. this is the point in which we finally generate a page (or "view") in response to the client´s http request. barracuda has a lot to offer in this area, and it all starts with a tool called xmlc.
... 下一页