DSL
A DSL (domain specific language) is a small, special purpose language that’s meant to do a few things, but do them well.
Implementing
............................................................................................................................
Join Our Groups:
http://groups.google.com/group/vubest
http://facebook.com/groups/vubest
Show your LOVE Please Like us on facebook
Click Thumbs Up
A DSL (domain specific language) is a small, special purpose language that’s meant to do a few things, but do them well.
Implementing
Implementing the DSL is incredibly easy, in fact, so easy that you’ll want to do it all the time!.
An example would be the Gemfile “DSL” that comes with Rails. In fact, the lack of XML was one of the biggest lures of Rails (for me, and most likely for many others).That’s how easy it is develop a DSL!
- Made a class
- Added methods (optional, although without them a DSL isn’t really anything)
- Added constructor (optional)
- Used instance_eval
The sky really is the limit with DSLs! It’s so easy to build them, and even easier to make them better! Just add on or change the methods in the class on which instance_eval is called.
............................................................................................................................
Join Our Groups:
http://groups.google.com/group/vubest
http://facebook.com/groups/vubest
Show your LOVE Please Like us on facebook
Click Thumbs Up
Comments
Post a Comment