users@glassfish.java.net

Re: Objects vs. Static vs. performance vs. structure

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Mon, 19 Apr 2010 09:33:06 -0700

In general, static APIs are faster.
But common interface may allow you to evolute the different parsing
mechanism in the feature more easily.
Shing Wai Chan

On 4/18/10 2:26 AM, glassfish_at_javadesktop.org wrote:
> Hello,
>
> I have a question about performance in Java EE.
>
> I have a Dynamic Web Project where I sumbit a form that sends
> info to a Servlet and servlet filters out some data from a XML file according
> to submitted criteria.
>
> Now, I have 2 choices:
> 1. create classes that define data filters and have common interface to use in the Servlet
> 2. no objects, I have static functions that define how to filter the data
>
> And I may reuse those filters and also I may make more of them (+ with interface would also be that I can hold necessary filters in an array and apply them without having to write each one in some "if" clause manually)
>
>
> Examples:
> 1. interface has a method "boolean applyFilter()" - true when data passes as OK false when REMOVE
> 2. have class with static functions "boolean filterIntegerRange(a,b,c)", "boolean filterString(a, b)"
>
>
>
> Question: [i][b]Which option looks the best to you?[/b][/i]
>
> Thanks
> [Message sent by forum member 'urmas']
>
> http://forums.java.net/jive/thread.jspa?messageID=397613
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>