Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Double dispatch
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===== SHAPE ===== The SHAPE class has the basis (e.g. drawing data) for what is drawn, perhaps on a SURFACE, but it does not have to be. Again, the agents provide the indirection and class agnostics required to make the co-variant relationship with SHAPE as decoupled as possible. Additionally, please take note of the fact that SHAPE only provides `drawing_data_agent' as a fully exported feature to any client. Therefore, the only way to interact with SHAPE, other than creation, is through the facilities of the `drawing_data_agent', which is used by ANY client to indirectly and polymorphically gather drawing data for the SHAPE! <syntaxhighlight lang="eiffel" line> deferred class SHAPE feature {NONE} -- Initialization make_with_color (a_color: like color) -- Make with `a_color' as `color'. do color := a_color drawing_data_agent := agent drawing_data ensure color_set: color.same_string (a_color) end feature -- Access drawing_data_agent: FUNCTION [ANY, TUPLE, like drawing_data] -- Data agent for drawing. feature {NONE} -- Implementation drawing_data: TUPLE [name: like name; color: like color] -- Data needed for drawing of Current. do Result := [name, color] end name: STRING -- Object name of Current. deferred end color: STRING -- Color of Current. end </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)