| bio | website | |
|---|---|---|
| location | Melbourne, Australia | |
| age | 43 | |
| visits | member for | 1 year, 7 months |
| seen | Feb 7 at 13:27 | |
| stats | profile views | 319 |
By day, a mild-mannered software developer with a keen interest in those areas of computer science that deal with the psychology of human machine interaction, and how that affects the processes and principals which we apply to create useful software.
By night, I imagine I'm the coding rebel, defying all conventions and "sticking it" to "the man" while liberating the free-thinking and allegedly down-trodden cube rats that I resemble during the day!! Or, I have a vivid imagination and way too much time on my hands! ;-)
|
Feb 25 |
awarded | Nice Answer |
|
Feb 23 |
awarded | Nice Answer |
|
Feb 7 |
comment |
functional requirements - use wording based on verbs? @PeteKirkham You've described a hardware issue. Specifically a specification of form, not of function. This does not invalidate my answer to the OP's question which is about functional specification. Addressing the case you have described however, your functional specification might be "Given 'Software Configuration X', When CPU usage exceeds (a pre-specified limitation & time), Then Expect System Failure". Better yet, replace "system failure" with a "recovery process" to specify how to avoid failure. Sometimes we need to think a little creatively in order to uncover specific behaviours. :-) |
|
Dec 3 |
answered | Test driven vs Business requirements constant changing |
|
Dec 1 |
answered | How do you keep track of a requirements document on an agile team? |
|
Nov 29 |
answered | What to do when a project is too difficult to continue developing? |
|
Nov 28 |
answered | Am I considered “technical”? |
|
Nov 27 |
awarded | Good Answer |
|
Nov 27 |
comment |
What should be allowed inside getters and setters? To avoid having too many comments here, I'll take this conversation into this chat and address your comment there. |
|
Nov 27 |
comment |
What should be allowed inside getters and setters? I've created a Chat Session to allow these comments to continue as needed. |
|
Nov 27 |
comment |
What should be allowed inside getters and setters? @methodman Yes, I agree that a public field is wrong, however a public property can be useful. That property can be used to provide a place for validation or events related to the setting or returning of the data, depending on the specific requirement at the time. Getters and setters themselves aren't wrong per-se. How and when they are used or abused on the other hand can be seen as poor in terms of design and maintainability depending on the circumstances. :) |
|
Nov 27 |
comment |
What should be allowed inside getters and setters? I think you're missing the point of the article, which suggests using getters/setters sparingly and to avoid exposing class data unless necessary. This IMHO is a sensible design principle which should be applied deliberately by the developer. In terms of creating properties on a class, you could simply expose a variable, but this makes it harder to provide validation when the variable is set, or to draw the value from an alternate source when "got", essentially violating encapsulation, and potentially locking you into a difficult to maintain interface design. |
|
Nov 26 |
revised |
What should be allowed inside getters and setters? Corrected Spelling |
|
Nov 26 |
comment |
What should be allowed inside getters and setters? @glenatron You miss the point that I'm writing about. Side effects within properties aren't always predictable. When you set a property Value, you expect that same value to be returned. When you call a function that may use a value, then you assume the output won't necessarily be that value itself. |
|
Nov 26 |
comment |
What should be allowed inside getters and setters? @MarkByers You may wish to validate input of floating point values by applying a rule that only a fixed number of decimal places is allowed. In that circumstance, you could either raise an exception if too many decimal places are input, or you could simply round the input value. This may be preferable to raising an exception. I agree though that the sentence you've quoted probably needs to be modified. I'll think about this and edit. :) |
|
Nov 26 |
awarded | Nice Answer |
|
Nov 25 |
revised |
Is there a term for “Use procedures that execute a single task”? grammatical correction |
|
Nov 25 |
comment |
What should be allowed inside getters and setters? There are a couple of problems with this. Arbitrarily setting a value creates a deliberate and unclear side-effect. Also, it doesn't allow the calling code to receive feedback which could be used to better deal with illegal data. This is particularly important with values at the UI level. To be fair though, one exception I just thought of could be if allowing multiple date formats as an input, while storing the date in a standard date/time format. One could at a stretch argue that this particular "side effect" is a normalization of the data at validation, provided the input data is legal. |
|
Nov 25 |
answered | Is there a term for “Use procedures that execute a single task”? |
|
Nov 25 |
answered | What should be allowed inside getters and setters? |