[Home]PluralizationMapping

ElvisBrain | RecentChanges | Preferences | FanClub? | Edit | Login

Pluralization Mapping

Based on inflection of English nouns. Methods for transforming a string (representing an english word) between it's singular and plural forms. It's a little weird perhaps, but potentially could be a powerful tool, the main question is where to use it.

Examples

Basic implementation (Java 1.4):

Notes and Considerations

Idiomatic collection patterns (eg: a singular 'Page' will always map to a collection 'Pages', or a 'Notes' collection will always be a set of 'Note' objects). But developers shouldn't have to specifically code or configure each variant, so no need to explicitly link classes together (eg: mapping code should "know" that 'Page' is a singular instance of 'Pages').

Associations - two ways of looking at them? The 'degrees' or precise structure, in which classes are connected (eg: 0..1... 1...*), OR predicates for joining entities in a model (eg: belongs_to, has_many, is_a)... Are these two views really just the same thing? Question is how closely predicates actually map to the underlying program. Is it just a convenient shorthand for modelling, or actually directly implemented in the programming language.

Use of the Inflector.singularize()/Inflector?.pluralize() method pair obviously has a great deal of utility for code generation. But what is the potential for the inflector to be used at run-time, combined with dynamic reflection?

Questions

What are the arguments against pluralization?

What is the relationship of PluralizationMapping to Reversibility?

Further Reading


ElvisBrain | RecentChanges | Preferences | FanClub? | Edit | Login
Edit text of this page | View other revisions
Last edited January 12, 2006 8:50 am by 100.red-81-36-239.dynamicip.rima-tde.net (diff)
Search:

Incoming links: ORM Reversibility PluralizationMapping Maetl/ResearchNotes

PDF Version