struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hookom, Jacob John" <hooko...@uwec.edu>
Subject RE: The best way for learning struts (stupid question)
Date Thu, 16 Jan 2003 04:56:31 GMT
I agree with Andrew about jumping into it.  Really though, you should become familiar with
J2EE Design Patterns, there are quite a few books out there to pick up.  Once you know the
patterns, then things just come easier when you see people talk about Service Layers and MVC,
etc.
 
One good practice to look at right away is the concept of layering in your application.  Struts
describes the Model, View, and Controller (see documentation for clarification).  But if you
are writing applications with hopes of easy maintainability, then you need to add additional
application or service layers.
 
That means that your Action really doesn't have any "logic" in it persay, but you call methods
on another layer or object that handles logic for you.  One of the best ways to implement
layers is via the Bridge Pattern with the Factory Pattern where you do up interfaces that
describe the layer or service.
 
An example would be writing a persistence layer that stores your Employee Objects.  Well,
what if you want to store Employee data in XML files initially, but switch to a DB later?
 By layering your application, you can swap the XML implementation with a DB implementation
without changing any of your Struts code because you've isolated persistence to a seperate
layer.  Others will thank you later by incorporating layers of logic that allow for changes
later (anyone who's worked with a fickle (sp) client knows it's going to change about 10 times
before it's finalized).
 
As for Struts specific technologies, just start out with Action/ActionForms and error handling.
 That means first, try manually checking for errors in your ActionForm object or at the Action,
then try dipping into the Validator Libraries, which will handle validation for you by isolating
the logic to a seperate XML file.  The Tiles technology is nice, but for me, I would rather
stick with straight JSTL and JSP includes.
 
I hope this gives you some ideas,
Jacob Hookom

	-----Original Message----- 
	From: joni santoso [mailto:struts@plasa.com] 
	Sent: Wed 1/15/2003 10:33 PM 
	To: struts-user@jakarta.apache.org 
	Cc: 
	Subject: The best way for learning struts (stupid question)
	
	

	Hi,
	
	Now, I can already make struts read the new setting
	changes without resetting Tomcat.
	
	My question is now : what should I learn first? what
	should I master? As I see there are "too many" concepts
	and technical terms
	
	Thx,
	===========================================================================================
	Meriahkan Hari Valentine Anda dan Ikuti Lomba Desain Kartu Eletronik dengan Tema Valentine
	Ikuti Polling Pemilihan Pemenang Lomba Desain Kartu Elektronik Natal dan Tahun Baru 2003
di http://kartu.plasa.com/lomba
	KSI PlasaCom - Reuni Alumni STTTelkom http://www.plasa.com/belajar/reuni.html
	===========================================================================================
	
	--
	To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
	For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
	
	


Mime
View raw message