Bug #357

Enforce Declared Informer Semantics

Added by J. Moringen over 10 years ago. Updated over 10 years ago.

Status:ResolvedStart date:06/09/2011
Priority:NormalDue date:
Assignee:S. Wrede% Done:

100%

Category:Specification
Target version:0.4

Description

Should a client be allowed to send data which is not of the Informer's configured type?
  • Only data of the declared type should be sent
    Data of the declared type and subtypes can be send
  • Runtime errors should be signaled in case of violation
Should a client be allowed to send to scopes which are different from the Informer's configured scope?
  • Only the declared scope is allowed
    The declared scope and subscopes are allowed
  • Runtime errors should be signaled in case of violation
Implementation of these modified rules and associated test cases:
  • C++ ✓
  • Python ✓
  • Common Lisp ✓
  • Java ✓

Associated revisions

Revision 37bbf3b1
Added by J. Wienke over 10 years ago

ensure that Events can only be sent with the type and scope of the informer

refs #357

Revision feaa3b3a
Added by J. Moringen over 10 years ago

Enforce declare scope and type in src/rsb/Informer.h
refs #357
  • src/rsb/Informer.h: check event type and scope against informer's
    declared type and scope in checkedPublish
  • test/rsb/UserLevelTest.cpp: added test cases testCheckScope and
    testCheckType

Revision 214a4723
Added by J. Wienke over 10 years ago

ensure that sent events have the correct scope and type

refs #357

Revision 3217ea00
Added by J. Moringen over 10 years ago

Checks on event scope and type in send method in src/informer.lisp
fixes #357
  • src/conditions.lisp (invalid-event): new condition; superclass for
    conditions related to invalid events
    (invalid-event-type): changed superclass rsb-error -> invalid-event
    (invalid-event-scope): new condition; signaled when an event scope
    is invalid in a given context
  • src/informer.lisp (informer::type): removed writer method
    (send :before informer event): check event type and scope properly
  • src/package.lisp (package rsb): added exported symbols
    invalid-event, invalid-event-event, invalid-event-type,
    invalid-event-scope and invalid-event-expected-scope
  • test/informer.lisp (test informer-root::check-type): new test case;
    check errors signals for invalid event types
    (test informer-root::check-scope): new test case; check errors
    signaled for invalid event scopes

Revision a8766c6f
Added by J. Moringen over 10 years ago

Relaxed event scope/type checks in rsb/__init__.py
refs #357
  • rsb/__init__.py: use Event constructor in Informer.publishData;
    changed checks in Informer.publishEvent to allow subscopes of the
    informer's scope and subtypes of the informer's type
  • test/coretest.py: changed testSendEvent WrongScope and
    testSendEventWrongType accordingly

Revision e504187e
Added by J. Moringen over 10 years ago

Relaxed scope and type checks in src/rsb/Inforer.h, src/rsb/Factory.h
refs #357
  • src/rsb/Factory.h: use TypeName from Informer.h to generate string
    representation of Informer type
  • src/rsb/Informer.h: added tag class AnyType for indicating arbitrary
    types; added class TypeName for generating string representations of
    types mapping AnyType to the empty string; relaxed type and scope
    checking Informer::publish methods to allow subscopes of the
    Informer scopes and arbitrary payload types when requested
  • test/rsb/integrationtest.cpp: added tests for arbitrary type in
    testTypeCheck test case; added tests for subscopes in test case
    testScope check

Revision ff4da409
Added by J. Moringen over 10 years ago

Changed informer's scope checking in src/informer.lisp
refs #357
  • src/informer.lisp (send :before informer event): allow sub-scopes of
    the informer's scope
  • src/conditions.lisp (invalid-event-scope): adapted report to changed
    rules
  • test/informer.lisp (test informer-root::check-type): test subtypes
    of the informer's type
    (test informer-root::check-scope): test sub-scopes of the informer's
    scope

History

#1 Updated by J. Wienke over 10 years ago

  • % Done changed from 0 to 50

#2 Updated by J. Wienke over 10 years ago

  • % Done changed from 50 to 80

#3 Updated by J. Moringen over 10 years ago

  • Status changed from New to Resolved
  • % Done changed from 80 to 100

Applied in changeset r1479.

#4 Updated by S. Wrede over 10 years ago

  • Category set to Specification
  • Status changed from Resolved to Feedback
  • Target version changed from 0.3 to 0.4

According to initial feedback (e.g. from Thies and Hendrik), this design decision needs some more consideration. As we anyways aggregate information at higher scopes with different types, it may make less sense to impose this special restriction.

Could we just have both? A typed and an un-typed informer that allows to send events of different types?

For scopes, I still think that a restriction on the configured one is useful.

#5 Updated by S. Wrede over 10 years ago

  • % Done changed from 100 to 70

Testcases needed for each language.

#6 Updated by J. Moringen over 10 years ago

  • Description updated (diff)
  • Status changed from Feedback to In Progress

#7 Updated by J. Moringen over 10 years ago

  • Description updated (diff)
  • Assignee set to S. Wrede

#8 Updated by S. Wrede over 10 years ago

  • Description updated (diff)
  • % Done changed from 70 to 100

Added a test case. While polymorphic informers and sending to sub-scopes are possible, the Java implementation currently does not check for sending events only to sub-scopes.

#9 Updated by S. Wrede over 10 years ago

  • Status changed from In Progress to Closed

#10 Updated by S. Wrede over 10 years ago

  • Status changed from Closed to In Progress
  • % Done changed from 100 to 90

#11 Updated by S. Wrede over 10 years ago

  • Description updated (diff)
  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Done in r2336.

Also available in: Atom PDF