Re: Commands vs. Controllers

"jim moore" <[email protected]>
Newsgroups gmane.comp.web.maverick.general
Message-ID <[email protected]>
> 1. Browser requests an URL (eg. http://localhost/test.m)
> 2. In maveric terminology it appears that test.m is actually
>    mapped to a "test" command.
> 3. Maverick dispatches the request to appropriate Controller
>    that takes care of command execution. Controller also takes
>    care of the flow (eg. returns a view or executes another
>    command).
>
> Any controller can serve multiple commands. So commands are just
> placeholders for specific URLs.


this is a good way to look at it--you could easily have a general purpose
controller that could you would reuse in different situations--something as
simple as:

<command name="report">
    <controller class="foo.ReportCreator"/>
    <view path="report.jsp"/>
</command>

<command name="pdfReport">
    <controller class="foo.ReportCreator"/>
    <view path="pdf/report.jsp">
        <transform type="fop"/>
    </view>
</command>

<command name="excelReport">
    <controller class="foo.ReportCreator"/>
    <view path="excel/report.jsp"/>
</command>

obviously this could also be done as:

<command name="report">
    <controller class="foo.ReportCreator"/>
    <view name="standard" path="report.jsp"/>
    <view name="pdf" path="pdf/report.jsp">
        <transform type="fop"/>
    </view>
    <view name="excel" path="excel/report.jsp"/>
</command>

but the point is it is your choice as to how you want to organize your apps.

--jim



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
[INVALID FOOTER]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.