[image]
Ph: 0980331609
[image] [image]
[image]
[image]
[image][image][image][image][image][image][image][image][image] [image] [image] 635522 members! Sign up to stay informed. [image] [image] [image] [image]
[image]

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

[image]News News News Messages: 48 Messages: 48 Messages: 48 [image]Printer friendly Printer friendly Printer friendly [image]Post reply Post reply Post reply [image]XML XML XML [image]
[image]

Article: Building Struts 2 Apps Without XML Gluecode

Posted by: Joseph Ottinger on Tue Jan 08 07:06:56 EST 2008 DIGG
In "Building Struts 2 Apps Without XML Gluecode," Ted Husted jettisons XML for "convention over configuration," autowiring Struts 2 Actions to search-engine friendly URLs.
What's XML gluecode?

Success breeds success, and successful applications tend to grow larger and more complex over time. Most applications are so large and so complex that we can't think about the entire application at once. To get through the day, we need to focus our attention on one thing at time.

One way to simplify complex applications is to separate concerns. We group similar tasks together, so that we can focus on one element of the application at a time. Two concerns that we like to separate are presentation logic and business logic. It's easier to design presentation logic using a page template, and it's easier to design business logic using conventional source code. Each concern is easy to manage on its own, but we need a way to put the concerns back together...

Instead of wiring components together with configuration files, another strategy is to use consistent naming conventions, and then make the conventions part of the application framework. Many Struts developers already use naming conventions to track which components go together. We just need to program the framework to observe the same kind of conventions that most of us already use.

For example, if a client requests a "hello-world.action", it makes sense for the framework to look for a "HelloWorld.class" and/or a "hello-world.jsp". If the Action class returns "small" as a result code, it makes sense to first look for a "hello-world-small.jsp" (or a "hello-world-small.vm", you prefer Velocity templates). If "hello-world-small.jsp" is not found, then it would also make sense to check for a plain-old "hello-world.jsp".

