SitePoint Sponsor |
|
User Tag List
Results 1 to 23 of 23
Thread: Rails... Nitro... Any others?
-
Dec 13, 2005, 19:02 #1
- Join Date
- Jan 2004
- Location
- Manchester
- Posts
- 32
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Rails... Nitro... Any others?
Hi all
Once again I'm going through the tutorials for RoR... and once again I'm starting to think that Rails isn't for me. Javascript being output from the framework in my mind is just wrong.
I've decided that learning Ruby, however, is something I must do. Ruby feels right, even if Rails doesn't.
I've started to look at Nitro, though two things strike me straight away: built-in AJAX, and ORM. "Built-in" is really starting to get on my nerves.
So, are there any other frameworks for Ruby which are lightweight and don't include ORM and/or AJAX?
I'm looking for something nice and clean, which just abstracts the page controller/model/views for me, which I can extend and use how I want, with no "great features" fudging things up.
Please, please don't go on about how great Rails is in this post. I'm looking for alternatives, not my_life_story_in_ror_v1_0.
-
Dec 13, 2005, 19:33 #2
- Join Date
- Nov 2004
- Location
- Romania
- Posts
- 848
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If AJAX is built-in, it does not mean you have to use it.
If Rails has some features that generate Javascript, does not mean you cannot avoid it.
The ORM is the killer argument for Rails.
But if an ORM is available, that does not mean you have to use it.
You are ignorant and arrogant btw.
-
Dec 14, 2005, 00:01 #3
- Join Date
- Sep 2003
- Location
- Wixom, Michigan
- Posts
- 591
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.Garcia
-
Dec 14, 2005, 02:16 #4
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.
-
Dec 14, 2005, 04:20 #5
- Join Date
- Jan 2004
- Location
- Manchester
- Posts
- 32
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
As stated, I wanted to keep the "Rails rox" messages to a minimum.
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.
-
Dec 14, 2005, 06:19 #6
Rails isn't about "slapping an app together in 10 minutes".
Have you looked at ObjectGraph?
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.
-
Dec 14, 2005, 11:06 #7
- Join Date
- Aug 2005
- Posts
- 986
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
And if there is no framework you like: create your own!
-
Dec 14, 2005, 13:28 #8
- Join Date
- Jan 2004
- Location
- Manchester
- Posts
- 32
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Fenrir2
It doesn't help me most of the time when I'm using SQL. Consider the following MySQL query:Code:SELECT f.name, e.id, e.parent, e.child, COUNT(a.orders_id) AS sales, a.referer, SUM(b.totalnet + b.totalvat) AS paid FROM roi_sales a LEFT JOIN orderdetails b ON b.orders_id = a.orders_id LEFT JOIN inventories c ON c.id = b.inventories_id LEFT JOIN products d ON d.id = c.products_id LEFT JOIN productfamily e ON e.id = d.productfamily_id LEFT OUTER JOIN roi f ON a.roi = f.id LEFT JOIN orders g ON g.id = a.orders_id WHERE g.date LIKE "{$reportmonth}%" AND g.state = 1 AND b.reltype != 0 GROUP BY f.name, e.id ORDER BY f.name, e.id
Don't like "javascript outputted by the framework"? If you like to type everything, it's ok, you can.
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?
""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.
And if there is no framework you like: create your own!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?!
-
Dec 14, 2005, 13:54 #9
- Join Date
- Aug 2005
- Posts
- 986
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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])
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.
-
Dec 14, 2005, 22:04 #10
- Join Date
- Nov 2004
- Location
- Yakima WA.
- Posts
- 100
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
neobuddah-
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.
Cheers-
-Ezra
-
Dec 15, 2005, 02:31 #11
- Join Date
- Jan 2004
- Location
- Manchester
- Posts
- 32
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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!
-
Dec 15, 2005, 15:40 #12
- Join Date
- Nov 2004
- Location
- Yakima WA.
- Posts
- 100
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Welcome to the ruby club. You chose the red pill. You won't regret it.
-
Dec 15, 2005, 17:47 #13
- Join Date
- Feb 2001
- Location
- The Netherlands
- Posts
- 256
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Dec 16, 2005, 02:31 #14
- Join Date
- Jan 2004
- Location
- Manchester
- Posts
- 32
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Rails is probably perfect for you then, jamesbond. It helps you do OOP without getting hung up on patterns, proceedures, and problem domains.
-
Dec 17, 2005, 07:36 #15
- Join Date
- Nov 2001
- Location
- Bath, UK
- Posts
- 2,498
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by neobuddah
DouglasHello World
-
Dec 17, 2005, 10:34 #16
- Join Date
- Jan 2004
- Location
- Manchester
- Posts
- 32
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Web apps mainly, but any generic framework would probably do.
-
Dec 21, 2005, 11:07 #17
- Join Date
- Nov 2004
- Location
- Yakima WA.
- Posts
- 100
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
neobuddah-
The author of Nitro has released some great screen casts that show off some of the power of nitro. Its really quite a bit more flexible then rails and you might enjoy it. Have a gander here:
http://www.nitrohq.com/view/Videos
-Ezra
-
Feb 1, 2006, 13:11 #18
- Join Date
- Jul 2003
- Location
- Los Angeles
- Posts
- 199
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by neobuddah
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.
Code:create or replace view totals as select c.name, count(r.id) as count from recipes r inner join categories c on (r.category_id = c.id) group by r.category_id, c.name;
select * from totals;
select * from totals where name='deserts';
# even cooler, dynamic having
select * from totals group by totals.count, totals.name having(count > 1);
In Rails you can create a model for the view code:
ruby script/generate model Total
In your controller:
Code:def some_action @totals = Total.find(:all) end def some_other_action @totals = Total.find(:all, :conditions => "name = :name") end
Code:Totals: <br /> <% for cat in @totals %> Category: <%= cat.name %> Count: <%= cat.count %> </br /> <% end %>
Last edited by kuato; Feb 1, 2006 at 13:46.
-
Feb 1, 2006, 13:55 #19
- Join Date
- Nov 2004
- Location
- Romania
- Posts
- 848
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Kind of an old thread to post to kuato.
But anyway, what if a rdbms with no view support is used ? Like, say ... MySQL ?
-
Feb 1, 2006, 13:58 #20
Originally Posted by bonefry
http://dev.mysql.com/doc/refman/5.0/...iff-views.html
My host (dreamhost) is at version 5.0.18
-
Feb 1, 2006, 14:16 #21
- Join Date
- Jul 2003
- Location
- Los Angeles
- Posts
- 199
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by bonefry
But anyway, what if a rdbms with no view support is used ? Like, say ... MySQL ?
totals = Recipe.find_by_sql("
SELECT c.name, count(r.id) AS count
FROM recipes r
JOIN categories c ON r.category_id = c.id
GROUP BY r.category_id, c.name")
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.
-
Feb 1, 2006, 14:53 #22
- Join Date
- Nov 2004
- Location
- Romania
- Posts
- 848
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by vgarcia
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.
-
Feb 2, 2006, 04:45 #23
- Join Date
- Jan 2004
- Location
- Manchester
- Posts
- 32
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks kuato. I'll look into that.
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.
Bookmarks