DefaultCRUDUseCase<Domain extends BasicDomainObject<IntIdentifier>> class Null safety

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

DefaultCRUDUseCase({required CRUDRepository<Domain> repo})

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
repo CRUDRepository<Domain>
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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

Operators

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