Arjen van Schie
2007-Mar-08 21:12 UTC
Ruby on Rails questions about maintenance and dsl''s
Hi, I''m trying to find answers to the following questions and maybe some of you can give me a clue or direction. Especially pointers to publications would be a pro! 1) Is rails a true DSL? I think it is, by fowlers definition i think it applies as embedded DSL in ruby, where the domain is web-applications with database backends (ie. suitable for MVC). Tough i can understand that this might be to general to apply as a real DSL 2) How well is RoR suited when it comes to maintenance? I mean sure scaffolding makes it easy to quickly build a new project, but what about changing models regenerating after modifications of the generated/scaffolded code ? Am i missing something or is it really just ''scaffold once'', but then you''re on your own ? What do you guys think ? Bye, Arjen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
James Stewart
2007-Mar-08 21:38 UTC
Re: Ruby on Rails questions about maintenance and dsl''s
On Mar 8, 2007, at 4:12 PM, Arjen van Schie wrote:> 1) Is rails a true DSL? > I think it is, by fowlers definition i think it applies as embedded > DSL in ruby, where the domain is web-applications with database > backends (ie. suitable for MVC). Tough i can understand that this > might be to general to apply as a real DSLI don''t have a strong opinion either way, but I think you''d be better off thinking about whether each component in rails provides a DSL. eg. does ActiveRecord provide a DSL for describing database tables and their relationships? does the routing system provide a DSL for describing how URLs map to code? You may well come up with different answers for different parts of rails.> 2) How well is RoR suited when it comes to maintenance? > I mean sure scaffolding makes it easy to quickly build a new project, > but what about changing models regenerating after modifications of the > generated/scaffolded code ? Am i missing something or is it really > just ''scaffold once'', but then you''re on your own ?First disclaimer -- most rails developers don''t use scaffolding, or end up replacing most scaffolded code very quickly. It''s a useful tool for learning rails or for quickly putting together a prototype, but aside from that it''s not really useful for anything but the most rudimentary apps. ActiveRecord Models get their list of column names from the database and so don''t need to be re-generated when the schema changes (but you might need to restart your app), but you may need to change some of the code you''ve added to your models depending on the change you make to your schema. Controllers and views can largely be shielded from changes to the schema based on how you set up your models, but there''s a good chance that you would need to change, say, a form if you add an extra field to a table in your database and the form represents the data in that table. Rails isn''t dynamic in the sense that a change in one place will necessarily update all dependencies, and that is a good thing. If it were trying to provide that level of integration it would become a much more restrictive environment. Instead it provides you with enough tools and enough initial structure to keep your code clean, and appropriately separated. It''s up to you to make sure that it''s then easy to make additions and changes. James. -- James Stewart Play: http://james.anthropiccollective.org Work: http://jystewart.net/process/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
bcparanj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Mar-09 03:02 UTC
Re: Ruby on Rails questions about maintenance and dsl''s
> > 1) Is rails a true DSL?Yes.> 2) How well is RoR suited when it comes to maintenance? > I mean sure scaffolding makes it easy to quickly build a new project, > but what about changing models regenerating after modifications of the > generated/scaffolded code ? Am i missing something or is it really > just ''scaffold once'', but then you''re on your own ?My opinion is don''t use scaffold to learn RoR, learn the basics and write your own code. Use scaffold only for prototype. In that case you throw away the code so the question of maintenance is mute. The main outcome of the prototype might be to clarify vague / conflicting requirements and as a level of effort estimation tool. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David Mitchell
2007-Mar-09 03:29 UTC
Re: Ruby on Rails questions about maintenance and dsl''s
I agree completely - I spent too much time thinking I could use scaffolds and turn them into something production-ready, and the big breakthrough came when I decided to just ditch them completely and do it on my own. Rails is so quick and easy to use, that relying on scaffolds is just about pointless. That said, they make for a hell of an impressive demo - when you can knock up a trivial admin interface within a few seconds, it tends to leave an impression. Regards Dave M. On 09/03/07, bcparanj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <bcparanj-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > > > 1) Is rails a true DSL? > > Yes. > > > 2) How well is RoR suited when it comes to maintenance? > > I mean sure scaffolding makes it easy to quickly build a new project, > > but what about changing models regenerating after modifications of the > > generated/scaffolded code ? Am i missing something or is it really > > just ''scaffold once'', but then you''re on your own ? > > My opinion is don''t use scaffold to learn RoR, learn the basics and > write your own code. Use scaffold only for prototype. In that case you > throw away the code so the question of maintenance is mute. The main > outcome of the prototype might be to clarify vague / conflicting > requirements and as a level of effort estimation tool. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---