=begin semi-counter rant dry-ness to me is the ability to express a concept which is common between various parts via a single point, in some cases that means a constant, in many other its does not
i agree its not about minimizing keystrokes, i agree it is about maintaining clarity of code and improving the concesity of conceptual expression =end On Jan 15, 7:18 pm, Sam Smoot <[email protected]> wrote: > On Jan 14, 4:54 am, heda <[email protected]> wrote: > > > i've already got a project where I could use atleast two blocks of > > default options in more than one model. it would certainly make them > > arrid extra-DRY! > > Just to butt-in. ;-) > > Nothing to do with DRY. In practical terms, DRY basically means "use > constants". So instead of using a Literal to set a tax-rate in a dozen > places in your app, you set a constant, and use that. > > You might bend these default options to imply DRY-ness if the DRY- > ability were based on the Type of the Property instead of the Class > the property was declared in. But then you could just create a quick > custom type to set a few default options and forgo the load/dump > declarations. Exactly like the Text type. > > Sorry, pet-peeve of mine, but DRY has nothing to do with how much > you're typing, or whether you're copying-and-pasting and everything to > do with Domain knowledge. If two different String properties that just > happen to share :nullable => false can't reasonably be framed as > representing the same knowledge, then eliminating the duplication in > typing isn't an example of DRYness, it's an example of minimizing > keystrokes, which is often at odds with readability and counter to the > goal of DRY which is simply to excise fragility and lower the risk and > effort required to accommodate change. > > /end rant. ;-) > > -Sam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" 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/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
