Package

net.revenj

patterns

Permalink

package patterns

Visibility
  1. Public
  2. All

Type Members

  1. trait AggregateRoot extends Identifiable

    Permalink

    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;
      }
    }
  2. trait DataChangeNotification extends AnyRef

    Permalink
  3. trait DataContext extends AnyRef

    Permalink
  4. trait DataSource extends AnyRef

    Permalink

    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;
      }
    }
  5. trait DomainEvent extends Identifiable

    Permalink

    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 single aggregate 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;
      }
    }
  6. trait DomainEventHandler[T] extends AnyRef

    Permalink
  7. trait DomainEventStore[T <: DomainEvent] extends Repository[T] with SearchableRepository[T]

    Permalink
  8. trait DomainModel extends AnyRef

    Permalink
  9. trait EagerNotification extends DataChangeNotification

    Permalink
  10. trait Identifiable extends DataSource

    Permalink

    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.

  11. trait OlapCubeQuery[T <: DataSource] extends AnyRef

    Permalink

    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;
      }
    }
  12. trait PersistableRepository[T <: AggregateRoot] extends Repository[T]

    Permalink

    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

  13. trait Report[T] extends AnyRef

    Permalink

    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;
      }
    }
  14. trait Repository[T <: Identifiable] extends AnyRef

    Permalink

    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

  15. trait SearchableRepository[T <: DataSource] extends AnyRef

    Permalink

    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.

  16. trait ServiceLocator extends AnyRef

    Permalink

    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.

  17. trait Specification[T <: DataSource] extends (T) ⇒ Boolean

    Permalink

    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.

  18. trait UnitOfWork extends DataContext with Closeable

    Permalink

Value Members

  1. object DataChangeNotification

    Permalink
  2. object OlapCubeQuery

    Permalink

Ungrouped