From 211d9b7e48e270d3bd5358a8f29564bf4e039133 Mon Sep 17 00:00:00 2001 From: halw Date: Sat, 7 Apr 2012 13:01:44 +0000 Subject: [PATCH] Changed assignment attempt in `Retrieval' to object test. Other minor corrections. Author:halw Date:2012-04-07T13:01:44.000000Z git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1065 abb3cda0-5349-4a8f-a601-0c33ac3a8c38 --- .../eiffelbase-tutorial/eiffelbase-kernel.wiki | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/documentation/current/solutions/basic-computing/eiffelbase/eiffelbase-tutorial/eiffelbase-kernel.wiki b/documentation/current/solutions/basic-computing/eiffelbase/eiffelbase-tutorial/eiffelbase-kernel.wiki index 5e656ca5..1df1b9eb 100644 --- a/documentation/current/solutions/basic-computing/eiffelbase/eiffelbase-tutorial/eiffelbase-kernel.wiki +++ b/documentation/current/solutions/basic-computing/eiffelbase/eiffelbase-tutorial/eiffelbase-kernel.wiki @@ -362,12 +362,19 @@ subsequent execution of the same system. If you need to store objects from a cer ==Retrieval== -You only need to be aware of the difference between basic and general store at storage time. The stored structure will always be available through feature retrieved; this feature will figure out, from the format of the stored structure, whether it was stored by basic_store or general_store, and will decode it accordingly.
-Feature retrieved returns a result of type [[ref:/libraries/base/reference/storable_chart|STORABLE]] and is typically used through an assignment attempt of the form -x ?= retrieved (my_descriptor) +You only need to be aware of the difference between basic and general store at storage time. The stored structure will always be available through feature retrieved; this feature will figure out, from the format of the stored structure, whether it was stored by basic_store, general_store, or independent_store and will decode it accordingly.
+Feature retrieved returns a result of type [[ref:/libraries/base/reference/any_chart|ANY]] and is typically used through an object test of the form + + if attached {SOME_EXPECTED_TYPE} retrieved (my_descriptor) as l_temp then +-- Retrieved result is of expected type +-- Proceed with processing of result, typically with calls of the form `l_temp.some_feature' + else +-- Result was not of expected type + end +
-The assignment attempt is necessary because retrieved returns a result of type [[ref:/libraries/base/reference/storable_chart|STORABLE]] whereas the type of x will be based on a proper descendant of [[ref:/libraries/base/reference/storable_chart|STORABLE]] . If the structure in the file has been corrupted and retrieved is unable to do its job, it will trigger an exception. The code for that exception in class [[ref:/libraries/base/reference/exceptions_chart|EXCEPTIONS]] (which inherits it from EXCEP_CONST and is discussed in the next section, together with the notion of exception code) is Retrieve_exception. +The object test is necessary because retrieved returns a result of type [[ref:/libraries/base/reference/any_chart|ANY]] whereas the type of x will be based on a proper descendant of [[ref:/libraries/base/reference/any_chart|ANY]] . If the structure in the file has been corrupted and retrieved is unable to do its job, it will trigger an exception. The code for that exception in class [[ref:/libraries/base/reference/exceptions_chart|EXCEPTIONS]] (which inherits it from EXCEP_CONST and is discussed in the next section, together with the notion of exception code) is Retrieve_exception. ==Recoverable storable==