Talk:Eiffel Design Feast June-2011

Revision as of 05:46, 22 June 2011 by Alexander Kogtenkov (Talk | contribs) (Library support for efficient processing: Added an example for separate streams.)

Feel free to add suggestion here.

--Jocelyn 12:56, 22 June 2011 (UTC) What about porting Goanna to EiffelWebReloaded (and at the same time, update it to be support standard syntax, and 6.8 compiler). Actually Goanna would benefit from extracting the connector implementation from the main libraries (servlet, ...), and then it could fit nicely with EiffelWebReloaded, where you can choose which "connector" you want to use (and compile). The Goanna connectors (Fast_CGI, CGI, Standalone), could then be redesigned to be valid EiffelWebReloaded connectors.

Library support for efficient processing (Alexander Kogtenkov 13:42, 22 June 2011 (UTC))

Background. Web technologies are using streams and text messages for interaction between participans be they computers, devices or humans. Usually this involves reading incoming text information, i.e. parsing, and writing outbound data, i.e. generation. Because of the text nature both extensively work with strings that are represented in one way or another.

Idea. Current interface of string classes assumes all the strings are manipulated like objects. There is no way to pass a half of the string from the reader or to the writer. The interface can be enhanced to manipulate substrings instead of the complete strings. Additional string objects can also be avoided if a writer is passed directly, so that one can write directly to the output rather than create a temporary object that will be processed somewhere else. Finally, string cloning can be avoided if the features accept separate objects. Because separate arguments are locked during the call it should be safe to retrieve any required informtion directly from the separate string/stream without any additional overhead.

Explanation. Different contexts that may benefit from adding some new features to the core classes are listed in the table below.

Description Example
Current Proposed
1 Avoid creating objects for substrings.
t := s.substring (i, j)
buffer.append_string (t)
buffer.append_substring (s, i, j)
2 Write to streams instead of intermediate strings.
out: STRING
   do ... end
out_to (stream: STREAM)
   do ... end
3 Support strings/streams from different processors.
append_string (s: STRING)
   do ... end
 
out_to (s: STREAM)
   do ... end
append_string (s: separate STRING)
   do ... end
 
out_to (s: separate STREAM)
   do ... end