You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Lowe <ma...@talk21.com> on 2003/05/18 03:33:33 UTC

Re: why struts , Confused ?

I dont agree with making the syntax of the tag attributes is a problem, 
if you tried to develop a framework that attempted to adhere to html 
attribute names you'd end up with a huge mess. At sometime or another 
developers and site builders have to be talking the same language, this 
isn't saying letting programmers loose on some html (cos they always 
mess it up) or letting html'ists loose on model layer programming (cos 
they always mess it up). But sooner or later there has to be some 
common terminology between the two (Objects and properties of those 
objects). From this point of view i have no issue with the

<tag:sometag name="object" property="prop"

syntax. Another consideration is that using the standard tag library is 
strongly encouraged over using struts tags, althougth i confess to 
prefering the struts tags.

Tags aside the real strength of struts is the action classes. In the 
case of a site builder with good javascript knowledge and perhaps a lot 
of model 1 development experience, the action classes provide a nice 
tidy workspace in which to join things up like wise programmers can 
work on stuff with out ploding through any client-side code, this is my 
concept of what struts does.

I started using struts when i started at a company with no technical 
director (yes its true), but i was used to working in a more structured 
envionment. I knew about MVC patterns but I'd never seen it done 100% 
successfully [I'd worked in model 1.5 :o)]. Anyway not having any 
senoiur guidance, and my peers being a Php (' it works' (with a 
worrying tone of suprise in his voice)) copy and paster, and a Perl ('I 
dont have to explain anything cos you're all stupid') programmer. 
Having the struts project was invaluable. I had some rules to stick to, 
the user group which helped with my teething problems, and the 
documentation. Although I had to do all the site building and 
development being able to seperate the 2 helped maintain clarity.

Although it can be said that struts doesn't really do that much that is 
new as such, and its a bunch of wrappers around other java packages 
(although not only), struts brings this all together in a way that you 
can get on with the job in hand while not comprimising the MVC pattern 
(unless you want to). You can start thinking in an event based manner 
and get all the forms and actions defined (incl validation) and working 
quicker.

There's my 2 pence with a couple of lunchen vouchers thrown in for 
gratis

cheers

mark

Mercoledì, 30 apr 2003, alle 15:06 Europe/London, Paul Gier ha scritto:

> I think struts is a very useful framework, especially tiles and
> validation.  I worked on applications with and without struts, and I
> definitely prefer to work on larger applications with struts.  However 
> I
> also agree with both of you that one of the most time consuming things 
> in
> the beginning was trying to get the tag syntax correct.
> I think this is partly the fault of the JSP spec because the JSP bean 
> tags
> follow a similar confusing naming convention.
>
> Maybe for struts 1.2 the tags should be changed.  Since in the java API
> the beans are actually called attributes of the request, session, or
> application, they could use something like
>
> <html:hidden  name="stuff"  attributeName="stuffbean"
> attributeProperty="stuffvalue"/>
>
> or if you wanted to get the value from a request parameter instead of 
> an
> attribute
>
> <html:hidden name="stuff" paramName="stuffParam"/>
>
> I think this would make the tags a lot easier for new users.  Most of 
> the
> confusion for me comes from the fact that "name" and "property" can 
> mean
> different things depending on what tag you are using.
>
>
>
>
>
>
>
>
> Daniel Jaffa <ja...@courtinnovation.org>
> 04/29/2003 11:34 AM
> Please respond to "Struts Users Mailing List"
>
>
>         To:     Struts Users Mailing List 
> <st...@jakarta.apache.org>
>         cc:
>         Subject:        Re: why struts , Confused ?
>
>
> Matt,
>
> I totally agree with you.  Now that i see what u do not like about the
> html
> tags are the same problems i had when i first started to use struts.
>
>
> ----- Original Message -----
> From: "Kruse, Matt" <MK...@aquent.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Monday, April 28, 2003 4:50 PM
> Subject: RE: why struts , Confused ?
>
>
>>>  <html:hidden  name="calendarLoop" property="caseID"/>
>>
>> This is the kind of syntax that annoys me!
>>
>> An <INPUT> HTML tag already has a NAME attribute. Yet the NAME 
>> attribute
>> given here is _not_ the HTML attribute, while others (like onchange,
> etc)
>> _are_. Further, the "name" of the generated HTML tag in this case is
>> actually the text contained in the "property" value. This is quite
>> confusing, and unnecessarily so, IMO.
>>
>> Instead, I'd rather have
>> <html:hidden bean="calendarLookup" beanProperty="caseID"/>
>> and
>> <logic:iterate id="calendarLoop" bean="calendar"
>> beanType="com.cci.dv.formBean.CalendarBean">
>> or maybe even...
>> <logic:iterate localLoopBeanName="calendarLoop" iteratorIndexName="i"
>> beanToIterate="calendar" beanType="com.cci.dv.formBean.CalendarBean">
>>
>> Having some fields be direct matches to the HTML tag, and others not, 
>> is
>> confusing. Having attribute names which don't really explain what they
> are
>> doing is also confusing.
>>
>> When I get some spare time, I'll be writing a wrapper taglib which 
>> will
> use
>> more intuitive names and cause less confusion for me and developers 
>> I'm
>> working with :)
>>
>> Matt Kruse
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org