Skip to content

subdomains

vijay@envivo edited this page Oct 20, 2026 · 10 revisions

Subdomains

Subdomains are represented by namespaces within your code. For all concepts relating to a subdomain, add the corresponding classes to the appropriate namespace.

The UI will show namespaces as sections and their classes as sub-items:

In the above example, we have several subdomains, including Contacts, Customer Accounts, Shopping, and Stock. The classes related to each subdomain can be expanded further, to show their available operations.

Namespace tooltips

You can add help documentation to namespaces. Fresnel supports the NamespaceDoc convention (as used by 3rd-party tools such as Sandcastle or DocFX).

Within the code, create a NamespaceDoc class like so:

namespace Acme.OnlineShopping.Contacts
{
    /// <summary>
    /// Types of contact information for People 
    /// </summary>
    [VisualIdentifier(iconHtml: "", htmlColour: "#335566")]
    internal class NamespaceDoc {}
}

The Library panel would then show this:

What appears in the Library

The Library lists every public class, apart from those that Fresnel hides automatically:

  • Domain dependencies (repositories, factories, domain services, consistency checks and other IDomainDependency classes)
  • Command objects (ICommandObject<T> / ICommandObjectAsync<T>)
  • Process child objects (IStage, IStep)

Hiding items in the Library

During exploration and design, it is useful to keep all public classes visible in the Library. This assists in conversations with domain experts.

In day-to-day use, too many items can be overwhelming for the user. For that reason, limit the Library to the top-level objects a user would open directly: Aggregate Roots, Processes, and dashboard-style views.

All other items, such as child Entities, Value Objects and other supporting classes may be hidden in the Library with [Visible(isVisibleInLibrary: false)]. Example:

[Visible(isVisibleInLibrary: false)] //👈 Hidden in the Library, but still visible if it's part of the domain model:
public class SalesOrderLine : IEntity, IPersistable
{
    ...
}

💡 Developer Tips

Ensure all namespaces have the same root prefix, otherwise some classes may not appear where expected:

namespace Acme.OnlineShopping.Contacts
namespace Acme.OnlineShopping.CustomerAccounts

Clone this wiki locally