Hi,

I've been looking at your datamapper solution and it's been coming
along great. However I've got an issue with "value objects". (I'm
using a Domain Driven Design approach)

Basically these are objects that have no identity but allow you to
encapsulate some properties with application logic like validation,
custom methods... An example:
class Employee:
property :id,        Serial
property :name, String,  :required => true
property :employment, Period, :required => true
end

class Period:
# should act as a value object
property :start, Date,  :required => true
property :end, Date, :required => true

# specific period validation constraints like "end after start", ...
end

I think that all I need is some way to create composed properties
(that are basically a set of other properties). In ActiveRecord I
could simulate this behaviour by using composed_of in combination with
validates_associated.

I've looked at custom types, but they seem to cover only one column in
the database. Is a feature like this implemented or planned? Could I
create this behaviour with a custom plugin?

Thanks for your advice in this matter!

Peter

-- 
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.

Reply via email to