Use case RetrieveArticle, which takes at least one identifier (e.g., title, author) returns a Prolog::Core::Article entity with the previously-persisted Article matching the search term(s).
This sounds pretty generic and straightforward, doesn't it? The specific impetus for this was item 9 in the "User-Eye View" feature list in Issue #1, which said that the use cases needed to support being able to
view the article page for the newest article
Possible Error Conditions
No match found: no Article matching the search term(s) was found or, in future, no matching Article is accessible to the current user;
Non-specific search terms: the search terms were insufficiently specific to isolate one specific Article matching the request.
Relation to SummariseContent
The SummariseContentuse case already has a nested class called ArticleLister, which simply retrieves all Articles from a repository. It exercises the #all method on the object passed into SummariseContent#initialize as its :repository parameter.
Repository Interface
This use case requires that the :repository parameter passed to RetrieveArticle#initialzemust have a #where method, taking an arbitrary number of field matchers as a Hash. That Hash will have field identifiers as keys (e.g., :title) and values either as simple values or as lambdas taking a single parameter (the field value for a record) and returning true or false signifying whether the specified value meets the search condition implemented by the lambda.
Use case
RetrieveArticle
, which takes at least one identifier (e.g., title, author) returns aProlog::Core::Article
entity with the previously-persisted Article matching the search term(s).This sounds pretty generic and straightforward, doesn't it? The specific impetus for this was item 9 in the "User-Eye View" feature list in Issue #1, which said that the use cases needed to support being able to
The
SummariseContent
use case already has a nested class calledArticleLister
, which simply retrieves all Articles from a repository. It exercises the#all
method on the object passed intoSummariseContent#initialize
as its:repository
parameter.Repository Interface
This use case requires that the
:repository
parameter passed toRetrieveArticle#initialze
must have a#where
method, taking an arbitrary number of field matchers as a Hash. That Hash will have field identifiers as keys (e.g.,:title
) and values either as simple values or as lambdas taking a single parameter (the field value for a record) and returningtrue
orfalse
signifying whether the specified value meets the search condition implemented by the lambda.