Threaded replies

  ·  Welcome to Stripes by Edward Rouse on Tue Jan 08 14:12:37 EST 2008
    ·  Yep by John Newman on Tue Jan 08 14:37:22 EST 2008
    ·  Great, my framework is better than your framework redux by John Liptak on Wed Jan 09 16:34:50 EST 2008
      ·  Re: Great, my framework is better than your framework redux by Remi Vankeisbelck on Wed Jan 09 18:26:13 EST 2008
        ·  Re: Great, my framework is better than your framework redux by John Liptak on Wed Jan 09 22:40:20 EST 2008
          ·  Re: Great, my framework is better than your framework redux by Remi Vankeisbelck on Thu Jan 10 09:11:43 EST 2008
            ·  Re: Great, my framework is better than your framework redux by John Liptak on Thu Jan 10 11:24:38 EST 2008
              ·  Re: Great, my framework is better than your framework redux by Remi Vankeisbelck on Thu Jan 10 13:12:39 EST 2008
              ·  Re: Great, my framework is better than your framework redux by Tim Fennell on Thu Jan 10 13:14:33 EST 2008
      ·  Re: Great, my framework is better than your framework redux by Habiburahman Khaled on Wed Jan 23 23:30:09 EST 2008
  ·  Is this really a innovation? by Sergio Oliveira on Tue Jan 08 18:44:06 EST 2008
    ·  Re: Is this really a innovation? by Sergio Oliveira on Tue Jan 08 20:12:00 EST 2008
      ·  Re: Class scanning not practical? Oh really? by Tim Fennell on Wed Jan 09 10:46:43 EST 2008
        ·  Re: Class scanning not practical? Oh really? by Sergio Oliveira on Wed Jan 09 11:02:18 EST 2008
          ·  Re: Class scanning not practical? Oh really? by Tim Fennell on Wed Jan 09 11:09:51 EST 2008
            ·  Re: Class scanning not practical? Oh really? by Sergio Oliveira on Wed Jan 09 11:44:13 EST 2008
      ·  The real web framework by Brennan Spies on Thu Jan 10 16:53:12 EST 2008
    ·  Struts is dead... long live Stripes ! by Remi Vankeisbelck on Wed Jan 09 09:22:41 EST 2008
      ·  Re: Struts is dead... long live Stripes ! by David McCoy on Wed Jan 09 09:45:44 EST 2008
        ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 10:17:09 EST 2008
          ·  Re: Struts is dead... long live Stripes ! by Remi Vankeisbelck on Wed Jan 09 11:36:28 EST 2008
            ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 12:02:39 EST 2008
              ·  Re: Struts is dead... long live Stripes ! by Remi Vankeisbelck on Wed Jan 09 12:23:36 EST 2008
                ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 13:16:58 EST 2008
                  ·  Re: Struts is dead... long live Stripes ! by Mario Arias on Wed Jan 09 13:51:20 EST 2008
                    ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 14:01:49 EST 2008
                      ·  My last post in this thread by Mario Arias on Wed Jan 09 14:25:28 EST 2008
                  ·  Re: Struts is dead... long live Stripes ! by Jeppe Cramon on Wed Jan 09 15:27:06 EST 2008
                    ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 15:52:34 EST 2008
                      ·  Diference between community and marketing by Mario Arias on Wed Jan 09 17:03:06 EST 2008
                        ·  Re: Diference between community and marketing by Sergio Oliveira on Wed Jan 09 17:10:41 EST 2008
                    ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 16:06:49 EST 2008
                      ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 16:19:57 EST 2008
                        ·  The interesting difference by Jeppe Cramon on Wed Jan 09 19:47:23 EST 2008
                      ·  Re: Struts is dead... long live Stripes ! by Remi Vankeisbelck on Wed Jan 09 16:38:48 EST 2008
                        ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 17:01:04 EST 2008
                          ·  Re: Struts is dead... long live Stripes ! by Remi Vankeisbelck on Wed Jan 09 19:08:19 EST 2008
                            ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 19:51:46 EST 2008
                              ·  RE: The interesting difference by Sergio Oliveira on Wed Jan 09 20:14:11 EST 2008
                                ·  Re: RE: The interesting difference by Jeppe Cramon on Thu Jan 10 02:03:39 EST 2008
                            ·  oh no by John Newman on Thu Jan 10 16:20:50 EST 2008
                              ·  Re: oh no by Remi Vankeisbelck on Thu Jan 10 16:41:42 EST 2008
                              ·  Re: oh no by Sergio Oliveira on Thu Jan 10 16:41:49 EST 2008
                    ·  Re: Struts is dead... long live Stripes ! by Remi Vankeisbelck on Wed Jan 09 16:23:38 EST 2008
                      ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 16:33:39 EST 2008
                        ·  Re: Struts is dead... long live Stripes ! by Sergio Oliveira on Wed Jan 09 16:35:15 EST 2008
        ·  Re: Struts is dead... long live Stripes ! by Remi Vankeisbelck on Wed Jan 09 11:24:20 EST 2008
  ·  Re: Article: Building Struts 2 Apps Without XML Gluecode by M.Liang Liu on Wed Jan 09 07:07:22 EST 2008
[image]  Message #244792 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Welcome to Stripes

Posted by: Edward Rouse on Tue Jan 08 14:12:37 EST 2008 in response to Message #244662
Stripes has been doing this for a couple of years now. Check it out at http://stripes.mc4j.org/confluence/display/stripes/Home.

[image]  Message #244794 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Yep

Posted by: John Newman on Tue Jan 08 14:37:22 EST 2008 in response to Message #244792
Yes one of the most useful things about stripes is the classpath scanner.

I have been using it in other parts of applications to avoid configuration. Instead I just put whatever @tag I need on the class, scan for it and wire it up. You won't find a single xml file anywhere, everything is auto discovered with annotations & their attributes.

The framework auto discovering action beans is just the tip of the iceberg of what you can really do with this thing!

Now I'm sure someone is going to pop up and say annotations are bad blah blah. That's fine, they are free to think whatever they want when they get some time away from xml hell.

[image]  Message #244808 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Is this really a innovation?

Posted by: Sergio Oliveira on Tue Jan 08 18:44:06 EST 2008 in response to Message #244662
RoR is doing there since 2004. Other frameworks are doing that for some time now. Convention over Configuration is not a feature nowadays. It is a REQUIREMENT.

Mentawai provides the best of all worlds. Programmatic configuration, CoC and user-defined conventions.

