5 ms·
Ask HN: Schema Driven Apps
I am evaluating if this idea has merit. Comments and feedback welcome.
Long long ago, when I used MS Access (probably Access98), there was a functionality where all forms, master-detail views etc., could be autogenerated using a wizard. In those days, I found it to be very cool and used it for prototyping apps client-server/n-tier architecture apps.
Is there a market for enterprise CRUD apps that are completely schema-driven i.e., a data analyst/programmer specifies the data model (such as an Entity-Relationship Model) and the entire database, data validation and business logic, service layer and UI is autogenerated.
I also have some ideas around autogenerating entire business process workflows from the same data schema.
As a simple example, say we are modeling automotive insurance claims model with
- Subscriber
- Vehicle
- Policy
- Claim
entities. The business process flows might be:
- *Subscriber onboarding*: This adds a new subscriber , new policy and the vehicle on the policy
- *Policy servicing*: This adds vehicles or policy riders
- *Claim submission and processing*: This adds a new Claim record for a subscriber, vehicle and policy that are matched against the policy information for further settlement of the claim.
The idea is to autogenerate all of the backend and the service layer for this including the UI. The grunt work of defining the screens etc., would be automated. The programmer would focus on building key business logic such as "claim processing upon submission".
Does this idea have merit?
- deterministic 4y agoThis has been done many times before. I (for example) use a code generator I wrote myself to generate 80% of new biz applications. It is a very powerful tool. However I have never used it for work because most of the stuff I work on is old but highly valuable code.
- xcubic 4y agoCan you share more details about what makes it powerful? Is it open source? You got me curious!
- deterministic 4y agoI haven’t published it. I don’t want to spend time supporting it. It is quite simple though: 1. Decide on an architecture that scales well. 2. Redesign the architecture to maximise opportunities for auto generating code/schemas/protocols/client/server/DB etc. 3. Define your actual application in a declarative language. I use my own custom language but you can use JSON/YAML/… 4. Write a generator that reads the declarative files and generates as much of the code needed as possible to implement the application. 5. Hand code what remains (basically the core biz logic). That’s pretty much it. I have done this exercise more than 9 times and I learned a lot doing it. I highly recommend giving it a go yourself. You learn a true super power and it is great fun.
- xcubic 4y agoInteresting! I actually do something quite similar, which is why I created this code generator https://github.com/mintyPT/sal https://github.com/mintyPT/sal (still need to finish v2) How long have you been going this? You create a custom language instead of using json or yaml?
- deterministic 3y agoYeah I maintain compilers for a living so throwing together a parser for my own custom language is fun and quick. The custom language is just event definitions, state machines etc. Nothing complicated.
- jonahbenton 4y agoAs you mention, there was quite a lot of this in the 1990s, and there are still lots of tools that employ this kind of workflow- django, for instance- for the admin side of the UI. These approaches are no good for anything user facing- design and UX is too important. The larger issue is that no system is an island, from a data perspective, and most work is brown, not green field. Subscribers and policies already live in the system the company has been using for 20 years- well, likely in a dozen systems that the business has acquired from competitors and continues to operate while struggling with data integration. Meanwhile marketing and sales has been using multiple generations of SAAS tools, finance has their own on prem or SAAS tools- all of which need to work with a common set of entities but which have different opinions about exactly how those entities are shaped. This is the reason data lakes and SAAS ETLs are so important right now. Static/dynamic generators don't solve a painpoint at this point. It's not about new systems/data, it's about existing systems and data. HTH.
- vivegi 4y agoValid points. Of course, you are right about most systems being brownfield and multi-system integration being very important. That's something I am thinking of supporting out of the box.
- rad_gruchalski 4y agoWould Ruby on Rails with its ActionWhatevers qualify?
- vivegi 4y agoI am not familiar with Ruby on Rails. I have made a note to study what you have suggested. Thanks.
- yibers 4y agoActually Microsoft still provides tools for the kind of development you mention. See more here: https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/model-driven-app-overview https://learn.microsoft.com/en-us/power-apps/maker/model-dri...
- vivegi 4y agoYes, power-apps was on my mind. But their licensing requirements made me feel as if there was unaddressed space. At minimum (there are probably more), it required: - A Microsoft Power Apps license. - Capacity to create a Power Platform environment. This is a feature of the Power Apps and Dynamics 365 licenses held.
- ch1234 4y agoCheck out Form.io We’re doing some development now which incorporates additional features such as AWS automations and GUI upgrades, but our based schema development is on the form.io platform
- sakesun 4y agoFrappe claims to be metadata driven. https://frappeframework.com/ https://frappeframework.com/
- is_true 4y agoSymfony + EasyAdminBundle kind of does that. Symfony lets you create the entities by asking you questions, and then running a console command with the admin bundle installed it generates the controllers and views for most of the fields/entities. The business logic is probably the harder to generate correctly.