What is the difference between a DSL and Util and ...
# announcements
g
What is the difference between a DSL and Util and API?
🍿 3
m
DSL = Domain Specific Language. A huge undertaking to create a language on top of Kotlin. Lots of materials on DSL's available, and used to allow someone to 'write code' while 'speaking' a business language, or domain language they can understand. If you truly want to create a DSL, JetBrains has a tool called MPS. It's even more focused on creating a DSL. A Util generally is a collection of Utility functions defined in a project or library for simplifying execution of things you do in your project a lot. For Kotlin, a number of the things in the stdlib could be considered Util. The language is still Kotlin in this case.
👍🏻 1
g
Thanks @Mike, but if I expose a utility function with a business domain name, that hides the underlying implementation and limits user action, can I call it an internal DSL?
m
I wouldn't. Depending on how far you take it, you're getting into Domain Driven Design (DDD) instead. A DSL is an entire concept. What you're doing is a good practice, and as I say, more DDD. Makes it easier for dev and business to talk to each other as you're hopefully both using the same language. Less likely to have confusion.