What is the difference between a DSL and Util and API?
🍿 3
m
Mike
04/30/2020, 11:36 AM
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
Gopal S Akshintala
04/30/2020, 12:33 PM
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
Mike
04/30/2020, 12:43 PM
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.