For example, if the user does not configure any consequence for the action /User.add.mtw, then the convention is to forward to /User/add.jsp, no matter the action result.

You can also implement the easy ConsequenceProvider interface to design your own conventions.

Plus XML nowadays is a dinosaur. I am not talking about annotations. I am talking about programmatic configuration through Java, BeanShell, Groovy, Ruby or DSL.

http://www.mentaframework.org/

[image]  Message #244814 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Is this really a innovation?

Posted by: Sergio Oliveira on Tue Jan 08 20:12:00 EST 2008 in response to Message #244808
I forgot to mention. Automatic class scan is cool, but not pratical when you have a jar, although possible.

What Mentawai does is very simple:

registerPackage("org.myapp.action");
registerPackage("org.myapp.otheractions");

So when you do /HelloAction.mtw

it first looks for:

org.myapp.action.HelloAction

then

org.myapp.otheractions.HelloAction

This is Mentawai!

This is KISS !!!!!!!!!!!!!!!!!!!!!!!!!!!!

http://en.wikipedia.org/wiki/Kiss_principle

[image]  Message #244847 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Article: Building Struts 2 Apps Without XML Gluecode

Posted by: M.Liang Liu on Wed Jan 09 07:07:22 EST 2008 in response to Message #244662
One of my friends suggested me use UrlRewriteFilter, which is a tool just like Apache's mod_rewrite [see the following url:http://tuckey.org/urlrewrite/].I tried it for SEO concern and found it cool.

Can it, namely SmartURLs work with UrlRewriteFilter?

Thx.

[image]  Message #244855 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Struts is dead... long live Stripes !

Posted by: Remi Vankeisbelck on Wed Jan 09 09:22:41 EST 2008 in response to Message #244808
RoR is doing there since 2004. Other frameworks are doing that for some time now. Convention over Configuration is not a feature nowadays. It is a REQUIREMENT.


Yep, fully agreed. Funny to see this feature only now, in one of the oldest web framework on earth :-)


For example, if the user does not configure any consequence for the action /User.add.mtw, then the convention is to forward to /User/add.jsp, no matter the action result.


Stripes does this even without writing the action bean.

Of course, as a Stripes fan I might be bias, but it looks like Struts is lost somewhere in between the MVC and some kind of "full stack" (or "half stack" I should say) framework with complex templating stuff and weird taglibs, a crappy interception mechanism... really, it's not consistent at all.

I think Struts has probably been useful in its time, and it certainly helped to push web frameworks towards something better and better...
But hey, face it : today, it's not even part of the MVC competition any more ! Look at the other frameworks out there, they all offer more for less :-)

We still talk about Struts because there's many apps in production running on it. If it had been released in say 2005, do you think anybody would even know about it ???
Just like COBOL : do you think there would be a single COBOL coder if it was released today (excepted the guy coding the compiler of course ;-P) ?

IMHO, Struts should be EOL-ed. It should be maintained for x years, and dropped. The framework is clearly bloated with legacy heritage stuff, and just gets into you way instead of boosting your productivity. Using it on a new project looks like a weird choice to me, so maybe support should continue for people still using it... but they'll have to migrate to something else sooner or later anyway !

Stripes 1.5 will soon be released. For those who still hesitate, go and check it.
It has all Struts can offer and more (clean URLs, binding security, interceptors, Spring integration, extensible components...), but simpler, lighter, and consistent.

www.stripesframework.org

Enjoy !

Remi

[image]  Message #244856 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: David McCoy on Wed Jan 09 09:45:44 EST 2008 in response to Message #244855
Strictly speaking, I believe that Struts2 is actually Webwork, so I would hesitate to say that Stripes necessarily has everything and more.

[image]  Message #244863 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Sergio Oliveira on Wed Jan 09 10:17:09 EST 2008 in response to Message #244856
Check the "Mentawai in Action" book:

http://book.mentaframework.org/

Check what people are saying about Mentawai here:

http://forum.mentaframework.org/posts/list/143.page

Struts2 cannot even do a simple validation right! XML mixed with Java or a bunch of annotation hell. You choose!

Mentawai has ZERO annotations, ZERO XML.

