Re: failure to add to a repository

Giacomo Tesio <[email protected]>
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <CAHL7psFgwoWSoP0jsR6Bh9HJNvLaBoPNnxTmkUC+JLGZO+tOfA@mail.gmail.com>
Me too.
Moreover, I would include relevant informations in the exception (see
http://epic.tesio.it/2013/03/04/exceptions-are-terms-ot-the-ubiquitous-language.html
)

Giacomo


On Wed, Apr 10, 2013 at 9:53 PM, Jörgen Andersson <
[email protected]> wrote:

> **
>
>
> I would go for exceptions if anything goes wrong.
> Jörgen
> Den 10 apr 2013 19:52 skrev "Caleb Cushing" <[email protected]>:
>
> **
>>
>>
>> I'm designing a RESTful web service...
>>
>> My problem is that in thinking a repository has a collection
>> interface. Given that an add operation on a collection usually either
>> returns t/f, void, or the object (depending on language). But both
>> database access and http have further ways of describing the failure
>> than a simple succeed/fail.
>>
>> This could be handled in one of 2 ways, custom exceptions or status
>> codes, I'm writing to see what is generally preferred?
>>
>> --
>> Caleb Cushing
>>
>> http://xenoterracide.com
>>
>  
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.