sadys.humblebee@gmail.com
12/25/2005 11:50:00 PM
Thanks, ryan. I'v joined the rails mailing list now, but I think as we going
on, this problem is
becoming more like a ruby problem,~!~
I think if there is any compile tool in ruby that is powerful enough to
check the reference to my class
and the database structure to determine if the references are valid,
or if there is any unit test automatation tool which can generate cases for
that purpose.
Code convertion is a way, but only suitable for experienced programmer.
And the defer of the attribute definition will cause some word-complete
function not work, such as
that in source insight.
And is it dangerous if I supply a library that any user can fill any
attributes into it by using method_missing? A library must be able to deal
with any misuage or malicious attack. Safety guaranteed by documentation is
not really safe.
2005/12/25, J. Ryan Sobol <ryansobol@gmail.com>:
>
>
> On Dec 25, 2005, at 8:12 AM, sadys.humblebee@gmail.com wrote:
>
> > I know, i know,:-)
> > ActiveRecord that by implementing the Object#method_missing method
> > which will be called whevever trying to access a attribute not defined
> > yet.
> > Is that right?
> > But in a big team-developing software, how can I enforce the precise
> > reference of my classes' attributes by other developers, not refering
> > to non-exist attribute? of course this will raise "column not found"
> > exception at runtime, but can we prevent it from the very beginning.
> >
> >
>
>
> Obviously every organization's coding practices differ, but I'll bet
> that your colleagues would rather have good documentation for your
> classes rather than having your classes perfectly insulated in their
> own little world, regardless if your using Rails or not.
>
> Also, the Rails philosophy is more about using conventions over
> configuration. The way Active Record handles table attributes is a
> convention that, once internalized, allows significant speed up in
> development time. If everyone in your organization understands this
> convention, there's no need to go against that grain.
>
> Again, I encourage you to talk directly with Rails community as
> they're probably better suited to answer these sorts of questions.
>
> ~ ryan ~
>
>
--
Xie Wei, A programmer
sadys.humblebee@gmail.com
13917917201