Programmatic configuration is the way to go! Forget about annotation hell or xml hell.

But most important of all is the HIGH LEVEL OF ABSTRACTION. Forget about the framework salad. We don't need Spring. We need the basic functionality of Spring.

http://www.mentaframework.org

[image]  Message #244869 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Class scanning not practical? Oh really?

Posted by: Tim Fennell on Wed Jan 09 10:46:43 EST 2008 in response to Message #244814
I forgot to mention. Automatic class scan is cool, but not pratical when you have a jar, although possible.

I'm not sure what had lead you to think this, but it works extremely well. In our application at work we use the technique to scan Jars all the time, including components that are shared with other applications and teams.

In fact, it works so well we started doing the exact same thing to load all of our hibernate/JPA entities.

[image]  Message #244871 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Class scanning not practical? Oh really?

Posted by: Sergio Oliveira on Wed Jan 09 11:02:18 EST 2008 in response to Message #244869
I said it can be done, but it is a pain in the but to implement.

A more simple solution, at least for automatically loading action, is to register the packages the action can belong to.

Then you just try to load the action from the registered packages.

Pretty simple solution, isn't it? I has a tiny drawback that you have to register a couple of packages in advance.

[image]  Message #244874 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Class scanning not practical? Oh really?

Posted by: Tim Fennell on Wed Jan 09 11:09:51 EST 2008 in response to Message #244871
I said it can be done, but it is a pain in the but to implement.

A more simple solution, at least for automatically loading action, is to register the packages the action can belong to.

Then you just try to load the action from the registered packages.

Pretty simple solution, isn't it? I has a tiny drawback that you have to register a couple of packages in advance.

Isn't that the point/value of a framework though? To tackle some of the technically challenging things and bundle them up in a reusable package? From a user's standpoint class scanning is nice and if it is implemented by someone else and works, there's no problem at all.

[image]  Message #244879 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Remi Vankeisbelck on Wed Jan 09 11:24:20 EST 2008 in response to Message #244856
Strictly speaking, I believe that Struts2 is actually Webwork, so I would hesitate to say that Stripes necessarily has everything and more.


The article is about the MVC part. And stricly speaking, Stripes beats the hell out of Struts2 (or webwork or whatever the name), hands down !

And when it comes to the over bloated "stuff" that comes around their ugly MVC (e.g. templating, clean URLs and the like), well, it's even worse... There are many "full stack" frameworks out there that are way better and go way beyond that.
That's why I said it seems to be lost in between a MVC only and a full stack framework...

Cheers

Remi

[image]  Message #244881 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Remi Vankeisbelck on Wed Jan 09 11:36:28 EST 2008 in response to Message #244863
Programmatic configuration is the way to go! Forget about annotation hell or xml hell.


There's no silver bullet. Programmatic config is fine for some given problems, and sometimes other solutions are better.

And btw, even if annotations are declarative, they're part of the contract of your objects. They compile, you can reflect on them etc.

For instance, I would not want programmatic config in Stripes, because I introspect the action beans to do various things depending on what I find there... How would I do this with a full Java config ???

Here again, Stripes has the best tradeoff between the two IMHO : its usage of annotations is really concise, efficient, and elegant. That's actually a good example of how to use annotations efficiently.

Cheers

Remi

[image]  Message #244882 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Class scanning not practical? Oh really?

Posted by: Sergio Oliveira on Wed Jan 09 11:44:13 EST 2008 in response to Message #244874
I said it can be done, but it is a pain in the but to implement.

A more simple solution, at least for automatically loading action, is to register the packages the action can belong to.

Then you just try to load the action from the registered packages.

Pretty simple solution, isn't it? I has a tiny drawback that you have to register a couple of packages in advance.

Isn't that the point/value of a framework though? To tackle some of the technically challenging things and bundle them up in a reusable package? From a user's standpoint class scanning is nice and if it is implemented by someone else and works, there's no problem at all.


Yes. Registering packages is the solution that Mentawai uses for automatic action discovery. I agree that scanning the whole classpath (even jars) is better. Not sure if it is more efficient, but efficient is not the point here. The point is that both solutions work very well, with the package registration being much more simpler to implement and having a little drawback of having to register the packages that your actions will belong to. I think this drawback is very, very small, because most of the times your actions will be in just one or two packages.

