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

Use URL as duck types, refer to W3C. #5

Open
huan opened this issue Mar 24, 2024 · 0 comments
Open

Use URL as duck types, refer to W3C. #5

huan opened this issue Mar 24, 2024 · 0 comments
Assignees

Comments

@huan
Copy link
Member

huan commented Mar 24, 2024

Centralization in social systems can apply to concepts, too. For example, if we make a knowledge representation system which requires anyone who uses the concept of "automobile" to use the term "http://www.kr.org/stds/industry/automobile" then we restrict the set of uses of the system to those for whom this particular formulation of what an automobile is works. The Semantic Web must avoid such conceptual bottlenecks just as the Internet avoids such network bottlenecks.
Source: Principles of Design, Tim Berners-Lee, 1998

Current, we are using the ${NPM_NAME}/${TYPE} to identify the Duck Type, like this:

export const GET_CONTACT_PAYLOAD_QUERY = 'cqrs-wechaty/GET_CONTACT_PAYLOAD_QUERY'  // contactPayload

In the future, we should use ${URL}/${TYPE} instead of NPM_NAME because the system might run with different languages, which will have some possibility of hitting the type conflicting.

Using URL will eliminate potential problems like this:

export const GET_CONTACT_PAYLOAD_QUERY = 'https://wechaty.js.org/cqrs/GET_CONTACT_PAYLOAD_QUERY'  // contactPayload
@huan huan self-assigned this Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant