Reputation
2,607
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
11 21
Impact
~214k people reached

Apr
4
comment Can the circle-ellipse problem be solved by reversing the relationship?
This answer is by far the best thing I've seen about the whole issue, and how the potential for design mistakes can arise in more general cases. Thanks
Apr
4
comment Can the circle-ellipse problem be solved by reversing the relationship?
@PhilipKendall I ask, because I am obviously missing it
Apr
4
comment Can the circle-ellipse problem be solved by reversing the relationship?
okay - so, if there were some common interface between Ellipse and Circle (such as getArea) that would be abstracted to a type Shape - could Ellipse and Circle separately subtype from Shape and satisfy LSP?
Apr
4
comment Can the circle-ellipse problem be solved by reversing the relationship?
Where in the article?
Apr
4
comment Can the circle-ellipse problem be solved by reversing the relationship?
yes - i even link it in my question...
Mar
31
comment For Object Oriented Programming purists, are @annotations heresy?
@JimmyJames - in my view, all code smells - but you only have to fix it when it is ripe ;) To put it another way, coupling with new (or annotations) could be an indicator that there is a design problem, but not always.
Mar
28
comment Where is password hashing/salt logic applied?
@Brian - as long as the client hashed password is sent over a secure connection - otherwise some could intercept it, and then just post it whenever they want.
Mar
28
comment Where is password hashing/salt logic applied?
The hash should not be generated at the client at all - sounds like a bad tutorial. The password should be sent via HTTPS and then salted/hashed and compared on the server
Mar
28
comment Is 'exercise bugs' an expression?
Exercise or exorcise?
Mar
21
comment Why do you have to specify the data type when declaring variables?
That's because English has implicit typing - so yourPhoneNumber is implicitly typed as a PhoneNumber - humans also have dynamic memory allocation... ;)
Mar
4
comment What defines the dimensionality of an array?
I did +1, but then retracted, as I think this falls foul of the notation used... [0, 0] does look like a one-dimensional array with 2 items, but mathematically it could be the indices of a two-dimensional array
Mar
3
comment Lower class count vs explicitness
@BenAaronson - no, they don't directly parse the XML - there is an XML parser class that they have access to. They just tell the parser how to get the query the document and, in some cases, further manipulate as necessary.
Mar
3
comment Lower class count vs explicitness
In any event - I've decided to go the explicit route, so that the next guy knows that when the <subgroup> XML structure changes, he can easily refer to the InteractionSubgroup class to change the code behaviour (there are actually 6 interaction types within the XML, all but the Group and Subgroup have distinct behaviours - and then there are other meaningful nodes like Chapter, etc, elsewhere in the document).
Mar
3
comment Lower class count vs explicitness
@radarbob "interaction" here is a word in the domain - as in "drug interaction" rather than describing behaviour between the OO classes.
Mar
3
comment Lower class count vs explicitness
@radarbob - hmm... maybe i oversimplified my pseudocode - those interface methods are very meaningful in our problem domain, and yes, those classes do the work of extracting information for processing by several different consumers and it made more sense to provide standardised interfaces rather than have the consumers set up all the xpath queries.
Mar
2
comment Lower class count vs explicitness
well, i don't need even need the XML attribute - one class, store the node name, and then have if statements... i'm guess i'm just wondering if, now i'm in for penny (some subclasses) I should just go in for a pound and have it one-to-one
Feb
16
comment Is it acceptable for user agents to modify cookies other than by instruction from the server?
@arnaud well, this was before local storage... there are probably still use cases out there, even if you think its "weird".
Feb
16
comment Is it acceptable for user agents to modify cookies other than by instruction from the server?
@arnaud - (a while ago) I supported a website that allowed the user to modify the font-size for viewing through a javascript widget that set/modified a cookie value to maintain consistency during the session.
Feb
12
comment Why use JSON dataset rather than SQL Query?
About the only thing I could think of is "security" - by preventing an external source accessing the SAP service directly, you can't have someone break into the SQL port and issue a DELETE statement... It's a bit of a naive solution, but there you go.
Feb
5
comment Child class accessing its parent's method from Ancestor method
I think the start of your trouble is conflating hierarchy in a file directory with hierarchy in class inheritance, and now you're trying to overcome that by some awkward contortions. Could you provide (simplified - even pseudo-code) source code for all three classes and a description of how the objects relate to the paths and what you want them to do.