255 reputation
28
bio website
location Los Angeles, CA
age
visits member for 3 years, 6 months
seen 7 mins ago

Dec
1
comment Definition of a type
Thanks! It's hard for me to understand at this point, but I hope to reread this when I am more comfortable with the concepts you use. BTW, might you perhaps have swapped the "nominal" and "structural" terms? Or I misunderstood their meaning.
Dec
1
accepted Definition of a type
Nov
26
asked Definition of a type
Nov
2
awarded  Yearling
Apr
23
awarded  Teacher
Apr
23
revised Defensive Programming vs Exception Handling?
added 1592 characters in body
Apr
23
answered Defensive Programming vs Exception Handling?
Feb
26
awarded  Constituent
Feb
26
awarded  Caucus
Jan
28
accepted Representing complex object dependencies
Jan
24
comment Automated object creation from user input
I'm going to give approach 1 a try. I'm a bit skeptical because I haven't seen it mentioned anywhere.
Jan
22
comment Automated object creation from user input
So all user input would be converted to a mulit-level (nested) dictionary structure, and passed to the application? That would be very similar to what I'm trying now with approach 2, right? Would you allow each class to grab only the items in one level of this structure, or to look as deep as it wants?
Jan
22
comment Automated object creation from user input
@SpaceTrucker Unless I missed something, it doesn't support any hierarchy of used defined parameters. If so, it may be quite good for command line parsing but perhaps insufficient for a more heavy-duty configuration file that I need.
Jan
22
comment Automated object creation from user input
Based on your comment, I'm now thinking to give each class a choice. It it wants, it can do nothing, and the input will be parsed following approach 1 coded in the base class' method parse. Alternatively, it can override parse method with an alternative parsing logic, following approach 2 (of course, if it then needs to create an instance of class that didn't override parse, it will need to supply it with something that looks like a sub-branch of a configuration file). Does this sound reasonable?
Jan
22
comment Automated object creation from user input
Originally, I followed precisely the same approach (key-value pairs). However, this caused name collisions in keys (e.g., strength in my example) as well as some other problems.
Jan
22
comment Representing complex object dependencies
Assuming I got the right definition of IoC, how can I apply to my problem?
Jan
22
comment Representing complex object dependencies
Yeah I can try that, but it's a bit hard to change the design to allow the objects to mutate.
Jan
22
comment Representing complex object dependencies
Thanks I'll look at these patterns. Specifically with IoC, there's a lot of references that define it somewhat differently; if you have any specific link that describes precisely the pattern you have in mind, please let me know.
Jan
22
comment Representing complex object dependencies
Interesting approach. What's the advantage of using strategies (callbacks that return an instance) instead of the instances themselves?
Jan
22
asked Automated object creation from user input