Development Layers & Models in Dynamics 365 Finance & Operations
Question 48 — Where custom code lives: layers, models, packages and minimum references.
Interview Question
Model Answer (Short)
New objects should be developed in the VAR layer with minimum package references specified, and you may create new models as needed (multiple models can be added per requirement). A model is a logical grouping of elements (a design-time concept) that represents a distributable unit of your customization, while a package is a deployment unit — a compiled assembly that can contain one or more models and is what actually gets built and deployed. Keeping package references to a minimum reduces coupling and build time, and helps keep the model cleanly separated and portable. A model is also defined by its publisher, layer and description.
Detailed Explanation
Layers, models & packages
- Develop new objects in the VAR layer and specify minimum package references.
- You may create new models as needed — multiple models can be added per requirement.
- A model is a design-time grouping / distributable unit of your customization elements.
- A package is a deployment unit (compiled assembly) that can contain one or more models.
Model definition attributes
- Model name — the identifier for the customization model.
- Model publisher — the organisation that owns the model.
- Model description — a short description of the model's purpose.
- Development layer — the layer the model is developed in (e.g. VAR).
Why minimum package references
- Fewer references means lower coupling between packages.
- Reduces build/compile time.
- Keeps the model portable and cleanly separated.
- Only reference the packages that own the objects you actually extend/use.
Model / Package Reference
| Concept | What it is |
|---|---|
| Layer (VAR) | The layer new customizations are developed in |
| Model | Design-time grouping / distributable unit of elements |
| Package | Deployment unit (compiled assembly) holding one+ models |
| Reference | A dependency on another package — keep to a minimum |
| Publisher / Description | Ownership & purpose metadata of a model |
Prerequisites (Rule 5)
- Visual Studio with the Dynamics 365 developer tools.
- Rights to create a model and set its publisher/layer/description.
- Knowledge of which packages own the objects you extend.
Example — Model definition & references
# Conceptual model definition
Model name : AbcCustomizations
Model publisher : Abc Partner Inc.
Model description : Abc customer ERP customizations
Development layer : VAR
# Minimum package references (only what you extend)
References:
- ApplicationSuite
- ApplicationPlatform
- ApplicationFoundation
Example — extension lives in your VAR model
// This extension is authored in your VAR-layer model (e.g. AbcCustomizations),
// which references the package that owns CustTable (ApplicationSuite).
[ExtensionOf(tableStr(CustTable))]
final class CustTableAbc_Extension
{
public static boolean abcIsBlocked(CustTable _custTable)
{
return _custTable.Blocked != CustVendorBlocked::No;
}
}
Points the interviewer wants to hear
- Develop new objects in the VAR layer.
- A model is a design unit; a package is a deployment unit.
- A package can contain one or more models; you may create multiple models.
- Specify minimum package references to reduce coupling and build time.
- A model is defined by name, publisher, layer and description.
Likely Follow-up Questions
- What is the difference between a model and a package?
- Which layer do you develop customizations in, and why?
- Why keep package references to a minimum?
- Can a single package contain multiple models?
Key Takeaway
Build customizations in the VAR layer using models (design units) that compile into packages (deployment units). Create multiple models as needed, define each model's publisher/layer/description, and always specify minimum package references to keep the solution lean and portable.