4 ms·
So your idea is that, rather than type in the programs directly, we instead switch to some kind of language for defining the program in? A language that abstrac
by agent327 5y ago
So your idea is that, rather than type in the programs directly, we instead switch to some kind of language for defining the program in? A language that abstracts from all the low-level details?
Sounds like a winner to me. Somebody should implement this!
- drevil-v2 5y agoI think you are on to something.. Such a language could perhaps even have a formal specification? Like a syntax and schematics?
- pan69 5y agoYeah, like a Unified Modelling Language.
- osigurdson 5y agoThere have been quite a few attempts to use a 2D layout to describe logic. While it does work to some extent to problems naturally suited to unidirectional data flow, it is overly limited for general computation. The patterns immediately behind the distasteful (to some) text of code are N dimensional and cannot easily be mapped to two dimensions.
- KronisLV 5y agoThere certainly have been attempts to do this to varying degrees over time. For example, in Java, there is JHipster which introduced a DSL to describe a number of application concepts and then generated code based on those: https://www.jhipster.tech/ https://www.jhipster.tech/ The problem is that these approaches tend to fail whenever you need to either edit the generated code while not breaking the generation logic, or implement more complex logic and cases that aren't covered, or even just integrate with external libraries without digging too deep in the generation logic to assimilate the external code within the codebase. Now, there are other, more limited cases in which this can work, especially with frameworks like Ruby on Rails or even Laravel, which provide all sorts of code generation logic for specific situations, given that they're typically not integrated with that many libraries, in which case they just make development faster and simpler. Link to Ruby on Rails generators: https://guides.rubyonrails.org/generators.html https://guides.rubyonrails.org/generators.html (this does mostly describe how to write your own ones, though) Link to Artisan make command (for models) in Laravel: https://laravel.com/docs/8.x/eloquent#generating-model-classes https://laravel.com/docs/8.x/eloquent#generating-model-class... Link to info about MySQL Workbench (both forward and reverse engineering): https://dev.mysql.com/doc/workbench/en/wb-data-modeling.html https://dev.mysql.com/doc/workbench/en/wb-data-modeling.html Personally, i think that there's a lot of utility to be had in this approach, especially for situations like schema-first database development, or even generating migrations based on the model classes within the application. MySQL Workbench actually lets you generate DDL statements based on ER models, as well as synchronizing partial changes in a live database, which is useful in practice, yet also really niche and probably hard to implement behind the scenes. Perhaps that's why sadly model driven architecture hasn't really become all that popular outside of academia. Edit: i've added links to the tools i mentioned above, but also remembered that one of the things i've found most annoying about model driven architecture is that most of the work with models is forwards only - you can only go from a metamodel to a model and never the other way around. Ideally, there would be a way to take the current state of the codebase (with any metadata and also manually changed code) and generate a metamodel that can be changed as necessary, to later generate the model again but without losing the manual implementation.