package patterns
- Alphabetic
- Public
- All
Type Members
-
trait
AggregateRoot
extends Identifiable
Aggregate root is a meaningful object in the domain.
Aggregate root is a meaningful object in the domain. It can be viewed as a write boundary for entities and value objects that will maintain write consistency.
Usually it represents a single table, but can span several tables and can be used like document or similar data structure. Since every aggregate is also an entity, it has a unique identification represented by its URI.
DSL example:
module Todo { aggregate Task { Timestamp startedAt; Timestamp? finishedAt; Int? priority; Seq<Note> notes; } value Note { Date entered; String remark; } }
- trait DataChangeNotification extends AnyRef
- trait DataContext extends AnyRef
-
trait
DataSource
extends AnyRef
Domain object that can be queried.
Domain object that can be queried. Server supports custom objects, such as SQL and LINQ objects which are not entities, but can be queried using specifications and other methods
DSL example:
module Legacy { sql Town 'SELECT id, name FROM town' { Int id; String name; } }
-
trait
DomainEvent
extends Identifiable
Domain event represents an meaningful business event that occurred in the system.
Domain event represents an meaningful business event that occurred in the system. It is a message that back-end system knows how to process and that will change the state of the system.
They are preferred way of manipulating data instead of simple CUD operations (create, update, delete). Unlike
aggregate domain event
which is tied to a change in a singleaggregate root
, domain event should be used when an action will result in modifications to multiple aggregates, external call (like sending an email) or some other action.By default event will be applied immediately. If
async
is used, event will be stored immediately but applied later.DomainEvent is defined in DSL with keyword
event
.module Todo { aggregate Task; event MarkDone { Task task; } }
- trait DomainEventHandler [T] extends AnyRef
- trait DomainEventStore [T <: DomainEvent] extends Repository[T] with SearchableRepository[T]
- trait DomainModel extends AnyRef
- trait EagerNotification extends DataChangeNotification
-
trait
Identifiable
extends DataSource
Domain object uniquely represented by its URI.
Domain object uniquely represented by its URI. Entity and snowflake are example of domain objects which are identified by its identity, instead of attributes. While entity does not implement Identifiable, aggregate root does.
-
trait
OlapCubeQuery
[T <: DataSource] extends AnyRef
Olap cube is online analytical processing concept used for extracting business intelligence.
Olap cube is online analytical processing concept used for extracting business intelligence. At it's core it's just a grouping of data by some dimensions and aggregation of values through facts. Facts can be sum, count, distinct and various others concepts. Cube can be made from various data sources: aggregates, snowflakes, SQL, LINQ, etc...
DSL example:
module Finance { aggregate Payment { Timestamp createdAt { versioning; } String account; Money total; calculated Int year from 'it => it.Year'; } cube<Payment> Analysis { dimension account; dimension year; count createdAt; sum total; } }
-
trait
PersistableRepository
[T <: AggregateRoot] extends Repository[T]
Service for doing CRUD operations.
Service for doing CRUD operations. It can be used for applying changes on
aggregate root
to the remote server.- T
type of
aggregate root
-
trait
Report
[T] extends AnyRef
Report is concept for aggregating multiple calls into a single object.
Report is concept for aggregating multiple calls into a single object. By providing search arguments and specifying queries with search predicates, order, limit and offset using LINQ data will be populated on the server.
DSL example:
module Blog { aggregate Post { Timestamp createdAt { versioning; } String author; String content; } report FindPosts { String? byAuthor; Date? from; Set<Post> postsFromAuthor 'it => it.author == byAuthor' ORDER BY createdAt; Array<Task> recentPosts 'it => it.createdAt >= from' LIMIT 20 ORDER BY createdAt DESC; } }
-
trait
Repository
[T <: Identifiable] extends AnyRef
Service for finding Identifiable domain objects.
Service for finding Identifiable domain objects. Finding domain objects using their URI identity is the fastest way retrieve an object from the repository.
- T
IIdentifiable domain object type
-
trait
SearchableRepository
[T <: DataSource] extends AnyRef
Service for searching and counting domain objects.
Service for searching and counting domain objects. Search can be performed using
specification
, paged using limit and offset arguments.- T
domain object type.
-
trait
ServiceLocator
extends AnyRef
Service for resolving other services.
Service for resolving other services. One locator per project should be used.
When multiple projects are used, locator must be passed around to resolve appropriate service.
Custom classes can be resolved if their dependencies can be satisfied.
-
trait
Specification
[T <: DataSource] extends (T) ⇒ Boolean
Search predicate which can be used to filter domain objects from the remote server using
searchable repository
.Search predicate which can be used to filter domain objects from the remote server using
searchable repository
.Specification is defined in DSL with keyword
specification
and a predicate. Server can convert specification to SQL query on the fly or call database function created at compile time. Other optimization techniques can be used too.DSL example:
module Todo { aggregate Task { Timestamp createdOn; specification findBetween 'it => it.createdOn >= after && it.createdOn <= before' { Date after; Date before; } } }
- T
domain object on which search will be performed.
- trait UnitOfWork extends DataContext with Closeable
Value Members
- object DataChangeNotification
- object OlapCubeQuery