Ticket #639 (closed Enhancement: fixed)

Opened 11 years ago

Last modified 11 years ago

Core API: the ClientState accessors should fail fast

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.3
Component: DeepaMehta Standard Distribution Version: 4.2
Keywords: Cc: dgf, Malte
Complexity: 2 Area: Application Framework / API
Module: deepamehta-core

Description

When an application accesses a (according to its contract) mandatory field in a ClientState? object, and such an entry is missing, the ClientState? class should throw an exception instead of letting the application proceed with a flawed result.

On the other hand if the application regards a certain ClientState? field as optional (again: according to its contract) it should make that explicit by calling a has() predicate before doing the possible get() call.

http://en.wikipedia.org/wiki/Fail-fast
http://martinfowler.com/ieeeSoftware/failFast.pdf

Change History

comment:1 Changed 11 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 11 years ago by Jörg Richter

Core: make ClientState? accessors fail fast (#639).

ClientState? has a method to check if a certain cookie exists:

boolean has(String name)

BREAKING CHANGES

The get() and getLong() accessors throw an exception if no such cookie exists.

See #639.

comment:3 Changed 11 years ago by Jörg Richter

Core: make ClientState? accessors fail fast (#639).

ClientState? has a method to check if a certain cookie exists:

boolean has(String name)

BREAKING CHANGES

The get() and getLong() accessors throw an exception if no such cookie exists.

See #639.

comment:4 Changed 11 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.