Timeline for What are the tradeoffs between a Union type or a wrapper Class to represent a formatted string argument representing multiple types
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 15, 2022 at 4:06 | comment | added | Jae Bradley |
My intent was to convey that the integer values are unique for all foo prefixes and all bar prefixes (in this hypothetical example). Assume the process method takes a String value in the form tableA#primaryKey or tableB#primaryKey . I'm going through the tradeoffs of replacing that String with some non-String model object.
|
|
Jun 15, 2022 at 0:26 | history | edited | candied_orange | CC BY-SA 4.0 |
deleted 2 characters in body
|
Jun 15, 2022 at 0:18 | history | edited | candied_orange | CC BY-SA 4.0 |
added 9 characters in body
|
Jun 14, 2022 at 22:30 | comment | added | candied_orange | If the integer values are not unique then they aren’t IDs. You made them unique when you made them enum’s. Note edit. | |
Jun 14, 2022 at 22:27 | history | edited | candied_orange | CC BY-SA 4.0 |
added 297 characters in body
|
Jun 14, 2022 at 21:33 | comment | added | Jae Bradley | I'm not following do you mind explaining "If you scatter around a lot of type testing code you're right back to adding BazId being difficult." ? Also, "So what we're left with is each Id class must declare it's own number. And carefully avoid using any other Id class's number." is unclear to me - I never said there were any requirements around integer value uniqueness. In fact, in my examples, I intentionally used the same integer id values. | |
Jun 14, 2022 at 21:24 | history | edited | Robert Harvey | CC BY-SA 4.0 |
added 1 character in body
|
Jun 14, 2022 at 20:59 | history | answered | candied_orange | CC BY-SA 4.0 |