{"action":"closed","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/1930","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1930/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1930/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1930/events","html_url":"https://github.com/realm/realm-cocoa/issues/1930","id":75927725,"number":1930,"title":"Nesting of objects","user":{"login":"depl0y","id":111713,"avatar_url":"https://avatars.githubusercontent.com/u/111713?v=3","gravatar_id":"","url":"https://api.github.com/users/depl0y","html_url":"https://github.com/depl0y","followers_url":"https://api.github.com/users/depl0y/followers","following_url":"https://api.github.com/users/depl0y/following{/other_user}","gists_url":"https://api.github.com/users/depl0y/gists{/gist_id}","starred_url":"https://api.github.com/users/depl0y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/depl0y/subscriptions","organizations_url":"https://api.github.com/users/depl0y/orgs","repos_url":"https://api.github.com/users/depl0y/repos","events_url":"https://api.github.com/users/depl0y/events{/privacy}","received_events_url":"https://api.github.com/users/depl0y/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/pending","name":"pending","color":"ededed"},{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-05-13T10:02:38Z","updated_at":"2015-05-13T21:46:07Z","closed_at":"2015-05-13T21:46:07Z","body":"I have been working on a PR that will make RealmSwift support nesting of `Object` classes.\r\n\r\nCurrently it works like this:\r\n\r\n```\r\nimport RealmSwift\r\n\r\npublic class DemoObject: Object {\r\n\t\r\n\tdynamic var name: String = \"DemoObjectName\"\r\n\t\r\n\tpublic class NestedObject: Object {\r\n\t\t\r\n\t\tdynamic var name: String = \"NestedObjectName\"\r\n\t\t\r\n\t}\r\n}\r\n\r\nextension DemoObject {\r\n\t\r\n\t public class NestedObject2: Object {\r\n\t\tdynamic var name: String = \"NestedObject2Name\"\r\n\t}\r\n\t\r\n}\r\n```\r\n\r\nThis results in the tables **`DemoObject`**, **`NestedObject`** and **`NestedObject2`**. But because you can now nest classes, this will cause clashes with other nested classes with the same name (mostly the reason to perform nesting is the naming clashes).\r\n\r\nWhat would be a good naming convention for the tables? Are there already any thoughts about the way this should be done?\r\n\r\nMy proposal would be to use something like **`DemoObject.NestedObject`** and **`DemoObject.NestedObject2`** as table names.\r\n\r\nWhat are your thoughts about this?"}}