23.12.2012 Views

ZK Developer's Guide

ZK Developer's Guide

ZK Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Getting Started with <strong>ZK</strong><br />

Separation of Concerns<br />

One important paradigm in object-oriented programming is Separation of Concerns<br />

(SoC). This paradigm says that an application should be broken into distinct features<br />

that overlap in functionality as little as possible (see http://en.wikipedia.org/<br />

wiki/Separation_of_concerns).<br />

For large applications, it's not advisable to do the layout, and the logic together in<br />

one page. For such applications, you should follow the programming principle of<br />

separation of concerns. This separation is not only for architecture, but also for better<br />

maintenance of your application. This is because if you have your logic directly in<br />

Java classes, you can leverage the full power of your IDE, e.g. you can have a good<br />

debugger, and you can easily write unit tests.<br />

Configuration and Deployment<br />

The configuration for the <strong>ZK</strong> framework is separated in two files: web.xml for servlet<br />

and mapping definition, and zk.xml, which gives the possibility of overriding<br />

the default <strong>ZK</strong> system settings. The following figure shows that there are some<br />

mandatory settings, and some optional additional settings. The configuration in<br />

web.xml is mandatory for correct working of the <strong>ZK</strong> framework.<br />

Configuration of web.xml<br />

The most important place to configure a web application is the web.xml file. Without<br />

correct settings nothing will work. In the next paragraphs, we will have a detailed<br />

look at the settings that are necessary for the <strong>ZK</strong> framework.<br />

[ 36 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!