Are there any potential disadvantages in using a Ruby framework other than Rails?
Asked Answered
R

6

6

I would like to use a lighter framework than Rails (Sinatra/Ramaze/Camping) but am concerned that by doing so I will not be able to use a lot of shared libraries that have been tailored to Rails in the form of plugins. Is this a major concern or are most of these plugins usable across different Ruby frameworks?

Are there any other potential disadvantages in using a Ruby framework other than Rails?

Rident answered 3/5, 2009 at 8:24 Comment(0)
C
9

You can still use gems in all of the frameworks you mentioned, so a ton of stuff is reusable. Want to swap in a new ORM, no problems. Want a fancy shmacy syntax highlighting, no problems. Rails has been making a huge push to move away from the old plugin model to use gems exclusively.

If one of the other frameworks fits your needs better use it. Keep in mind that when it comes to documentation and samples rails has more.

If I was learning Ruby and wanted to try out a web framework I would probably go with Rails not because its better, but because its got much better tooling and documentation.

Charland answered 3/5, 2009 at 8:39 Comment(1)
+1 A lot of rails plugins can also be refactored as gems with almost no effort. They were released as plugins just because that was convenient for the original author.Dumpling
S
1

Most Ruby modules used by Rails (even ActiveRecord) can be used without Rails. But then you lose the extra benefit of integration provided by Rails. You may have to work extra hard to glue Ruby modules to the framework of your choice. Please also note that most of the documentation about Ruby modules used by Rails tells you only how to use that module with Rails.

Seniority answered 3/5, 2009 at 9:5 Comment(0)
M
1

Network effects play a bit of a role.

Manualmanubrium answered 4/5, 2009 at 4:45 Comment(0)
A
1

One issue that comes up when you use other frameworks like sinatra, camping, etc is that rails gives you a proven structure for your files in the your application. Smaller frameworks are quite open and free.

This can be a downside when you are working with multiple developers as you need to have conversations about creating conventions rather then simply following them.

Arne answered 4/5, 2009 at 7:11 Comment(0)
S
1

If you've been using Ruby for less than a year, stick to Rails, unless you have a very clear need that is better handled by one of the other frameworks.

The lighter frameworks, most notably Sinatra, tend to be popular with people who know exactly what they will need and can't afford to have any additional overhead from unused code. Essentially, you pick your toolchain, instead of generally being stuck with what Rails gives you. (Yes, in Rails, you can replace ActiveRecord, et al. with other libraries, but it's not exactly easy.) So the lighter frameworks give you significantly more freedom, but you also have quite a bit more work to do in many cases.

Spotlight answered 4/5, 2009 at 20:12 Comment(0)
O
0

I think no rails plugin is going to work out of the box with any of the alternative frameworks, except for ActiveRecord plugins (such as acts_as_nested_set etc.) which are still going to need some plumbing work (setting $LOAD_PATH and requiring right files). I'd recommend DataMapper for ORM, not only it's way faster than ActiveRecord, but it's also very modularly built and plugins are actual gems that you can easily install. In difference, ActiveRecord plugins are mostly monkey-patches that tend to break with every new version.

Sinatra doesn't come with any "goodies", no Rakefiles, no skeletons, no script/generate, but actually that's what it's been written for. You can gradually "plumb in" all the extra stuff. There are also skeletons for sinatra apps that come with some basic layout and defaults, you may find these useful.

Ostracize answered 4/5, 2009 at 0:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.