6,699 reputation
32130
bio website softwareonastring.com
location Netherlands
age 53
visits member for 4 years, 7 months
seen 1 hour ago

Software developer since 1985. Started in Cobol, moved via Clipper/VB to Delphi. Delphi developer since 1998. Sniffing at C# and playing around with javascript and some php for websites. Coaching new employees and less experienced developers. Focused on software architecture and SOLID design. Keenly interested in user experience and usability.

Questions

When you ask a question, show your effort, provide all the details that will help someone to help you and be precise.

Answers

When you answer a question, don't just paste your code. Your answers will be much better when you explain why your code is doing what it does and how it achieves the asker's goal. It makes it a whole lot easier to follow along. As it is I am much more inclined to up-vote answers that have explanatory text about what the code is doing and why it is written as it is.

Answers that just contain links aren't likely to get an up-vote from me either

Other

Obligatory link whenever someone thinks they are improving security by imposing all sorts of rules on password composition: Password strength


6h
comment Two way communication between Form and plugins
No time to go into any detail now, so comment instead of answer. They way you make every Panel (or UserControl as suggested by CurtisHx) able to receive information from the main form, and/or to add menu items to the main form is to turn it onto its head: make all panels/UserControls implement an interface that allows the mainform to ask each one for any menu items it wants to add and allows the mainform to "broadcast" information from other panels to anyone interested. The latter is the published-subscriber pattern: every panel automatically becomes a subscriber of the mainform.
Apr
8
comment Should one use Dependency Injection even if the class is used only once?
dependency injection need not be centralized at all (see other answers). And even though this class may be used only once, it still needs to be tested for its behavior. Plus, more importantly, the class using it needs to be tested. And though you could test both classes through the outer one (the one aggregating the other class), your test classes and cases will be much simpler if you focus them on a single class. Which means that the outer class needs to be tested only for its own behavior and its interaction with the inner class. And that automatically is an argument for some form of DI.
Apr
8
comment Unit testing and reusing extracted class
DO test this class to check that it actually uses the classes it is aggregating/composing and to ensure that it keeps doing that. Injecting your creator classes is going to make that a lot easier. I'd even go as far as to see that without a mocking framework that can fake on the fly, you have no option but to use injection. So your option 3.
Apr
8
comment Abstract Web API from validation and configuration management in embedded system
You seem to be on a nice track, but could you please enlighten me wrt the meaning of TAD? Google is bringing up stuff that doesn't make much sense in the context of your question.
Apr
6
comment Unit test strategy for layered (or derived) method calls
Almost two years on, I am in a more lenient mood :) Here's a discussion with a code example: Testing strategy for validation and action methods. C# example, but shouldn't be too difficult to adapt to language of choice.
Apr
3
comment Receive data using TcpListener and TcpClient and distinguish between file and raw data
In the server you can read from the client stream (ns in your example) in the same way as the client reads from fileStream. IIRC the second argument to the fileStream.Read call is the starting position. You could easily look that up using the documentation on the Stream classes and interfaces.
Mar
28
comment TDD - Outside In vs Inside Out
Interesting. How did you reach the conclusion that outside in TDD is "mockist" TDD? I very much prefer Outside-In thinking and design and thus testing (see softwareonastring.com/2015/01/10/…) yet the Fowler article firmly puts me with Fowler in the classicist camp. While mockist may always use an outside-in approach, you can't turn it around and say that outside-in design and testing is mockist TDD. Outside-in can be and very much is practised by classicist TDD-ers as well.
Mar
16
comment Should we test all our methods?
Why would you check that your DAL has only been called once?
Feb
20
comment Cheap implementations in fundamental TDD
@alfe and to answer your question of how strict you should apply something: dogma is never the answer to anything. Keep using your brain. When you start to rely on strict dogmatic application of anything, everybody loses.
Feb
20
comment Cheap implementations in fundamental TDD
@alfe What then: you add more test cases. TDD doesn't require you to be complete from the start. In fact it specifically allows for requirements and implementations to change over time and to be refactored / added to with changes in perception of what the behavior should be. Test cases that test for behavior that is later found to be redundant can and should be removed. Test cases are a living breathing code base, just like the production code. Think of them as the dynamic documentation of your requirements (which change over time) and as a history of bugs solved.
Feb
20
comment Cheap implementations in fundamental TDD
@alfe instead of expanding an existing test case, you can always add an extra one. Each test should cover just one aspect of a function/method. Doesn't mean there can only be one assert (it often takes more than one assert to verify an aspect); but your second scenario should probably have its own test method within the testclass instead of being added to the first.
Feb
20
comment Cheap implementations in fundamental TDD
@Alfe "... or write the correct solution anyway" How would you know it is correct and more importantly that it remains correct? Quite often ensuring proper test cases before hand may seem "over the top" for the initial implementation, but they start shining when someone inadvertently makes a change that introduce a bug and that bug goes unnoticed because the test cases where done after the fact and may well suffer from myopia by the developer who thought (s)he was already done.
Jan
26
comment Two contradicting definitions of Interface Segregation Principle – which one is correct?
Cool @user61852 :) (and thanks for the credit)
Nov
7
comment In an Agile Environment, who is responsible for software architecture
Because of the questions like @DaveHillier poses, I tend to use "s/he"... (Thanks for this great answer by the way, puts reality back into the "the team is/does/has/owns ..." cliches)
Sep
27
comment Are any top software products outsourced? (offshore or otherwise)
@RossPatterson: Where does it say that they our outsourcing development of their virtualization solution? I may be reading it wrong (just scanned it really), but I see MS outsourcing the operation of their virtualization platform, not the development of it?
Jul
19
comment Organizing solution / project structure and classes for Line of Business Application (LOB)
In this case I don't agree with the YAren'tGNI approach. Separation of concerns is far easier to achieve and keep up when unrelated code is in separate assemblies. And of course separation of concerns helps achieving better design with high cohesion and low coupling. Having to add an assembly in your references makes dependencies visible and makes it harder for dependencies "to creep up on you". Use it to think about whether you actually need that code and/or whether is is where it belongs. It's a LOT simpler to code this way than having to loosen badly intertwined dependencies when YAreGNI.
Jul
19
comment Desktop client server application, limiting text area field compromise with customers
Forget about size restrictions and think about lazy loading. Don't load the notes unless they are actually needed to display or edit. So don't include the notes in any queries used for list displays, always filter server side if a note is in the filter expression, etc.
Jun
28
comment Design Patterns for creating tasks
Oh and using observer would make your observer of the Entity certainly non-anemic... Your Entity class still may or may not be anemic, but the observer certainly won't. The desire not to have anemic classes is very good, but you should still not put code in a class just to make it non-anemic. The code to instantiate the Task indeed does not belong in Entity as it would introduce unwanted (and unwarranted) coupling. Any code added to Entity should be related to Entity.
Jun
28
comment Design Patterns for creating tasks
Perhaps your confusion stems from treating design patterns as code examples. A design pattern may have a code example to explain it, but it is never limited to that example. Design patterns are much more than just code examples. Design patterns are ways of talking about code and talking about general solutions to common problems. It is up to the developer to apply a design pattern to his/her specific problem by amending the explanatory example to his/her specific case.
Jun
28
comment Design Patterns for creating tasks
Whether your classes are anemic has nothing to do with using or not using Observer. Furthermore the Observer pattern is not restricted to passing along just "simple" parameters. The observed can pass along anything you need to the observer. So you could simply pass along the Entity instance that was changed and the observer can pick whatever it needs.