Skip to main content

DSL (Domain Specific Language)

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

Popular posts from this blog

Drupal Answers Weekly Newsletter - Wednesday, December 31, 2014

Top new questions this week: Can I delete old hook_update_N functions? Suppose you have a custom module, and you have hook_update_N() implementations in your .install file. If you have old update functions, and all updates have run in all sites that the module is ... node-update hook-update-n   asked by AyeshK ...

[New post] 8th Class Result 2014 PEC Hafizabad Board

Muhammad Waqas posted: "PEC Hafizabad Board 8th Class Result 2014 expected date is 28th March, 2014 by PEC. Punjab Examination Commission (PEC) will announce 8th class result for Hafizabad Board soon and all the students of Hafizabad Board who are extremely waiting for the resul" New post on Jobs in Pakistan 8th Class Result 2014 PEC Hafizabad Board by Muhammad Waqas ...

[New post] 1st Year (11th Class) Result 2014 BISE Rawalpindi Board

Xaib Aslam posted: "BISERWP board Inter part 1 result expected on 10th October 2014 according our source. students of Rawalpindi board desperately waiting for 11th class result. 1st they upload the 12th class result and after some time they ready for showing the 1st year fin" New post on Jobs in Pakistan 1st Year (11th Class) Result 2014 BISE Rawalpindi Board by Xaib Aslam ...