Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Best Practices in Development  RSS feed

 
Luis Felipe Bacca Arango
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I usually create web applications using jsp, servlets, and java beans, actually i am studing ejb to extends my applications.
My questions is how struts improve my development process and how do i use to make a best practice with this.
Thanks all for your help.
 
Faisal Khan
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Luis Felipe Bacca Arango:
Hi, I usually create web applications using jsp, servlets, and java beans, actually i am studing ejb to extends my applications.
My questions is how struts improve my development process and how do i use to make a best practice with this.
Thanks all for your help.

Hi Lui,
I am not sure what kind of applications you tend to develop but the Struts framework assists in developing a model 2 MVC application where Struts acts as the controller for the application.
I have written my own controllers for fairly small applications and I know it becomes a pain to develop these. Struts allows you to configure your application flow using XML configuration files.
There are many other excellent features that come along with Struts such as declarative validation, additional exception handling to that of your business logic, use of tiles and much more.
HTH
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Luis,
Basically, when I first came acorss with JSPs and Servlets, there was not much resources on it. In old days, we usually put all codes inside a JSP or Servlet, which performs all logic for us.
For example, if a page that requires authentication for access is accessing by an unknown user, the JSP probably check whether the user is login, if not, it will redirect the user to, say, an login error page.
Thus, all logic are resided in a single JSP, which is not good for maintenance.
Then, after the invention of MVC, we have a JSP that for displaying data only, all logic are controlled by Servlets. However, this is not good enough as when logic changes, we need to modify the code as well.
Now, using Structs, we can have our own ActionForm, which contains the whole workflow, so that we dont need to hard code the workflow inside the Servlets or JSPs, and changing the flow just requires to change the XML-based Structs config. file. This makes our life become easier.
Nick.
 
vasu maj
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good explanation Nick.
Vasu
Do you do anything else other than preparing for certifications?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vasu,
I am now working in a company that always keeping me up to the latest technologies. Whenever there are new technologies, where they have certification exams, my company will send me to the training courses, and get certified.
In addition, I am a part time research student, and my research area is Computer and Information Security.
Nick.
 
Norma Caballero
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, at the previous project I was working in we developed Model 2 MVC applications. Now, I joined a team using Struts and I was amazed at how it speeds up the development process.
Having the struts-config.xml eases things a lot. Also, on the JSPs, using the tags makes everything much easier and code looks a lot cleaner. I also like that you dont have to worry about controllers, handlers, dispatchers and such and that you forget mostly about setting and getting parameters directly from the request. You can focus on the business model.
It makes passing information much easier, because you know that the formbean has all the information you need.
On a very big application I was working on, we managed and used the Request object directly and it was very confusing, because we were a development team of 8, and sometimes I thought I was retrieving a parameter from the request, when I actually was retrieving a parameter that someone else had inserted.
If you have a good understanding of MVC, using Struts will not be hard.
Good luck!!!
Norma Caballero
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!