Naming convention for struts application
- In a single struts app we can have multiple form pages, multiple form beans class, multiple ActionClasses and multiple result pages.
- For example:
- Register. jsp--- form page name
- Registerform--- form beans class name
- Registeraction --- action class name
- If resource names of struts app are designs based on naming convention then the resource name will become self descriptive
- Struts s/w is created based on java, servlet, jsp and other java technologies.
- To use this technologies effectively the resource s/w creator have used set of design pattern
- These are called implicit or built in design pattern of struts s/w
- Some important design pattern are
- Mvc- whole framework s/w
- Singleton java class- ActionServlet
- Formbean-value object/data transfer object
- Front controller- ActionServlet
- Dependency injection or inversion of control- whole framework s/w
- All these design pattern implementation related understanding helps the programmers to understand struts architecture more thoroughly
- Singleton java class:
- The .java class that allows to create only one object per jvm is called singleton java class
- Instead of creating multiple objects of java class having same data it is recommended to create only one object for the class and use that object for multiple number of times
- Most of the jdbc driver classes are designed as singleton java classes. So that when multiple app of a project use some jdbc driver class the driver class object will be created only once and it will be utilized for multiple time . so by this we can minimize memory wastage
- In struts app ActionServlet is singleton java class
- By default every normal servlet is single instance and multiple threads component and we need to make normal servlet as singleton java class
- When multiple requests are given to a normal servlet then server creates only one object of the class and starts multiple threads on it representing multiple requests. This is called single instance multiple thread behaviors







