Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work out the design for the virtual object initialization API #1973

Closed
FUDCo opened this issue Nov 4, 2020 · 4 comments
Closed

Work out the design for the virtual object initialization API #1973

FUDCo opened this issue Nov 4, 2020 · 4 comments
Assignees
Labels
SwingSet package: SwingSet

Comments

@FUDCo
Copy link
Contributor

FUDCo commented Nov 4, 2020

In #1960 we've been having a debate about the proper design of the API for initializing virtual objects (please see that issue for the discussion thread leading up to this). However, that issue was actually just a PR for some updates to the documentation, hence not really the right place to try to resolve the API design question. The correct issue to do that is right here.

@FUDCo FUDCo added the SwingSet package: SwingSet label Nov 4, 2020
@FUDCo FUDCo self-assigned this Nov 4, 2020
@FUDCo
Copy link
Contributor Author

FUDCo commented Nov 4, 2020

@erights @warner @michaelfig

@FUDCo
Copy link
Contributor Author

FUDCo commented Nov 4, 2020

To summarize: @erights is displeased with two aspects of the current design: (1) contamination of the developer's namespace for methods on their virtual objects by having initialization flow through a special method named initialize, and (2) magically tinkering with the object that defines the virtual object's behavior by deleting the special initialize method from it so that it won't be exposed to holders of references to the virtual object.

Mark, am I fairly summarizing your concerns?

@FUDCo
Copy link
Contributor Author

FUDCo commented Nov 4, 2020

In a conversation with @warner this afternoon, he suggested we might mitigate the namespace concern by keying the initialization method with a symbol available from the makeKind function, e.g., [makeKind.initialize] or some such. This would not address the concern about having a magic method, but wouldn't be a name that a virtual object developer would want to otherwise use.

@FUDCo
Copy link
Contributor Author

FUDCo commented Nov 5, 2020

Closed by #1967

@FUDCo FUDCo closed this as completed Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SwingSet package: SwingSet
Projects
None yet
Development

No branches or pull requests

1 participant