Understanding Model-Driven Apps
๐ค Entities, forms, views, relationships, roles, and permissions >> "My current project is a Model-Driven App (CRM) with Business Central integration. My role focuses on implementing entities, forms, views, relationships, roles, and permissions. However, I feel that I donโt yet have a complete overview of how the whole system works. I can connect small pieces, but I donโt fully see the big picture." --- #๏ธโฃ The Mental Model: A Database with a Living Face The most important thing to understand about Model-Driven Apps (MDAs) is that they are not built like traditional applications. Most software is built code-first โ a developer writes logic, and the UI is crafted around that logic. MDAs flip this: they are data-model first. Everything you see on screen โ forms, views, dashboards โ is generated automatically from the underlying data structure you define. This is why they're called "model-driven." Think of it this way: you define the shape of your data, and the app emerges from that shape. #๏ธโฃ The Four Layers (and How They Stack) It helps to think of the whole system as four distinct layers sitting on top of each other. 1๏ธโฃ Layer 1 โ The Data Layer (Dataverse) At the very bottom is Microsoft Dataverse, which is essentially a cloud-hosted relational database with superpowers. Every "entity" you create (like Account, Contact, Opportunity, or a custom one) is really just a table in Dataverse. The columns (fields) you add to that entity are the columns of that table. The relationships you define between entities are foreign keys โ Dataverse just makes them feel more semantic (one-to-many, many-to-many, etc.). This layer is the source of truth. Everything else in the app is a view into or interface over this layer. 2๏ธโฃ Layer 2 โ The Metadata Layer (the "Model") On top of the raw data sits metadata โ the definitions of how data relates, behaves, and validates. This includes your relationships (which entities are connected and how), field types and validation rules, and crucially, Business Rules (declarative logic you define without code, like "if Status = Closed, make Revenue required"). The metadata layer is what makes this a model-driven app โ the model is this rich description of your data and its rules.