I have one more question related to this thread.
Let's say I need to write a web app to access and configure a server,
and these app has to modify the configuration files on this server. How
would you deal with this ? Write a persistence code so that you can hold
a reference for each file, or you would let the OS do it's job ?
Dave Newton wrote:
--- Mansour <[EMAIL PROTECTED]> wrote:
So I have to get away from OO in order to do this.
Nope.
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
headache.
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?
Nope.
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:
{quote}
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
architecture.
{quote}
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.)
d.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]