Timeline for Is there a pattern to describe a class that symbolises an instance of an instance of another class?
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 22, 2018 at 7:34 | comment | added | TZubiri | "A job takes a particular Template, allows assigning values to the personaliseable fields and renders a video using these values. To me, it makes sense that a Job would be an instance of an instance of Template." To me, it sounds like a job would be a function that takes a template as the first parameter along with a collection of the personalizable fields as a second parameter. | |
Nov 22, 2018 at 7:32 | comment | added | TZubiri | "It seems natural to have a Template class that contains all the info of how this specific template is structured (e.g. which parts are personaliseable, what assets are required etc...)." The template, as described by yourself in the preceding paragraph, should hold a collection of assets and a json. What is this about a template being personalisable? | |
Nov 22, 2018 at 7:27 | comment | added | TZubiri | An instance of a class is an object. What is an instance of an object? | |
Jul 12, 2018 at 19:50 | vote | accept | Jan Hettenkofer | ||
Jul 9, 2018 at 18:49 | comment | added | Berin Loritsch |
I think you are overloading the word instance to mean two very different things. However, you are talking about Template is if it were a class, and a Job as if it were an object. The fact that Template is itself an instance of an object isn't relevant to helping understand the concept.
|
|
Jul 8, 2018 at 12:09 | comment | added | Jan Hettenkofer | @radarbob Yes, the thing I had in mind would have been to inherit from a class generated completely at runtime (derived from another class but with certain properties filled in). However this doesn't seem to be possible in TypeScript and would also be unnecessarily complicated. I added an answer describing the solution I opted for. | |
Jul 8, 2018 at 12:05 | answer | added | Jan Hettenkofer | timeline score: 0 | |
Jul 8, 2018 at 5:04 | comment | added | radarbob | "Is there a pattern to describe a class that symbolises an instance of an instance of another class?" Inheritance. | |
Jul 7, 2018 at 6:18 | answer | added | Thomas Junk | timeline score: 0 | |
Jul 7, 2018 at 0:34 | answer | added | kamikaze | timeline score: 3 | |
Jul 6, 2018 at 20:29 | review | First posts | |||
Jul 6, 2018 at 21:15 | |||||
Jul 6, 2018 at 20:28 | history | asked | Jan Hettenkofer | CC BY-SA 4.0 |