Comments (4)
I think a standard naming syntax makes sense as long as it is just a part of the project. Developers should have a choice in which syntax they follow.
The <event-namespace>.<event-target>-<event-name>
syntax works well for JET, but the event namespace seems redundant and unnecessary within the core NGN lib. Each of the components are their own namespace. The exception to this are data stores, which relay events from models to the store. In this case, they are already namespaced, though they use record.
instead of model.
.
from ngn.
Agreed on the first point.
I didn't mention it, but my intent was for the first two portions to be optional, ie only added when necessary. I just want to make sure that any events that do fire are descriptive enough that its obvious what they are doing, ie I don't wanna see a random event called "update" for example (maybe that is already the case).
The only other thing I want to look at is what we're actually naming things, and then make sure we are consistent. For example, in NGNX we have this common pattern:
this.properties.on('field.update', change => {...})
This makes total sense with NGN Data Models v1, although without knowledge of those, an event called "property.update" would make more sense to a user in this instance. I'd like to open up some discussion about the overall nomenclature so that we have synchronicity between all these different elements (again, mostly specific to JET).
from ngn.
On that note, should this issue be moved to JET?
from ngn.
I think an overview of the current event naming syntax is warranted. Your point about this.properties
makes sense. That particular event would be relevant to JET, but it originates in the data model. In NGN 2, we can also have stores to represent properties, and we now have a relay function. The relay function would be more appropriate in this case because it would allow us to rename events within the context of how they're being relayed "up the chain".
I think this issue is a good place to keep track of our conversation. As we conclude around specific points, they should be added to the original issue. In the meantime, I will add this issue to the roadmap for NGN 2.
Additionally, for discussion purposes, I could extract all the events from NGN 2 via metadoc.... but it would be alot nicer if the doc site was done :)
from ngn.
Related Issues (20)
- NGN.DATA.Store#forEach
- Function Library (core?)
- NGN.DATA Date Type
- Iodine
- Loading Nested Models
- JSON/XML Schema Support
- Data Virtual Fields
- NGN.needs Fails in IE 11 due to MissingDependencyError HOT 1
- NGN.DATA.View & NGN.DATA.MaterializedView
- Data Model & Store Updates
- NGN.NET Redirect Cache
- Inaccessible documentation HOT 1
- EE.forward pooling behavior
- NGN.EventEmitter Separator HOT 1
- ReferenceError: require is not defined HOT 1
- No default jsDelivr CDN file set
- Auto-recognize custom errors on NGN Ledger
- Class Parents, Children, and Siblings
- Export Map
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngn.