Re: Repositories, package dependencies, and domain-flavoured exceptions
- From: Jason Che-han Yip <jcyip@xxxxxxxxxxxxxxxx>
- Date: Wed, 27 Jul 2005 19:52:35 +1000
H. S. Lahman wrote:
Responding to Yip.......
At yet another level, throwing an exception in either case is a bad practice if the Account ID is supplied interactively. One is then using the exception mechanism to validate user typos. That is a very expensive and fragile way to handle errors that are normally expected in the environment. One should build the application to handle such errors within the normal flow of control and use exceptions to deal with errors that are completely unanticipated (i.e., the software has gotten into an unstable state).
....
This is a good point. The criteria used to initiate the find is a user-entered business identifier, an account number, not an entity id so really shouldn't be throwing an exception if nothing is found. Following the Hibernate-style, this is a find (with a simple query) not a load (by a primary key) and it is therefore not exceptional that no results may be found.
Of course, also dealing with legacy databases so there are other issues... .
- References:
- Repositories, package dependencies, and domain-flavoured exceptions
- From: Jason Che-han Yip
- Re: Repositories, package dependencies, and domain-flavoured exceptions
- From: H. S. Lahman
- Repositories, package dependencies, and domain-flavoured exceptions
- Prev by Date: Re: Repositories, package dependencies, and domain-flavoured exceptions
- Next by Date: Re: Repositories, package dependencies, and domain-flavoured exceptions
- Previous by thread: Re: Repositories, package dependencies, and domain-flavoured exceptions
- Next by thread: Re: Repositories, package dependencies, and domain-flavoured exceptions
- Index(es):
Relevant Pages
|