The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I think it would be very interesting to have a discussion about alternative Ruby frameworks other than Rails. Competition is the mother of evolution, and although it may be tabu for some to say it, not everyone agrees with every paradigm Rails sets.

Citing an ORM as the "killer argument for Rails" is a bit off the mark, IMHO, since nowadays pretty much any framework any respectable developer would bother to look at would neccesarily put much emphasis into its ORM layer.

Additionally, not everyone thinks ActiveRecord is the most attractive ORM solution in Ruby. Depending on your style and priorities, Object Graph may be a much more appropriate library for your needs.

As I mentioned in the other thread, the only weak point in Rails' AJAX offering is the built in view helpers for generating the first half of the AJAX link...i.e. what sits in the client...embedded javascript calls on links and forms etc...I agree this isn't great but there isn't anything stopping you from combinging the Behavior library and the Prototype library to create your own AJAX hooks in an unobstrusive way.

Rails's newest and killer feature with regards to AJAX is the RJS javascript templates which are simply a form of "view" for ajax actions that dynamically produce javascript to send back to the client. There is a great article on real-world usage of this feature (which is in Edge Rails only at the moment) here.

I'm not actually aware of any other frameworks besides Rails and Nitro at this point.

Not everyone likes ORM. I personally am very comfortable using SQL for what I need, and often use Object Databases and Native XML Databases to get the job done. ORM offers me no benifits there, as there is no 'R'.

Thats the main reason I'm looking for alternatives to rails. I'm sure lots of people find it very useful to be able to slap an app together in 10 mins or what have you, but I follow a specific process for development which works for me, and I'm hoping to merge Ruby into my methodology. Rails won't fit. I'm looking for something that will.

Either way, I don't know of anything other than separate components that might be of used to you. There is no framework that suits your rather odd (IMO) workflow that I know of, certainly not in Ruby anyway.

Let me give you one advice: try rails and talk about it later. Lots of people say "I don't like Rails because..." but they haven't tried it. How can you say that you don't like ORM? Have you tried it? Don't like "javascript outputted by the framework"? If you like to type everything, it's ok, you can.

"Ruby feels right, even if Rails doesn't." Feel before using it?

""Built-in" is really starting to get on my nerves." I am a former PHP developer, and this is what my philosophy was. Roll everything myself. Again, try it out and see how cool the "built-in" libraries are.

You don't want Rails? Fine. Just don't say it is not your thing and it doesn't feel right before trying it.

Yes. Doesn't help me much when I'm using a Native XML Database, or an Object Database, as I've mentioned before in a thread you commented on. They're not relational, so object-relational mapping doesn't work.

It doesn't help me most of the time when I'm using SQL. Consider the following MySQL query:

This is one of the simpler reporting queries I use on one of my applications. This returns a simple array. I have no need to alter this array after I've collected it from the db. Why would I want to wrap it in objects? How would I even start? For me, more often than not, ORM is a waste of time and effort.

Don't like "javascript outputted by the framework"? If you like to type everything, it's ok, you can.

I'd rather know that what is outputted is controlled by me. I'd like to know that if there's a security problem with the javascript I can just remove the file from the server and the risk is minimised. I like to know that my system isn't reliant on javascript developed by someone who I've never met, and which I have no quick and easy access to change.

Also, I've already spent time and effort on a set of javascript libraries which handle AJAX, DOM manipulation, scheduling, and other functions. I'm comfortable with using them. Why should I waste time working with code I don't know very well? I thought the whole point of OOP was to end up with maintainable, reuseable, and indepentant code?

"Ruby feels right, even if Rails doesn't." Feel before using it?

I've been through the tutorials. Don't get me wrong, I'm sure Rails is great. But just as purple is great, it doesn't go well with my orange hair.

""Built-in" is really starting to get on my nerves." I am a former PHP developer, and this is what my philosophy was. Roll everything myself. Again, try it out and see how cool the "built-in" libraries are.

Yes, they probably are great. But again, I use XSL as my templating language. I'd rather not switch back to using inline code, as I've found XSL to be a very powerful language.

You don't want Rails? Fine. Just don't say it is not your thing and it doesn't feel right before trying it.

Why the hell not? Its only my humble opinion, after all, and shouldn't we share our opinions so that others may learn? Do you think Rails would be here if one guy didn't have an opinion? Or Ruby?

And if there is no framework you like: create your own!

Already thinking about it! I'm asking the question, however, to see whether there are any others. To my mind there are about 10 main-stream PHP frameworks. Has Ruby only got 2?!

Ruby has one framework that rules all PHP frameworks if you ask me. ;-). And you may have an opinion, offcourse . The problem is that you want to stick with traditional "best practices".

XML databases are questionable and relational databases have proven to be better for most things. But if you want to use XML/object databases: you can. You don't have to use ActiveRecord.
I don't believe that you use advanced queries exclusively. If you want to use advanced queries: you can. ActiveRecord tries to take out the tedious work:

Code:

Post.create(params[:post])

instead of large SQL by hand.
And you can control all output. You can even create your own XSLT templating system. Instead of .rhtml you use .xslt (you have to plug-in an XSLT library). But Ruby is almost always more powerful than XSLT. And although it makes business logic in templates possible that doesn't mean you do that.
Have you ever met the creator of Ruby? Do you want to use Ruby? Do you want anything from someone you don't know? The fact that you haven't met someone doesn't mean his code is bad ;-).

