RE: Advantages of Struts?

2003-12-05 Thread McClung, Brian
The property file usage works well if you have an application that is
deployed once and doesn't change that often.  Also if there aren't several
apps running off the same domain.  In my case it doesn't work well because
there is so much information that changes, potentially from day to day, that
the property file rapidly becomes unmaintainable.  Plus, with the property
file solution I need to be involved in the creative designers process.  


Brian McClung
Senior Programmer
Belo Interactive
214-977-4083


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 8:16 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Advantages of Struts?


You can easily move your application specific configuration to other
configuration files (i.e. ApplicationResources or tiles-defs.xml). You
don't have to use the mapping.findForward() at all in your Actions,
instead, read these values from ApplicationResource files.

> Robert H. Tran wrote:
> 
>>My point was not against configuration altogether, but rather against
the
>>current rigid and centralized configuration. There should be options.
If
>>there is configurations in a component, it should be self-contained by
the
>>component. It is no framework's business. If there is an api in
Struts,
> 
> this
> 
>>can be done nice and easy, as I said with Eclipse.
>>
>>- Robert.
>>
>>- Original Message - 
>>From: "Martin Cooper" <[EMAIL PROTECTED]>
>>To: <[EMAIL PROTECTED]>
>>Sent: Thursday, December 04, 2003 11:51 AM
>>Subject: Re: Disadvantages of Struts?
>>
>>
>>
>>
>>>"Robert H. Tran" <[EMAIL PROTECTED]> wrote in message
>>>news:[EMAIL PROTECTED]
>>>
>>>
>>>>I think an action's mapping is a decision by the action itself. Like
I
>>>
>>>said
>>>
>>>
>>>>earlier, when an application development finishes, that decision
will
>>>
>>>become
>>>
>>>
>>>>static. At that point, when an Action's mapping changes, its code
will
>>>
>>>have
>>>
>>>
>>>>to change too (unless the new mapping is kind of a synonym to the
old
>>>>mapping, which doesn't bear any shift in the semantics). As such,
there
>>
>>is
>>
>>
>>>>almost no point in keeping the decision and the code separate (i.e.
>>
>>making
>>
>>
>>>>the decision's configuration a loose end of the code). Or at least,
>>>>configuration shouldn't be the only way to add or modify an Action.
>>>
>>>I disagree with this almost completely. If actions are written
properly,
>>
>>you
>>
>>
>>>should be able to reconfigure the application, to some extent at
least, by
>>>changing the config alone and not touching the Java code. This is
>>
>>immensely
>>
>>
>>>useful when an app needs to be customised after the fact, and when
the
>>>source code is not available (e.g. by a customer, in their own
>>
>>environment).
>>
>>
>>>--
>>>Martin Cooper
>>>
>>>
>>>
>>>
>>>>Even though each Action's configuration may be small, the
configurations
>>>
>>>for
>>>
>>>
>>>>all the Actions need to be kept track of and maintained (for
integrity).
>>>>That may be a significant but unnecessary side work. To view the
>>
>>mappings,
>>
>>
>>>>there can be a tool to traverse the structure by api calls and
display
>>
>>it.
>>
>>
>>>>That can be done after the fact and doesn't have to be before it. In
>>>>addition to that, when the decision (or configuration if any) goes
where
>>>
>>>the
>>>
>>>
>>>>code lives, modularity increases.
>>>>
>>>>IMHO,
>>>>
>>>>- Robert.
>>>>
>>>>
>>>>- Original Message - 
>>>>From: <[EMAIL PROTECTED]>
>>>>To: <[EMAIL PROTECTED]>
>>>>Sent: Thursday, December 04, 2003 6:55 AM
>>>>Subject: RE: Disadvantages of Struts?
>>>>
>>>>
>>>>I have to disagree with you on the first point. I find that there is
>>>>just a small amount of necessary configuration required to build an
>>>>Action class (most of my Action configurations have about a half
dozen
>>>>lines, even less if there is no associat

RE: Advantages of Struts?

2003-12-05 Thread John . Pitchko


BDY.RTF
Description: RTF file
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Advantages of Struts?

2003-12-04 Thread Vic Cekvenich
Maybe in old days of client server, people used to ship Oracle and MS 
SQL drivers for ODBC. Boy, that was not fun, so people learned. Yeah, 
OCI and ctlib, good ridance.

In J2EE, the container provides services. (As per any J2EE book).
JNDI, DataSourcePool, Security, etc. etc. So no need to have JDBC 
related jars in war file.

Newbies don't use these services, but re-implement a home grown exiotic 
 and buggy versions. (Sometimes that is good, becuase I used to make 
money by just fixing "connection" leaks)
A pro just uses the J2EE services that are debuged and working 
allready.

They do this for exactly the same reason you said. In order to do less 
configuration. If emplyees is removed, and security is LDAP or JDBC 
realms or what ever, no impact on the war file.
If the DataSource needs to be changed to have a database fail over, no 
need to change the war file, or bother the developers. The unix admin 
just changes the xml file. Or deploy war file from stageing to 
production, no changes.
You can even change containers from Tomcat to Resin... and not change 
the WAR file. The is modular. Any scaling of data source pooling is a 
container toonable.

This has nothing to do with Struts, this is J2EE container services. You 
 do not have to use them, you can write your own security (that tags do 
not then see) or your own buggy connection pooling thing from JDBC 1.0.

Sturts is data layer agnostic, that's all. If you go out of the way to 
lock it... you can, no sign will pop up, the code will compile.
But you are not on a main road, and not many people will help you 
(unless you pay hourly)

If you remvoe a jar file, you need to regression test.
Are you suggesting that the Unix admin un-tars (nzips) the war file to 
get to the jar files for some good reason?

Untill you leverage J2EE container services, you will have stability 
issues, scalability issues, modular issues, etc.  (maybe write your own 
socket server? )

I know the fault. People have OLD jdbcs books, where the hello exaple is 
how to write a connection pool. This was OK in '95 and '96 when we used 
AWT. But things have advanced a bit since then.

Also, you will gain huge producitivity by using a DAO... which all realy 
on container services.

But again... this is a J2EE discussion, not Struts. Like if you used 
Spring, or WebWork, or Tapestry, or Sofia or ...
Same thing. Use a DAO! Use container services provided for you for free 
and working.
If the conatiner does not give you good scallability or is to messed 
up... you can pick another (again J2EE options)

.V



Robert H. Tran wrote:
Point taken. But there is an option to modularize (and scale too), which is
currently missing. It's like adding (or removing) an employee phone number
at a firm usually doesn't mean having to update the listing at the phone
company, especially not by the employee himself going to the phone company
to do that. Yet the employee's phone can still be found and served up.
That's the job of the firm. It should be self-contained under the firm's
management to interface with the phone company through some protocols. Any
one firm added or removed shouldn't incur changes to the phone company's
configuration. A more practical example is: I want to remove this one jar
file that contains one (possibly multiple) independent unit(s) of many
actions and pages, what entries in Struts's configuration file do I need to
remove? The other option allows me to just remove the jar file (or a
corresponding directory) worry-free.
- Robert.

- Original Message - 
From: "Vic Cekvenich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 3:20 PM
Subject: Re: Advantages of Struts?



FAQ #2:

I would say this about Struts:

Sturts is like a kindergarden, we put our boots here, our books here;
thus they allow people to know where to find things on a project.
Presnetation here, Data Layer here;
And also people know generaly what they should be doing:
Once you have a form (html) mock up, you know what the formbean should
be (it mapps). Just get the form bean to CRUD via DAO.
Also a few consider dynambeans a bad practice.
http://sixlegs.com/blog/java/death-to-dynabeans.html
I consier them a not as good as form beans, they are harder to unit test
among other things.
.V

McClung, Brian wrote:

Robert,

I've gone to the opposite extreme as you.  I don't want the action to be
responsible for where it goes, only for telling users which forward
states

it supports.  I've removed the forward from both the Action and the
struts-config.xml file.  The action still returns the forward, but the
forward is dynamically created based on what the page has passed to the
action.  In my situation I resorted to this because I was using a single
action to handle multiple applications on the same site.  This meant
that my

path would not be the same between each appl

Re: Advantages of Struts?

2003-12-04 Thread Robert H. Tran
Point taken. But there is an option to modularize (and scale too), which is
currently missing. It's like adding (or removing) an employee phone number
at a firm usually doesn't mean having to update the listing at the phone
company, especially not by the employee himself going to the phone company
to do that. Yet the employee's phone can still be found and served up.
That's the job of the firm. It should be self-contained under the firm's
management to interface with the phone company through some protocols. Any
one firm added or removed shouldn't incur changes to the phone company's
configuration. A more practical example is: I want to remove this one jar
file that contains one (possibly multiple) independent unit(s) of many
actions and pages, what entries in Struts's configuration file do I need to
remove? The other option allows me to just remove the jar file (or a
corresponding directory) worry-free.

- Robert.

- Original Message - 
From: "Vic Cekvenich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 3:20 PM
Subject: Re: Advantages of Struts?


> FAQ #2:
>
> I would say this about Struts:
>
> Sturts is like a kindergarden, we put our boots here, our books here;
> thus they allow people to know where to find things on a project.
> Presnetation here, Data Layer here;
> And also people know generaly what they should be doing:
> Once you have a form (html) mock up, you know what the formbean should
> be (it mapps). Just get the form bean to CRUD via DAO.
>
> Also a few consider dynambeans a bad practice.
> http://sixlegs.com/blog/java/death-to-dynabeans.html
> I consier them a not as good as form beans, they are harder to unit test
> among other things.
>
>
> .V
>
> McClung, Brian wrote:
> > Robert,
> >
> > I've gone to the opposite extreme as you.  I don't want the action to be
> > responsible for where it goes, only for telling users which forward
states
> > it supports.  I've removed the forward from both the Action and the
> > struts-config.xml file.  The action still returns the forward, but the
> > forward is dynamically created based on what the page has passed to the
> > action.  In my situation I resorted to this because I was using a single
> > action to handle multiple applications on the same site.  This meant
that my
> > path would not be the same between each application.  Resorting to
multiple
> > mappings in the configuration file would rapidly get out of control for
me
> > as some of these applications can be created and removed rather quickly.
I
> > do have separate pages per application and this is why the page drives
the
> > actions result.
> >
> > I know this bends the MVC pattern, but it allows me to concentrate on
> > developing actions, form beans, and all the back end business logic,
while
> > letting the Creative Designers develop pages and GUI workflow.
> >
> > Is anyone else doing something similar?  I posted my DynaAction class
that I
> > use to do this with a couple of weeks ago.  It really surprises me that
> > there hasn't been a greater need for something like this in the
community.
> > I'd be curious to hear how others have solved this problem.
> >
> > Brian McClung
> > Senior Programmer
> > Belo Interactive
> > 214-977-4083
> >
> >
> > -Original Message-
> > From: Vic Cekvenich [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, December 04, 2003 2:18 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Disadvantages of Struts?
> >
> >
> > I disagree with you as well Robert.
> > Having a confgiration nudges you toward design and separation, and
> > everyone on the team know where to find things.
> >
> > In fact, when not doing Web apps, I use HiveMind, just so that I can
> > have the structure.
> >
> > Anyway, there a lot of MVC compeitoris.
> >
> >
> > .V
> >
> > Robert H. Tran wrote:
> >
> >>My point was not against configuration altogether, but rather against
the
> >>current rigid and centralized configuration. There should be options. If
> >>there is configurations in a component, it should be self-contained by
the
> >>component. It is no framework's business. If there is an api in Struts,
> >
> > this
> >
> >>can be done nice and easy, as I said with Eclipse.
> >>
> >>- Robert.
> >>
> >>- Original Message - 
> >>From: "Martin Cooper" <[EMAIL PROTECTED]>
> >>To: <[EMAIL PROTECTED]>
> >>Sent: Thursday, December 04, 2003 11:51 

RE: Advantages of Struts?

2003-12-04 Thread McClung, Brian
Just wanted to clarify, Its a value for the action that is modified, not the
forward name.  The Forward Names are set by the Action, the values
(resulting URL) are set by the pages.

Brian McClung
Senior Programmer
Belo Interactive
214-977-4083


-Original Message-
From: Vic Cekvenich [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 5:20 PM
To: [EMAIL PROTECTED]
Subject: Re: Advantages of Struts?


FAQ #2:

I would say this about Struts:

Sturts is like a kindergarden, we put our boots here, our books here; 
thus they allow people to know where to find things on a project. 
Presnetation here, Data Layer here;
And also people know generaly what they should be doing:
Once you have a form (html) mock up, you know what the formbean should 
be (it mapps). Just get the form bean to CRUD via DAO.

Also a few consider dynambeans a bad practice.
http://sixlegs.com/blog/java/death-to-dynabeans.html
I consier them a not as good as form beans, they are harder to unit test 
among other things.


.V

McClung, Brian wrote:
> Robert,
> 
> I've gone to the opposite extreme as you.  I don't want the action to be
> responsible for where it goes, only for telling users which forward states
> it supports.  I've removed the forward from both the Action and the
> struts-config.xml file.  The action still returns the forward, but the
> forward is dynamically created based on what the page has passed to the
> action.  In my situation I resorted to this because I was using a single
> action to handle multiple applications on the same site.  This meant that
my
> path would not be the same between each application.  Resorting to
multiple
> mappings in the configuration file would rapidly get out of control for me
> as some of these applications can be created and removed rather quickly.
I
> do have separate pages per application and this is why the page drives the
> actions result.
> 
> I know this bends the MVC pattern, but it allows me to concentrate on
> developing actions, form beans, and all the back end business logic, while
> letting the Creative Designers develop pages and GUI workflow.  
> 
> Is anyone else doing something similar?  I posted my DynaAction class that
I
> use to do this with a couple of weeks ago.  It really surprises me that
> there hasn't been a greater need for something like this in the community.
> I'd be curious to hear how others have solved this problem.
> 
> Brian McClung
> Senior Programmer
> Belo Interactive
> 214-977-4083
> 
> 
> -Original Message-
> From: Vic Cekvenich [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 04, 2003 2:18 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Disadvantages of Struts?
> 
> 
> I disagree with you as well Robert.
> Having a confgiration nudges you toward design and separation, and 
> everyone on the team know where to find things.
> 
> In fact, when not doing Web apps, I use HiveMind, just so that I can 
> have the structure.
> 
> Anyway, there a lot of MVC compeitoris.
> 
> 
> .V
> 
> Robert H. Tran wrote:
> 
>>My point was not against configuration altogether, but rather against the
>>current rigid and centralized configuration. There should be options. If
>>there is configurations in a component, it should be self-contained by the
>>component. It is no framework's business. If there is an api in Struts,
> 
> this
> 
>>can be done nice and easy, as I said with Eclipse.
>>
>>- Robert.
>>
>>- Original Message - 
>>From: "Martin Cooper" <[EMAIL PROTECTED]>
>>To: <[EMAIL PROTECTED]>
>>Sent: Thursday, December 04, 2003 11:51 AM
>>Subject: Re: Disadvantages of Struts?
>>
>>
>>
>>
>>>"Robert H. Tran" <[EMAIL PROTECTED]> wrote in message
>>>news:[EMAIL PROTECTED]
>>>
>>>
>>>>I think an action's mapping is a decision by the action itself. Like I
>>>
>>>said
>>>
>>>
>>>>earlier, when an application development finishes, that decision will
>>>
>>>become
>>>
>>>
>>>>static. At that point, when an Action's mapping changes, its code will
>>>
>>>have
>>>
>>>
>>>>to change too (unless the new mapping is kind of a synonym to the old
>>>>mapping, which doesn't bear any shift in the semantics). As such, there
>>
>>is
>>
>>
>>>>almost no point in keeping the decision and the code separate (i.e.
>>
>>making
>>
>>
>>>>the decision's configuration a loose end of the code). Or at least,
>>>>configuration shouldn't be the

Re: Advantages of Struts?

2003-12-04 Thread Vic Cekvenich
FAQ #2:

I would say this about Struts:

Sturts is like a kindergarden, we put our boots here, our books here; 
thus they allow people to know where to find things on a project. 
Presnetation here, Data Layer here;
And also people know generaly what they should be doing:
Once you have a form (html) mock up, you know what the formbean should 
be (it mapps). Just get the form bean to CRUD via DAO.

Also a few consider dynambeans a bad practice.
http://sixlegs.com/blog/java/death-to-dynabeans.html
I consier them a not as good as form beans, they are harder to unit test 
among other things.

.V

McClung, Brian wrote:
Robert,

I've gone to the opposite extreme as you.  I don't want the action to be
responsible for where it goes, only for telling users which forward states
it supports.  I've removed the forward from both the Action and the
struts-config.xml file.  The action still returns the forward, but the
forward is dynamically created based on what the page has passed to the
action.  In my situation I resorted to this because I was using a single
action to handle multiple applications on the same site.  This meant that my
path would not be the same between each application.  Resorting to multiple
mappings in the configuration file would rapidly get out of control for me
as some of these applications can be created and removed rather quickly.  I
do have separate pages per application and this is why the page drives the
actions result.
I know this bends the MVC pattern, but it allows me to concentrate on
developing actions, form beans, and all the back end business logic, while
letting the Creative Designers develop pages and GUI workflow.  

Is anyone else doing something similar?  I posted my DynaAction class that I
use to do this with a couple of weeks ago.  It really surprises me that
there hasn't been a greater need for something like this in the community.
I'd be curious to hear how others have solved this problem.
Brian McClung
Senior Programmer
Belo Interactive
214-977-4083
-Original Message-
From: Vic Cekvenich [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 2:18 PM
To: [EMAIL PROTECTED]
Subject: Re: Disadvantages of Struts?
I disagree with you as well Robert.
Having a confgiration nudges you toward design and separation, and 
everyone on the team know where to find things.

In fact, when not doing Web apps, I use HiveMind, just so that I can 
have the structure.

Anyway, there a lot of MVC compeitoris.

.V

Robert H. Tran wrote:

My point was not against configuration altogether, but rather against the
current rigid and centralized configuration. There should be options. If
there is configurations in a component, it should be self-contained by the
component. It is no framework's business. If there is an api in Struts,
this

can be done nice and easy, as I said with Eclipse.

- Robert.

- Original Message - 
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 11:51 AM
Subject: Re: Disadvantages of Struts?




"Robert H. Tran" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

I think an action's mapping is a decision by the action itself. Like I
said


earlier, when an application development finishes, that decision will
become


static. At that point, when an Action's mapping changes, its code will
have


to change too (unless the new mapping is kind of a synonym to the old
mapping, which doesn't bear any shift in the semantics). As such, there
is


almost no point in keeping the decision and the code separate (i.e.
making


the decision's configuration a loose end of the code). Or at least,
configuration shouldn't be the only way to add or modify an Action.
I disagree with this almost completely. If actions are written properly,
you


should be able to reconfigure the application, to some extent at least, by
changing the config alone and not touching the Java code. This is
immensely


useful when an app needs to be customised after the fact, and when the
source code is not available (e.g. by a customer, in their own
environment).


--
Martin Cooper



Even though each Action's configuration may be small, the configurations
for


all the Actions need to be kept track of and maintained (for integrity).
That may be a significant but unnecessary side work. To view the
mappings,


there can be a tool to traverse the structure by api calls and display
it.


That can be done after the fact and doesn't have to be before it. In
addition to that, when the decision (or configuration if any) goes where
the


code lives, modularity increases.

IMHO,

- Robert.

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 6:55 AM
Subject: RE: Disadvantages of Struts?

I have to disagree with you on the first point. I find that there is
just a small amount of necessary configuration required to build an
Action class (most of my Action configurations have about a half dozen
lin

Re: advantages of Struts

2001-04-14 Thread Ted Husted

I think the best discussion of "Why we need Struts" is summed up in
Jason Hunter's. article regarding the difficulties with JSP Model 1
applications. 

< http://www.servlets.com/soapbox/problems-jsp.html >

What all this boils down to is that Struts gives you a place to stand. 

Without a controller, a Web application is a breathless stream of views. 

With a controller, a Web application is a series of requests and
responses, as HTTP intended. The views request and an action responds
with another view. Ideally, your views become scriplet-free "JavaBean
Pages", that could be easily edited with a visual Java 2 Web editor (at
least as soon as we get one!). 

A MVC application like Struts does force you to be more organized, and
does compels you to define objects that in a model 1 application may
only be implied. But the objects are still there and so is the work.
It's just whether you want to spend your time defining JavaBeans or
cutting and pasting code snippets between JSPs. 

The next big step will be to integrate rowsets into Struts. If we can
use rowsets where we use JavaBeans now, we can drop a layer of
abstraction, and actually gain both flexibility and functionality. Many
actions then become very simple adapters that just retrieve a rowset and
pass it to the request. The Struts forms could then read and set the
fields on the rowset, and the rowset could be used to update the model
directly when it was returned. No additional hand-offs. The best thing
here being that rowsets can work with any tabular data, not just JDBC.

< http://developer.java.sun.com/developer/earlyAccess/crs/ >

Sadly, the current Sun implementations require transactions to update a
JDBC table, and the (default) MySQL tables still don't support
transactions. I tried turning transactions off   
(setTransactionIsolation(TRANSACTION_NONE), but it just laughed and
tossed the exception anyway. So right now, I'm using rowsets for
retrievals, and conventional connections for insertions. In between, I
dump the rowsets into JavaBeans, but hope to skip that step soon and
send the rowsets directly to the JSPs.

Iraklis Kourtidis wrote:
> 
> Hi fellow Struts users,
> 
> I wanted to start a small discussion on something very general: what Struts
> gets you over embedding scriptlets in your JSPs (i.e., Struts vs. no
> Struts). I know, it's Friday, so we should all be going home... anyway, here
> goes it:
> 
> Given my (limited) experience in developing a small application, what I
> personally see as the biggest advantage is the following:
> 
> * Action classes can run the code that would normally get executed as a
> scriptlet in a JSP (or as glorified function calls through tags).
> * The Action classes place a bunch of beans on the request/session.
> * The JSP then runs and displays the information stored in these beans,
> possibly using logic:iterate.
> 
> One disadvantage that I see is that all the communication from the action
> classes to the JSPs happens through beans placed on the request/session. A
> JSP-only solution would display the information directly without making
> beans out of it (and without the necessary java bean classes to represent
> information that gets sent to a JSP in the form of a bean.)
> 
> At any rate, I like the fact that Struts makes it possible to completely
> remove any code from the JSP files, which makes it easier for the design
> staff to modify layout etc. etc. I know, you don't need Struts to do this,
> but in reality if you look at most JSPs out there, you'll find a ton of
> scriptlet code in the JSP (I've been heard of threads being started inside a
> JSP...) So Struts makes it easier for me to separate the presentation from
> the code behind it.
> 
> I am curious about how (and why) the rest of you gain from Struts.