[image]  Message #244888 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Sergio Oliveira on Wed Jan 09 12:02:39 EST 2008 in response to Message #244881
Programmatic configuration is the way to go! Forget about annotation hell or xml hell.


There's no silver bullet. Programmatic config is fine for some given problems, and sometimes other solutions are better.

And btw, even if annotations are declarative, they're part of the contract of your objects. They compile, you can reflect on them etc.

For instance, I would not want programmatic config in Stripes, because I introspect the action beans to do various things depending on what I find there... How would I do this with a full Java config ???

Here again, Stripes has the best tradeoff between the two IMHO : its usage of annotations is really concise, efficient, and elegant. That's actually a good example of how to use annotations efficiently.

Cheers

Remi


Stripes does not want PROGRAMMATIC CONFIGURATION because it would become very similar to Mentawai.

Mentawai does not want ANNOTATIONS because it would become very similar to Stripes and possibly to some other annotation-based frameworks out there.

I think Stripes is a great framework !!! Very similar to Mentawai in its philosophy.

I particular do not like annotations and prefer much more programmatic configuration. You can check my reasons here:

http://book.mentaframework.org/posts/list/5.page

[image]  Message #244896 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Remi Vankeisbelck on Wed Jan 09 12:23:36 EST 2008 in response to Message #244888
Stripes does not want PROGRAMMATIC CONFIGURATION because it would become very similar to Mentawai.

Well, you can actually do everything by code in Stripes (write your action resolver that registers your actions in pure java, write your validation methods in pure java, etc.).

It's just that in practice, annotations just shine. Why would we write 10 LOCs when a simple annotation does more (meta data) ?

Mentawai does not want ANNOTATIONS because it would become very similar to Stripes and possibly to some other annotation-based frameworks out there.


Well, the big strenght of Stripes is the whole package. It's a collection of simple but very efficient ideas that, all together, form a consistent whole, and really leverages your productivity.

Also, Stripes implements the same concepts every MVC does. It *is* very similar to Struts. It's just implemented in a much more simple and clean fashion.


I think Stripes is a great framework !!! Very similar to Mentawai in its philosophy. I particular do not like annotations and prefer much more programmatic configuration. You can check my reasons here:

http://book.mentaframework.org/posts/list/5.page


Precisely. I find your example much more complex than its Stripes equivalent ! You need 3 classes to do stuff that's done in a dead simple action... or am I missing something ?

Cheers

Remi

[image]  Message #244906 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Sergio Oliveira on Wed Jan 09 13:16:58 EST 2008 in response to Message #244896

Precisely. I find your example much more complex than its Stripes equivalent ! You need 3 classes to do stuff that's done in a dead simple action... or am I missing something ?


Which example are you talking about?

You don't need three classes. You need as much as ONE class: the action or the POJO that will handle the request.

In Mentawai you place all configuration, all setup, all wiring, all ioc, etc. inside the ApplicationManager.java file. Instead of having a centralized XML file like struts, it has a centralized PROGRAMMATIC file in Java. Could be BeanShell, Ruby, Groovy, etc.

In Stripes you will scatter all the configuration across all the code across a bunch of annotations. Serious, not the worst thing, but I would rather organize this, keep my code decoupled from the framework being used and centralized in the ApplicationManager.java class.

Note that any change in an annotation in an action will probably force a full re-deploy of the application JAR/WAR. If you have a separate class for the configuration, then you only need to re-deploy that class. The class can even access some dummy properties for stuff like DB URL Connection, contact emails, and that more static configuration info.

The configuration part is important. Some innocent people believe that you can code a serious web project all based on conventions. This is so not true. It is also very limiting. At some point you will have to get your hands dirty and CONFIGURE, SETUP, AUTO-WIRE, etc.

However this is not even the most important topic when it comes to web frameworks. XML x Annotations x Java x DSL is not the most important thing.

The most important thing is: ABSTRACTION. Don't make me thing about anything and don't direct me to other frameworks. Let's avoid the Java Framework Salad.