But what should a framework that you like have? XSLT support, no ORM support, no javascript support, just plain MVC structure. It shouln't be too hard to create that. The easiest way would be using Rails and ignoring the features you don't want and implement .xslt templates. The Rails community will appreciate it if you submit it as a patch so it might be in Rails v1.1 .

I think that you would get along better with nitro over rails. Nitro has an orm and ajax stuff built in but it is much less obtrusive then rails. You can start with a nitro app that just uses the url request/mapping part of the framework and then add in framework features as you want. It even has a great pipeline xml templating system. It would be a good framework to base your work on and transform into something you want to use.

There are other frameworks as well. There is even a continuations based framework that is a ruby port of seaside called borges. Another good one is IOWA and based on that Kansas. these all have there own ways of doing things so you should investigate to see which one matches your process better. Oh and don't forget WEE another continuation style framework.

There are also other libraries that just do one part of MVC and you could pick and choose through those.

But in the end it sounds like you have very specific needs and none of these might work for you in a way you want. Rails and Nitro are the most mature web frameworks for ruby though. Ruby itself is an awesomely powerfull language. And I think part of the reason that there aren't a hundred different web frameworks like php has is that its easy enough in ruby to roll your own.

It sounds to me like you are already convinced that your custom php solution is exactly what you want already though maybe? If so then why re-invent the wheel?

I highly recommend ruby as a language to you though and I think you could easily stitch together something to satisfy your needs. i just don't think that anyt one else has the same needs as you so you will not find a prepackaged framework that does everything you want it to do. The beauty of ruby is that it is very easy to do your own thing since the source code will be readable and relatively compact compared to other languages. And that helps smaller teams or even individuals build complex things in less time.

I hope you find something you like or build something great with ruby though. Just be sure to let us know when you have finished it so we can all play with it and see the benefits your style of development has to offer.

ezmobius: Yes, I have quite specific needs. These are born of experience, and due to the methodology of project tracking I use.

Thanks for letting me know of those other frameworks. I'll enjoy looking into those. I've also started planning on an MVC framework which should solve my needs when using Ruby.

I'm quite keen to move to Ruby from PHP. While PHP is great its not as well-rounded as Ruby, and its OO model isn't as advanced. I think I've gone about as far as I can as a developer in PHP without creating my own extensions, and PECL gives me the creeps.

Someone said to me once that a good developer learns a new language every year. So, 2006, its time for Ruby. Then D. Then Haskell. Wish me luck!

I'm not a full time developer, but have been playing with php for several years. I never really succeeded in making the switch to OOP, MVC and so on. Granted I usually worked on relatively small projects where a procedural style of programming worked just fine for me.

I've read a bit about OOP, MVC and such in PHP, but to me it's just confusing. Fortunately it seems I'm not the only one who is struggling with this, even the experienced php programmers don't always seem to agree on the 'right' approach

At this point I'm very inclined to give Ruby on Rails a try. After all these years I think I'm ready to try something new, and hopefully not get stuck like I'm now with PHP OOP.

Yes. Doesn't help me much when I'm using a Native XML Database, or an Object Database, as I've mentioned before in a thread you commented on. They're not relational, so object-relational mapping doesn't work.

It doesn't help me most of the time when I'm using SQL. Consider the following MySQL query:

This is one of the simpler reporting queries I use on one of my applications. This returns a simple array. I have no need to alter this array after I've collected it from the db. Why would I want to wrap it in objects? How would I even start? For me, more often than not, ORM is a waste of time and effort.

A bit of a belated reply but I hate to have someone thinking there isn't a good solution to this.

In Rails you can create a model for a view and then query against it like you would a normal table. In Postgres you can query a view and add conditionals to it dynamically -- I don't have a clue if this works for MySQL views. For instance taking the classic recipes, categories example from http://www.onlamp.com/pub/a/onlamp/2.../20/rails.html

Let's say you wanted a view that groups each category by the number of recipes for each one.

So with Rails you start with excellent CRUD support with the ActiveRecord ORM and with views you can get around the sticky issues of complicated queries that goes along with reporting. Now admitidly I haven't done the kind of complex reporting in Rails+ActiveRecord+Postgres that I've done with Java+Ibatis+Oracle but the potential is there and it's looking good so far.

But this is a pretty messy way to organize reporting queries, especially when you are talking about multiple joins where the query can span 20+ lines.

Great thing about views is that your queries are in the database and multiple client apps(say one RoR, one PHP, one Java) can use the query to present the relevant data without every client having to write a hardcoded query like above. Maintaining the views means it's done in one place.

Keeping logic in the database is something Oracle and Postgres users have known about for years. Even though I'm not a big fan of MySQL it's good to finally see it catching up on views and SPs.

Yes, I know, but until version 5.1 it is considered experimental by many, and many clients I work with still use version 3.

Kind of a pain if you ask me, considering views are something from the stone-age, and even early versions of FoxPro know about it.
But we must work with whatever we get, and years will pass until MySQL 5 will be adopted. This is a drawback of being widely used.

At the moment I'm looking further into Ruby on its own, without a framework. Rails was developed as a solution to a problem for a particular company (37signals).

While it works for them (and lots of others) I don't feel it will suit my needs. So, following the same principles, I'm learning the ins and outs of Ruby while I think more about my problem, and hopefully a solution will be forthcoming. And once I have that solution, I'll probably release it in the hope that it will help others.