Re: A question about weak contract



Tony Johansson wrote:

> I'm reading a paper from a university and it says.
>
> System boundary classes need weak contracts.
> - The user might not be trustable.
> * End-users do not accept that they have to test before a function
> call,
> which calls for weak contract.
>
> Now to my question why do we have to use weak contract here as was said.
> Why is it not possible to use strong contract in that situation?

Because the user might not be trustable.

Put it like this: "weak contract" means "strong defenses". Question every
input variable, and bubble up a clear error message if it's wrong.

"Strong contract" means "weak defenses". You migrate all the checks to this
virtual contract, and don't express them in code. When the contract
obviously fails, you write an error message to a log, and rely on
programmers to strengthen the other modules' adherence to the contract.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!


.



Relevant Pages

  • Re: Device busy error when trying to Rebuild RPM Database...
    ... where someone said this error message was a bug, ... be at least partially rebuilt. ... This communication is for use by the intended recipient and contains ... this e-mail does not constitute a contract offer, a contract amendment, ...
    (RedHat)
  • Re: How to: Trap System Message Dialog?
    ... the system dialog will popup first telling the user that ... If I recall correctly, there's an unmanaged API that controls whether Windows presents an error message before failing an operation, but I haven't used it since Windows 95. ... The question as to whether an error will be presented to the user when a write to some device fails is really more a contract between the user and the OS. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help woth stored procedure!
    ... What does "not bringing back the max contract start date" mean? ... An error message? ... David Portas ... SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Cant insert a null value
    ... > The error message shows the SQL looks like this. ... here refers to homework not contract - can homework have null ... > Invalid use of Null ...
    (microsoft.public.access.gettingstarted)