Packages, Imports, and Scope
Packages are the fundamental organisational unit in Farkitect. Understanding how they work — and how imports connect them — is key to building well-structured models.
Why Packages?
Section titled “Why Packages?”A real-world model can contain hundreds or thousands of elements. Without structure, the Explorer becomes an unusable flat list. Packages provide:
- Hierarchy — nest packages inside packages to create a logical tree
- Ownership — every element, relationship, diagram, and catalog belongs to exactly one package
- Scope boundaries — M2 types are only available where they’ve been imported
- Portability — a package tree can be exported as a self-contained
.farkifile
Package Layers
Section titled “Package Layers”Every package has a layer designation:
| Layer | Purpose | Who may edit it |
|---|---|---|
| M3 | System foundation (MOF Core) | Project admins (in practice it is left as it is) |
| M2 | Metamodels (modelling languages) | Project admins |
| M1 | Models (your work) | Project admins and contributors |
The layer determines what a package can contain and how Farkitect treats it. M2 packages define types; M1 packages instantiate them.
Package Roles (M2 Only)
Section titled “Package Roles (M2 Only)”M2 metamodel packages use roles to tell Farkitect how to interpret their contents. The standard M2 package structure is:
My Metamodel (M2, standard)├── Element Types (role: elementTypes)│ ├── Business Layer (role: elementTypeLayer)│ └── Technology Layer (role: elementTypeLayer)├── Relationship Types (role: relationshipTypes)├── Enumerations (role: enumerations)└── Views (role: views)- elementTypes — contains element type definitions, grouped into layers
- elementTypeLayer — a grouping within elementTypes (e.g., “Application Layer” in ArchiMate)
- relationshipTypes — contains relationship type definitions
- enumerations — contains enumeration types
- views — containers for diagram, catalog, and matrix view definitions
These roles are set when you create a metamodel using New M2 Metamodel… — the structure is generated automatically.
Imports
Section titled “Imports”Imports declare dependencies between packages. The most common pattern is an M1 package importing an M2 metamodel:
M1 Farquind Applications imports: [M2 ArchiMate 3.2]When an M1 package imports an M2, the M2’s element types and relationship types become available in the Palette for any diagram in that M1 package. Without the import, the Palette is empty. That includes M2 Common: to use Note, Boundary, Trace and the rest, import M2 Common like any other metamodel.
Common metamodels
Section titled “Common metamodels”A metamodel is either standard (a modelling language of its own, such as ArchiMate) or common (general-purpose types meant to be used alongside standard ones, such as M2 Common). A common metamodel’s relationship types can join elements of other metamodels the model imports, so a Trace can run between two ArchiMate elements. A standard metamodel’s relationship types join only its own types.
A project can hold more than one common metamodel, each imported by the models that need it.
You choose the kind when you create a metamodel with New M2 Metamodel…: Standard or Common. It can’t be changed afterwards, so decide at the start. A metamodel’s kind is shown in its Properties. Common metamodels are listed in yellow in the Explorer, and after the standard ones in the Palette and in New Element….
Multiple imports
Section titled “Multiple imports”A package can import multiple metamodels:
M1 Farquind Organisation imports: [M2 ArchiMate 3.2, M2 Farquind Org Map]The Palette then shows types from both metamodels, and you can create elements of either type in the same diagrams.
Import inheritance
Section titled “Import inheritance”Sub-packages inherit their parent’s imports by default. If M1 Farquind Applications imports ArchiMate, then a sub-package Customer Systems inside it also has access to ArchiMate types — without needing its own import declaration.
You can override imports on a sub-package if needed (for example, to add an additional metamodel import for that sub-package only).
Who May Edit a Package
Section titled “Who May Edit a Package”Whether you can edit a package depends on your role in the project, not on the package. A project admin may edit any package: models, metamodels (M2 Common included) and MOF Core. A contributor may edit models, and sees every metamodel as a viewer does, read-only. A viewer edits nothing. See Roles and access control.
Changing a metamodel affects every model built on it, so it is an admin’s job. Older files may carry an isReadOnly setting on a package; Farkitect ignores it and no longer writes it.
Projects and Packages
Section titled “Projects and Packages”The relationship between projects and packages:
- A project is a container that holds packages and provides data isolation
- All packages in a project share the same M3 MOF Core
- Each project has its own copy of each metamodel it uses, imported from a file or the Farketplace, or made in the project
- M1 packages are always project-specific — your model data lives in one project
When you export a package, the export is self-contained. When you import it into a different project, all the elements, relationships, and diagrams come along. If the import requires an M2 metamodel that isn’t in the target project, you’ll need to import that M2 first.