struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <>
Subject [OT] Re: Preparable or interceptors - is there a better mailing list than this ? some thing for total newbies.
Date Sun, 15 Apr 2007 15:48:17 GMT
--- Mansour <> wrote:
> So I have to get away from OO in order to do this.


Nobody is saying you *can't* do it like you are
describing. And it'll work great, until you want to:

(a) Change how your objects are persisted (say,
switching to iBatis, or Spring-based JDBC, etc.)

(b) Test parts of your logic/app/flow without having
to use a real database (for instance, to simulate
failures, operate on arbitrary data, create
pathological use cases, etc.).

> So, no point in doing things OO ?

Depends. Is it non-OOP to separate concerns? The
representation of my data is not related to how it is
persisted. If how I store my data *does* undergo a
change it's like to be a very large infrastructural

I would rather change well-defined persistence
interface classes than modify all my POJOs where I
have an additional set of concerns in the code.

I'd argue that compositing objects (POJO, service
impl, whatever) is more OOP than tightly coupling two
(largely) unrelated concerns.

> I know it pays of,  but do I have to learn and use
> many frameworks to get a simple application working?


You can do everything by hand: roll your own
persistence layer, do your own type conversion, write
HTML by hand, etc.

To quote from the S1 home page:

Is Struts the best choice for every project?

No. If you need to write a very simple application,
with a handful of pages, then you might consider a
"Model 1" solution that uses only server pages.

But, if you are writing a more complicated
application, with dozens of pages, that need to be
maintained over time, then Struts can help. For more
about whether Model 1 or MVC/Model 2 is right for you,
see Understanding JavaServer Pages Model 2

S2 goes a long way to lowering the entry barrier
(compared to S1) but I don't feel it's the best choice
for simple use cases, particularly if you're not
already familiar with Java's host of supporting
frameworks: there is a steep learning curve to writing
a full-stack Java web-app if you're starting from
ground zero.

Personally I don't recommend it unless you have a
decent non-technical reason ("My boss said I have to
use Java" or "This hot chick said she'd go out with me
if I used Struts 2" etc.) or a decent techical reason
("Everything else we have is in Java" or "I already
know everything about Spring and Hibernate; it would
be quicker" or "All we can deploy on is Tomcat" etc.)


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message