fukamachi / integral

[OBSOLETE] Use Mito instead.
https://github.com/fukamachi/mito
BSD 3-Clause "New" or "Revised" License
54 stars 3 forks source link

add satisfies option to column #31

Closed rudolph-miller closed 9 years ago

rudolph-miller commented 9 years ago

made slot to be able to take funcallable object with :satisfies option. You can check valid or not with valid-p method.

rudolph-miller commented 9 years ago

30 @pocket7878

With this feature, you can check valid or not like

(defmethod insert-dao :around ((object <dao-class>))
  (if (valid-p object) (call-next-method) nil))
pocket7878 commented 9 years ago

@Rudolph-Miller Wow! This looks so nice. But why not call validate-p by default?

rudolph-miller commented 9 years ago

Validator can return nil and also can raise error with invalid value. When people set validator to raise error as :satisfies, with implicitly calling valid-p in insert-dao, update-dao or select-dao, it'll be hard to handle condition. With explicitly calling, people can handle condition easily and it's simple. WHEN and WHERE validation should be called depends on user.

pocket7878 commented 9 years ago

Thank you for your reply! I understand.

fukamachi commented 9 years ago

Thanks for the great feature! :+1: :sparkles: