+
Point of view
All features
deferred class REPOSITORY [O_ -> STORABLE]
Summary
A REPOSITORY for objects of type O_ can be viewed as a DICTIONARY[O_, STRING] (i.e. objects of type O_ are stored using key names which are actually ordinary STRINGs). Also note that stored objects of type O_ are always non-Void objects.
A repository is meant to be stored on a physical store (say, a stream, a file, a database and so on).
See also XML_FILE_REPOSITORY, XML_STREAM_REPOSITORY.
Direct parents
Insert list: ANY
Known children
Inherit list: REPOSITORY_IMPL
Class invariant
Overview
Features
Getting and setting objects in the repository:
{ANY}
  • has (object_name: STRING): BOOLEAN
    Is object_name the name of some stored object.
  • at (object_name: STRING): O_
    Return the object currently associated to object_name.
  • add (object: O_, object_name: STRING)
    Add a new object in the Current repository.
  • put (object: O_, object_name: STRING) assign at
    Update or add a new object in the Current repository.
  • remove (object_name: STRING)
    Remove entry object_name from the Current repository.
Counting:
{ANY}
Iterating facilities:
{ANY}
Really storing data:
{ANY}
  • update
    Update the repository objects.
  • commit
    Commit all the repository objects to the physical store.
  • is_connected: BOOLEAN
    True if the repository is connected to a physical store.
  • is_updateable: BOOLEAN
    True if the repository can be updated from data in the physical store.
  • is_commitable: BOOLEAN
    True if the repository can be committed to the underlying physical store.
Implementation
{}
has (object_name: STRING): BOOLEAN
frozen
effective function
{ANY}
Is object_name the name of some stored object.
require
  • not object_name.is_empty
at (object_name: STRING): O_
frozen
effective function
{ANY}
Return the object currently associated to object_name.
require
  • has(object_name)
ensure
  • Result /= Void
add (object: O_, object_name: STRING)
frozen
effective procedure
{ANY}
Add a new object in the Current repository.
require
  • object /= Void
  • new_reference: not has(object_name)
ensure
  • reference_stored: object = at(object_name)
put (object: O_, object_name: STRING) assign at
frozen
effective procedure
{ANY}
Update or add a new object in the Current repository.
require
  • object /= Void
ensure
  • reference_stored: object = at(object_name)
remove (object_name: STRING)
effective procedure
{ANY}
Remove entry object_name from the Current repository.
require
  • has(object_name)
ensure
  • not has(object_name)
count: INTEGER_32
effective function
{ANY}
Actual count of stored elements.
is_empty: BOOLEAN
effective function
{ANY}
Is it empty ?
ensure
lower: INTEGER_32
is 1
constant attribute
{ANY}
upper: INTEGER_32
effective function
{ANY}
ensure
valid_index (index: INTEGER_32): BOOLEAN
effective function
{ANY}
ensure
item (index: INTEGER_32): O_
effective function
{ANY}
require ensure
key (index: INTEGER_32): STRING
effective function
{ANY}
require ensure
new_iterator_on_items: ITERATOR[O_]
effective function
{ANY}
ensure
  • Result /= Void
new_iterator_on_keys: ITERATOR[STRING]
effective function
{ANY}
ensure
  • Result /= Void
key_map_in (buffer: COLLECTION[STRING])
effective procedure
{ANY}
Append in buffer, all available keys (this may be useful to speed up the traversal).
require
  • buffer /= Void
ensure
  • buffer.count = count + old buffer.count
item_map_in (buffer: COLLECTION[O_])
effective procedure
{ANY}
Append in buffer, all available items (this may be useful to speed up the traversal).
require
  • buffer /= Void
ensure
  • buffer.count = count + old buffer.count
update
deferred procedure
{ANY}
Update the repository objects.
Get all objects from the physical store.
require
commit
deferred procedure
{ANY}
Commit all the repository objects to the physical store.
require
is_connected: BOOLEAN
deferred function
{ANY}
True if the repository is connected to a physical store.
is_updateable: BOOLEAN
deferred function
{ANY}
True if the repository can be updated from data in the physical store.
ensure
is_commitable: BOOLEAN
deferred function
{ANY}
True if the repository can be committed to the underlying physical store.
ensure
repository: DICTIONARY[O_, STRING]
writable attribute
{}
objects_are_expanded: BOOLEAN
effective function
{}