2012/5/9 James B. Byrne <[email protected]>: > > On Wed, May 9, 2012 14:55, Maurizio Casimirri wrote: > >> >> The only case in which the generator fails to generate is when the >> state of the database is not updated respect to migrations, but no >> problem arises if we use two different models refering to same table, >> only the differences will be taken into account. Was this your >> question? > > My observation is that responsibility for the persistence layer may > lie entirely outside the scope of projects that use an ORM of any > description. Making the ORM responsible for defining the persistence > layer in this case is worse than useless; it is dangerous. > > Many projects leave database issues entirely in the hands of > specialists who have their own tools to design and implement data > structures. The current design of RoR handles this situation since it > presents migrations/DDL as a standalone and dispensable feature. Used > when needed and ignored when not. > > I believe this is as it should be. Creating a database structure has > nothing at all to do with programming access to it. Likewise, > programming access to a persistence layer is simply dependent upon > what already exists. Coupling these two separate functions will not > be a happy marriage to my mind. > > If you wish to be able to query a model to find out exactly what > attributes it considers as relevant would it not be best to simply > adopt a convention and provide a well known method name to return a > string of attributes? Then designers can add that method and populate > its return value in their models or not as they see fit. If the > convention is followed then I believe you will obtain what you desire > without affecting anything else. If the convention is not followed > then that pretty much makes the argument that any other approach to > provide the same information will not be valued as well. > > > -- > *** E-Mail is NOT a SECURE channel *** > James B. Byrne mailto:[email protected] > Harte & Lyne Limited http://www.harte-lyne.ca > 9 Brockley Drive vox: +1 905 561 1241 > Hamilton, Ontario fax: +1 905 561 0757 > Canada L8E 3C3 > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >
This is a good argument. The generator was to me a way to prove the benefits of having properties declared within models, i believed it was generally agreeable as a point of strength but obviously it is not. It also leverage on the coupling (even if weak) between ORM and persistence while I'm trying to argue to the contrary: i wish to see in ruby on rails a level of abstraction between database columns and model properties in a way that client code (eg Paperclip) can interact with different ORMs in the same way. What is your opinion about that? Regards Maurizio -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
