This article is about Symfony in php and Struts in Java. (they are compared in the same order that Alvaro did in his article. )
compared with struts(the mvc framework in Java), i like symfony more. Because it`s easier to use and faster to implement. Maybe we would give thanks to the agile nature of PHP.
But both of them have some same features more or less:
the Factories: In struts 1, it depended on the well-form nature of java. you can extend or implement classes from the framework core classes. With struts 2, it uses the famous "Spring" lib(optionally , xwork has his own also). The concept of Ioc (inverse on control) give developers a better chance to extend and replace the logic of the original framework without changing any code. actually ioc is everywhere in struts 2 from populating request parameters to actions to getting a DAO object.
If symforny could introduce Ioc, i think it will be more attractive.
Filter Chain: 5 years ago,(struts 1 for instance), we just used filter in Java. here filter is a real filter which basically pre-excute some logic before the main one. But in struts 2, it changes the name to interceptors (interceptor chain) which do the same as "Filter chain" in symfony.
But what can be improved is : symfony should have a interface-like class (maybe abstract class) who contains 2 method : preExecute() and postExecute(), then any subclass `s logic is much clear. Since i`ve seen some bug caused by putting post-execute-logic wrongly before $filterChain->execute(); by mistake.
Configuration Cascade: very nice feature. struts should learn more from this(to improve at least).
But now grails (something like symfony,rails in Groovy running in JVM) has this. btw rails 1.2 `s performance is much better than before.
Plugin: as developer, u can make your own plugin easily for both frameworks. and the plugin repository has a lot of nice off-the-shelf plugins.
since symfony auto-load mechanism is not as robust as java`s, it will loose for performance sake.
Controller adaptability: as said before, with Ioc you can easily extend it to meet your need.
View: same as Controller. in java, you can also choose which tech you would like to render the page. like freemarker, Velocity, or the traditional JSP page. very flexible, right?
why i like symfony more:
1. it has command-line utilities which speed up development and save you from the boring configurations and machine steps.
(grails has the same functionality, so i like grails as well :))
2. symfony cooperates very well with html tags and Ajax. i have bad impress of ajax support in struts and not good experience with tags. Symfony does it really good. Especially for ajax support, the built-in is for prototype, and you can easily switch to jquery using plugin.
there is a lot to say, like the model level, performance tuning, memcache......
hope we can talk more shortly.
Source:
http://www.theserverside.com/news/thread.tss?thread_id=53885
compared with struts(the mvc framework in Java), i like symfony more. Because it`s easier to use and faster to implement. Maybe we would give thanks to the agile nature of PHP.
But both of them have some same features more or less:
the Factories: In struts 1, it depended on the well-form nature of java. you can extend or implement classes from the framework core classes. With struts 2, it uses the famous "Spring" lib(optionally , xwork has his own also). The concept of Ioc (inverse on control) give developers a better chance to extend and replace the logic of the original framework without changing any code. actually ioc is everywhere in struts 2 from populating request parameters to actions to getting a DAO object.
If symforny could introduce Ioc, i think it will be more attractive.
Filter Chain: 5 years ago,(struts 1 for instance), we just used filter in Java. here filter is a real filter which basically pre-excute some logic before the main one. But in struts 2, it changes the name to interceptors (interceptor chain) which do the same as "Filter chain" in symfony.
But what can be improved is : symfony should have a interface-like class (maybe abstract class) who contains 2 method : preExecute() and postExecute(), then any subclass `s logic is much clear. Since i`ve seen some bug caused by putting post-execute-logic wrongly before $filterChain->execute(); by mistake.
Configuration Cascade: very nice feature. struts should learn more from this(to improve at least).
But now grails (something like symfony,rails in Groovy running in JVM) has this. btw rails 1.2 `s performance is much better than before.
Plugin: as developer, u can make your own plugin easily for both frameworks. and the plugin repository has a lot of nice off-the-shelf plugins.
since symfony auto-load mechanism is not as robust as java`s, it will loose for performance sake.
Controller adaptability: as said before, with Ioc you can easily extend it to meet your need.
View: same as Controller. in java, you can also choose which tech you would like to render the page. like freemarker, Velocity, or the traditional JSP page. very flexible, right?
why i like symfony more:
1. it has command-line utilities which speed up development and save you from the boring configurations and machine steps.
(grails has the same functionality, so i like grails as well :))
2. symfony cooperates very well with html tags and Ajax. i have bad impress of ajax support in struts and not good experience with tags. Symfony does it really good. Especially for ajax support, the built-in is for prototype, and you can easily switch to jquery using plugin.
there is a lot to say, like the model level, performance tuning, memcache......
hope we can talk more shortly.
Source:
http://www.theserverside.com/news/thread.tss?thread_id=53885
Search News
News Categories
What's the News?
Post a link to something interesting from another site, or submit your own original writing for the Java community to read.
Most Popular News
-
How to stand out from other Java/JEE Professionals?
Published about 14-01-2009 | Rated +3 -
10 reasons IT certification will be important in 2009
Published about 05-01-2009 | Rated +2 -
The 9 hottest skills for `09
Published about 02-01-2009 | Rated +1 -
New Features in Servlets 3.0
Published about 05-01-2009 | Rated +4
Most Recent User Submitted News
- Sun`s Open Source Boss Slams App Engine`s Java Support
Published about 14-04-2009 | Rated 0 - NASA Adopts the NetBeans Platform
Published about 16-11-2009 | Rated 0 - mock on Threads
Submitted by ATUL | Rated +2 - JAVA and Its Advantages
Published about 06-07-2009 | Rated 0







