{"action":"created","issue":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-design/issues/59","labels_url":"https://api.github.com/repos/ckeditor/ckeditor5-design/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/ckeditor/ckeditor5-design/issues/59/comments","events_url":"https://api.github.com/repos/ckeditor/ckeditor5-design/issues/59/events","html_url":"https://github.com/ckeditor/ckeditor5-design/issues/59","id":82378145,"number":59,"title":"Data API naming","user":{"login":"pjasiun","id":1166967,"avatar_url":"https://avatars.githubusercontent.com/u/1166967?v=3","gravatar_id":"","url":"https://api.github.com/users/pjasiun","html_url":"https://github.com/pjasiun","followers_url":"https://api.github.com/users/pjasiun/followers","following_url":"https://api.github.com/users/pjasiun/following{/other_user}","gists_url":"https://api.github.com/users/pjasiun/gists{/gist_id}","starred_url":"https://api.github.com/users/pjasiun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjasiun/subscriptions","organizations_url":"https://api.github.com/users/pjasiun/orgs","repos_url":"https://api.github.com/users/pjasiun/repos","events_url":"https://api.github.com/users/pjasiun/events{/privacy}","received_events_url":"https://api.github.com/users/pjasiun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-29T10:50:20Z","updated_at":"2015-06-15T13:06:26Z","closed_at":null,"body":"![image](https://cloud.githubusercontent.com/assets/1166967/7880242/11b05068-05f8-11e5-885f-e48dfaf75e01.png)\r\n\r\nWe need to give our children names. We will take care of them for a few years. \r\n\r\nAt the moment we have a naming collision issue:\r\n - `document` means both DOM document and model document (which contains both linear data and document tree) and most probably we may have a DOM document wrapper too,\r\n - `data` is linear data and the data we will put to `setData`, so the (input) data will be transformed to HTML and it will be transformed to (linear) data,\r\n - `attribute` is an HTML attribute or linear data attributes,\r\n - `Node` is DOM node and document model node (which can refer to multiple DOM nodes in case of the `TextNode`), but the parent of the DOM node is `element` while the parent of the document model node is `branch` at the moment. And again, we may have a DOM node wrapper too.\r\n\r\nWe need some unique names, I believe the even some random letter are better then the collided name (see `acf` is better then one more `filter`). And the same names should be used everywhere: in the code, comments and documentation.\r\n\r\nThink about writing a documentation for transformation DOM node to document model node. We need one way how we call them, so users do not need to guess if 'document node' is 'model node' or 'DOM node'. And, of course, reading the code where you have just `node` variable is unnecessarily hard. \r\n\r\nWe could use prefixes like we do now for native elements. So `$node` will be a native node, `Node` will be a data model node and `DOMNode` will be a native node wrapper. We could use \"Native Node\", \"Model Node\" and \"DOM Node\" in the text.\r\nFor document it can be the same: `$document`, `DOMDocument` and `Document`, but maybe we could find the better name for the last one. `DocumentModel` or `Model`?\r\nFor data: `data` for input data, `linearData` for the whole structure and `linearDataItem` the the item: letter, opening or closing tag (no `ldi` because lower \"L\" is bad in such shortcut),\r\nFor attributes: `$attribute` and `linearDataAttribute`.\r\n\r\nBut I hope we can find something better together."},"comment":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-design/issues/comments/112063542","html_url":"https://github.com/ckeditor/ckeditor5-design/issues/59#issuecomment-112063542","issue_url":"https://api.github.com/repos/ckeditor/ckeditor5-design/issues/59","id":112063542,"user":{"login":"pjasiun","id":1166967,"avatar_url":"https://avatars.githubusercontent.com/u/1166967?v=3","gravatar_id":"","url":"https://api.github.com/users/pjasiun","html_url":"https://github.com/pjasiun","followers_url":"https://api.github.com/users/pjasiun/followers","following_url":"https://api.github.com/users/pjasiun/following{/other_user}","gists_url":"https://api.github.com/users/pjasiun/gists{/gist_id}","starred_url":"https://api.github.com/users/pjasiun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjasiun/subscriptions","organizations_url":"https://api.github.com/users/pjasiun/orgs","repos_url":"https://api.github.com/users/pjasiun/repos","events_url":"https://api.github.com/users/pjasiun/events{/privacy}","received_events_url":"https://api.github.com/users/pjasiun/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T13:06:26Z","updated_at":"2015-06-15T13:06:26Z","body":"We decided that all names related to the native elements will be prefixed with `$`, related to wrapped native elements will be prefixed with `w` and document model elements will have no prefix, so:\r\n - `$element` is native DOM element,\r\n - `wElement` is wrapped DOM element,\r\n - `element` is Document Model element.\r\n\r\nThe same way we have:\r\n - `$document` - native DOM document, also `$attr`, `$evt`\r\n - `wDocument` - wrapped DOM documet, also `wAttr`, `wEvt` (if needed)\r\n - `document` - Data Model Document, also `attr`, `evt`.\r\n\r\nMoreover there will be `wrap()` function to create a wrapped element based on the native one.\r\n\r\nThe only part which is not yet agreed is how to distinguish input data and Data Model data."}}