A single framework for all your needs !!! That's the goal of Mentawai (and also of RoR). It is just not competing with Hibernate, although it offers a simple CRUD ORM solution for those who are using pure JDBC and would take some help in building SQL queries. Hibernate as much as Spring is NOT something that you go learn quickly and come back.

Take for example SPRING. Mentawai offers all you need to do IOC and AutoWiring. This is not rocket science and there are many other frameworks out there that do that: Guice, Pico, etc.

Instead of telling our users: "Hey, go here and learn Spring, then come back!" we offer them a very easy, efficient and straightforward solution for IOC and auto-wiring.

http://www.mentaframework.org/ioc.jsp

http://www.mentaframework.org/depinj.jsp

[image]  Message #244910 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Mario Arias on Wed Jan 09 13:51:20 EST 2008 in response to Message #244906

Precisely. I find your example much more complex than its Stripes equivalent ! You need 3 classes to do stuff that's done in a dead simple action... or am I missing something ?


Which example are you talking about?

You don't need three classes. You need as much as ONE class: the action or the POJO that will handle the request.

In Mentawai you place all configuration, all setup, all wiring, all ioc, etc. inside the ApplicationManager.java file. Instead of having a centralized XML file like struts, it has a centralized PROGRAMMATIC file in Java. Could be BeanShell, Ruby, Groovy, etc.

In Stripes you will scatter all the configuration across all the code across a bunch of annotations. Serious, not the worst thing, but I would rather organize this, keep my code decoupled from the framework being used and centralized in the ApplicationManager.java class.

Note that any change in an annotation in an action will probably force a full re-deploy of the application JAR/WAR. If you have a separate class for the configuration, then you only need to re-deploy that class. The class can even access some dummy properties for stuff like DB URL Connection, contact emails, and that more static configuration info.

The configuration part is important. Some innocent people believe that you can code a serious web project all based on conventions. This is so not true. It is also very limiting. At some point you will have to get your hands dirty and CONFIGURE, SETUP, AUTO-WIRE, etc.

However this is not even the most important topic when it comes to web frameworks. XML x Annotations x Java x DSL is not the most important thing.

The most important thing is: ABSTRACTION. Don't make me thing about anything and don't direct me to other frameworks. Let's avoid the Java Framework Salad.

A single framework for all your needs !!! That's the goal of Mentawai (and also of RoR). It is just not competing with Hibernate, although it offers a simple CRUD ORM solution for those who are using pure JDBC and would take some help in building SQL queries. Hibernate as much as Spring is NOT something that you go learn quickly and come back.

Take for example SPRING. Mentawai offers all you need to do IOC and AutoWiring. This is not rocket science and there are many other frameworks out there that do that: Guice, Pico, etc.

Instead of telling our users: "Hey, go here and learn Spring, then come back!" we offer them a very easy, efficient and straightforward solution for IOC and auto-wiring.

http://www.mentaframework.org/ioc.jsp

http://www.mentaframework.org/depinj.jsp


The vast majority of Stripes users already know Spring...

So, Was the problem?

Trying to learn another IoC approach can be a pain in the ass.

Another point: Stripes Community already developed plugins for IntelliJ and NetBeans Integration (for an unknow reason anyone developed a Eclipse plugin yet) so you can develop a Stripes Application very quick and easy.

Mentawai have IDE integration?

[image]  Message #244915 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Sergio Oliveira on Wed Jan 09 14:01:49 EST 2008 in response to Message #244910
It has a netbeans plugin. Somebody was doing an eclipse plugin. Not IntelliJ yet.

But coming back to the main topic... :-)

No!!!!! Learning a new IoC approach is not a pain in the butt. It should be as painful as it is to learn a KISS framework like Mentawai or Stripes. In other words this is easy stuff that any Java baby can grasp. If you checked those links you saw that this is very simple stuff.

IMHO, you should not assume or require that Stripes users will know Spring. How about authentication? You tell them to go use JAAS? How about senting email? You tell them to go use Jakarta Commons? How about connection pooling? You tell them to go learn C3P0?

This is the point of Mentawai. If offers all this stuff in a very simple way and for free. No need for Java Framework Salad anymore... :-)

[image]  Message #244918 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

My last post in this thread

Posted by: Mario Arias on Wed Jan 09 14:25:28 EST 2008 in response to Message #244915
A contradiction?

