Perhaps I'll write up my findings once the language stops intimidating me. At the moment I'm writing an account "object". I have some standard CRUD type functions which operate on a map behind the scenes. I would like to add some metadata to start specifying rules for validation, UI generation and so on. The trouble is I can't really figure out where to attach this metadata as I don't have a type definition as such, e.g. I would do this in C#:
[Required, MaxLength(50)] public string Name { get; set; } defstruct seems promising though I can't find an example with metadata. Any pointers of where to start looking? Cheers Barry On Jan 26, 7:01 am, PublicFarley <publicfar...@gmail.com> wrote: > Stuart pretty much nails it. This is the strategy that I have taken in > my own Clojure apps. Having said that it would be nice to see an > extensive, with comprehensive examples, "Domain Modelling with > Clojure" write up. > > On Jan 25, 12:30 pm, Stuart Sierra <the.stuart.sie...@gmail.com> > wrote: > > > On Jan 24, 4:29 am, Barry Dahlberg <barry.dahlb...@gmail.com> wrote: > > > > It is obvious (to me) how to go about this in C#... a class for > > > Product, properties for Name, Price etc. Where should I go for advice > > > on how to model these ideas in Clojure? > > > It's basically the same thing. Use namespaces instead of classes and > > functions instead of methods. > > > You can use the same techniques -- encapsulation, abstract data types, > > polymorphism -- that you would use in object-oriented programming. > > > Though only available on github right now, datatypes and protocols > > will provide a very flexible, efficient data modeling scheme. > > > -SS > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en