- Program to interfaces rather than to Concrete Objects.
- Favor Object Composition over class inheritance.
- Delgation can be a good addition to Composition to achieve good things from inheritance.... e.g. Composition wont have all method access which inheritance will have.. but what can be done is you can write encapsuling methods in composing class which refer to composed class' methods. this way you can achieve run time change of objects. e.g. window (being a rectangle) should have inherited from rectangle.. in stead.. it containts a referance to rectangle.. so any method that you would rather go to rectangle for imlementation would be called by Window on to internal referance of window. Also if we have defined the Rectangle as a shape.. then we can also replace rectangle ref with a circle ref at runtime..
Saturday, March 17, 2007
Friday, March 09, 2007
Struts 6 Learning points
- Struts 2 is not compatible with struts 1
- Default extension for the actions is changed from .do to .action. If we want to change the default extension for actions then we can set it like following in struts.xml file
- By default there should be one struts.xml file present in the classpath. It can include additional struts definition files in it.
- errors: we can have action errors and field errors.. field errors are associated with a particular HTML text field.. while action errors would be any general errors..
- validate="true" in form tag would allow (or invoke?) client side javascript validation so as to save few server trips.
constant name="struts.action.extension" value="do"
Subscribe to:
Comments (Atom)