No!!!!! Learning a new IoC approach is not a pain in the butt. It should be as painful as it is to learn a KISS framework like Mentawai or Stripes. In other words this is easy stuff that any Java baby can grasp. If you checked those links you saw that this is very simple stuff.


few post before....

A single framework for all your needs !!! That's the goal of Mentawai (and also of RoR). It is just not competing with Hibernate, although it offers a simple CRUD ORM solution for those who are using pure JDBC and would take some help in building SQL queries. Hibernate as much as Spring is NOT something that you go learn quickly and come back.


By the way...

Is KISS (great band, but I like more Narnia) writing another IoC/Security/ORM approach/library just for not make a Framework Salad (Salads are healthy)?

or

Is KISS using that already as proven, works great, have excellent support tool (IDE's, libraries, other frameworks), have zillions and zillions of documentation (blogs, forums, mailing list) and, the most important of all, armies of developers with experience??

I never work with Mentawai, so I can't say if is great or not, but I don't want to learn a new IoC/ORM/ approach.

I already past the last year playing with Spring and his friends so if I want to examine some library or framework one of the things that I evaluate is "how well is integrated with Spring?". I don't want to Thrown away my experience with Spring.

Sorry if I offend somebody, but I think that this Thread is something like "Mentawai Flame marketing Thread"

[image]  Message #244920 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Jeppe Cramon on Wed Jan 09 15:27:06 EST 2008 in response to Message #244906
Centralized configuration can be good for smaller projects, but as your project grows you will have to think up a way to split the configuration or you will have many people fighting over the same Class/configuration-file as in good old Struts days before sub apps.

That said, I personally see limited value in having this kind of configuration centralized. I've done big (and painful) projects with Struts and a big project (around 350 ActionBeans with multiple event handlers) with Stripes, and have so far not missed being able to see all Actions and their result handling in one place.
If you miss seeing the big picture, Stripes does provide a Site Structure Tool.

It really blows my mind that many frameworks still use String identifiers (and later mapping) to indicate the outcome of an action. For what sake?
You loose so much expressive power, when you can only return a String. What if I want to stream JSON back, stream an Image, XML or use some other view technology than JSP. Stripes approach by returning a Resolution instance (such as ForwardResolution, RedirectResolution, StreamingResolution, JavascriptResolution, etc.) works really effectively, expressively, easily extensible and is flexible.

Regarding classpath scanning. It works really well and is fairly easy to implement (Stripes, Spring and Hibernate are all capable of doing it) and works well with Jars.
We use it for a lot of stuff.

Just to clear up what seems to be a misunderstanding. By default Stripes doesn't look for annotations when searching for ActionBeans, it instead looks for classes which implement the ActionBean interface.

However, I do see some value in providing more features (like ORM, DI, etc.) without having to learn extra frameworks, but that's not the focus of Stripes.
Stripes' focuses on creating the best Action based MVC framework for Java and so far it's looking good.
Let other it leaves for frameworks such as Stripernate or our upcoming framework.

/Jeppe

[image]  Message #244924 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Sergio Oliveira on Wed Jan 09 15:52:34 EST 2008 in response to Message #244920
There is no contradiction. Mentawai offers you IOC and Auto-wiring, the same way Spring offers you that, Guice offers you that, Pico offers you that, etc.

What I was saying is that we don't offer full stack ORM support, so if you have to learn another framework besides Mentawai, I would recomment Hibernate. Or you can just do like me: use pure JDBC + SQL + an sql builder like MentaBeans (that comes with Mentawai) or something else.


I already past the last year playing with Spring and his friends so if I want to examine some library or framework one of the things that I evaluate is "how well is integrated with Spring?". I don't want to Thrown away my experience with Spring.


Mentawai has full integration with Spring for people like you, that loves Spring or have spent time learning it: http://www.mentaframework.org/spring.jsp


Sorry if I offend somebody, but I think that this Thread is something like "Mentawai Flame marketing Thread"


You did not say the same thing about the Stripes posts, right? I am presenting arguments. Feel free to present yours.

[image]  Message #244925 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Sergio Oliveira on Wed Jan 09 16:06:49 EST 2008 in response to Message #244920
Centralized configuration can be good for smaller projects, but as your project grows you will have to think up a way to split the configuration or you will have many people fighting over the same Class/configuration-file as in good old Struts days before sub apps.


Mentawai offers you a simple way to break up the ApplicationManager into multiple files. This is call MultiApplicationManager. Plus this is not XML or Annotation. This is POWERFUL and FLEXIBLE code. That's why it is called PROGRAMMATIC CONFIGURATION. You are free to do whatever you want to do with it. Create block, loops, if, methods, inheritance, you name it... Total flexibility!


It really blows my mind that many frameworks still use String identifiers (and later mapping) to indicate the outcome of an action. For what sake? You loose so much expressive power, when you can only return a String. What if I want to stream JSON back, stream an Image, XML or use some other view technology than JSP. Stripes approach by returning a Resolution instance (such as ForwardResolution, RedirectResolution, StreamingResolution, JavascriptResolution, etc.) works really effectively, expressively, easily extensible and is flexible.


You missed something here. An action returns a STRING which Mentawai calls RESULT. For each result you can have a different CONSEQUENCE. And you can be damn sure that we have a StreamConsequence, Forward, Redirect, Chain, AjaxConsequence, JasperConsequence, etc. Mentawai has easy integration with Velocity as well... A forward can be to any file, not just to a JSP page, right?


Regarding classpath scanning. It works really well and is fairly easy to implement (Stripes, Spring and Hibernate are all capable of doing it) and works well with Jars.
We use it for a lot of stuff.

Just to clear up what seems to be a misunderstanding. By default Stripes doesn't look for annotations when searching for ActionBeans, it instead looks for classes which implement the ActionBean interface.


Agree. Scan the whole classpath looking for actions is a way of doing it. I prefer registering the packages where my actions will be and let the controller look and load them in the request-time instead of scanning everything before hand. If you add something new it will have to re-scan everything.


However, I do see some value in providing more features (like ORM, DI, etc.) without having to learn extra frameworks, but that's not the focus of Stripes.
Stripes' focuses on creating the best Action based MVC framework for Java and so far it's looking good.


RoR is doing this. Many people complain about the Java Salad. For newcomers (new people with Java and web development) it is definitely not good.

The focus of Stripes is to be the best Action based MVC framework for Java. I agree it is doing a good job. I seriously like Stripes.

The focus of Mentawai is to be a very good Action based MVC framework focused totally in SIMPLICITY, JOY and PRODUCTIVITY.

With Mentawai, you just get the work done, very fast, with joy and simplicity. Period. :-) You don't need to go learn a bunch of other frameworks. It offers you all the solutions to the repetitive tasks of every web project!

How does stripes handle Authorization, Authentication, Sending Email, Connection Pooling, etc? You can just say that: "this is not the focus of stripes" and you will be right! But you must agree that this is basic stuff of every web project!

[image]  Message #244927 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Sergio Oliveira on Wed Jan 09 16:19:57 EST 2008 in response to Message #244925
Stripes does this inside its actions:

return new ForwardResolution("/quickstart/index.jsp");

IMHO this is not good. Not the end of the world but definitely not good.

Why you hard code the view layer inside your action ???

How easy it is for you to have the same action having two different views ???

For example: One view for testing, one view for production, another view for something else, etc.

With Mentawai (and even Struts) you have a total separation of concerns. Isn't that what MVC is about?

That's the advantage or returning a RESULT/STRING that will be mapped somewhere else (CENTRALIZED configuration) to the real consequence.

Again this does not make Stripes bad or good. This is just minor details. The big picture, the philosophy of Stripes is very good. That is what matters I think.

[image]  Message #244928 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: Remi Vankeisbelck on Wed Jan 09 16:23:38 EST 2008 in response to Message #244920
It really blows my mind that many frameworks still use String identifiers (and later mapping) to indicate the outcome of an action.


Yeah ! Especially when the framework's devs. do the "abstraction level" talk !
:-)

Anyway.

Cheers

Remi

[image]  Message #244932 [image]Post reply Post reply Post reply [image]Go to top Go to top Go to top [image]
[image]

Re: Struts is dead... long live Stripes !

Posted by: