DelegatedCRUDUseCase<Domain extends BasicDomainObject<IntIdentifier>, CRUDRepo extends CRUDRepository<Domain>> class abstract

Default implementation of CRUDUseCase of type Domain extends BasicDomainObject It's basically a delegate to the repo.

EXAMPLE: This is the implementation of ParentUseCase. See BasicDomainObject for ParentDomain's example code. See CRUDUseCase for ParentUseCase's example code.

  class ParentUseCaseImpl extends DefaultCRUDUseCase<ParentDomain>
    implements ParentUseCase {
     late ParentRepo _repo;

    ParentUseCaseImpl(ParentRepo repo)
        : _repo = repo,
          super(repo: repo);

    void doStuffInUseCase(){
       print('Doing Stuff in the use case layer...');
    }
  }
Inheritance

Constructors

DelegatedCRUDUseCase({required CRUDRepo repo})

Properties

hashCode int
The hash code for this object.
no setterinherited
repo ↔ CRUDRepo
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

count() int
Count the amount of domains. By default calling the length of findAll().
override
create(Domain newObject) → Domain
Create the domain.
override
delete(Domain objectToDestroy) → void
Destroy the domain.
override
deleteById(int id) → void
Destroy the domain.
override
dispose() → void
override
edit(Domain objectToEdit) → Domain
Edit the domain.
override
findAll() List<Domain>
Find all domains.
override
findById(int keyId) → Domain?
Find the correspondent domain by it's Key Id.
override
init() → void
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited