Timeline for How to store/deal with data available to other classes
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 19, 2014 at 20:27 | vote | accept | Vahid | ||
| Dec 19, 2014 at 17:19 | answer | added | Magus | timeline score: 4 | |
| Dec 19, 2014 at 15:52 | history | tweeted | twitter.com/#!/StackProgrammer/status/545970030048215041 | ||
| Dec 19, 2014 at 15:50 | comment | added | Arseni Mourzenko | You can use dependency injection to pass the instance of the class to the methods which need it. | |
| Dec 19, 2014 at 15:45 | comment | added | Vahid | How can I persist the data? Should I use a singleton pattern? | |
| Dec 19, 2014 at 15:34 | comment | added | Arseni Mourzenko | A few notes: (1) Building shouldn't be static. (2) You shouldn't have GetX() or SetX() methods in C#: use getters and setters instead. (3) Your List<T>-type fields can be readonly. (4) You shouldn't return List<T> in GetColumns: use a more generic type, such as IEnumerable<T>. (5) Don't use List<T> in parameters: use a more generic type, such as ICollection<T>. (6) void Group() may not be that intuitive, especially given the popularity of IEnumerable<T>.GroupBy() which returns a value instead of modifying state. | |
| Dec 19, 2014 at 15:00 | history | asked | Vahid | CC BY-SA 3.0 |