Reputation
7,098
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
3 23 30
Newest
 Guru
Impact
~212k people reached

Jun
30
comment Better solution then simple factory method when concrete implementations have different attributes
If that is the case, use a factory in combination with the strategy pattern. The reason I discarded that was because of the need for external decisions on the behaviours to pass in. If that is exactly what you need then go for it.
Jun
30
comment Better solution then simple factory method when concrete implementations have different attributes
Added an example in Delphi for you.
Jun
30
revised Better solution then simple factory method when concrete implementations have different attributes
Added example in Delphi
Jun
30
comment Better solution then simple factory method when concrete implementations have different attributes
No you would have an animal "Builder" and specific CatBuilder and DogBuilder classes that can be registered with the builder for the specific type of animal that they can build. So when you pass "cat" to the builder. It would see whether that is in its list of concrete builders and if it is call that to build the cat. The cat builder would know that a cat can't bark and both the cat and dog builder would know their respective animal can jump high.
Jun
30
answered Better solution then simple factory method when concrete implementations have different attributes
Jun
29
comment Dependency Injection Confusion
And I have found Dependency Injection != using a DI container very helpful as well.
Jun
29
comment Dependency Injection Confusion
The Inversion of Control Containers and the Dependency Injection pattern may be of help to you.
Jun
29
comment Dependency Injection Confusion
@Patrick: "a tree of 100 classes with several shared dependencies"? Not sure, but sounds to me like a re-think may be in order? There is no need to put every class under the management of any form of DI. In any application there are many classes that are only used to factor out specific parts of a bigger class. Such helper classes do not feature in the helped class' public methods and properties (if they do they should be behind an interface anyway) and thus do not need to be available to other classes, directly or indirectly through an IoC.
Jun
28
comment Why not have a High Level Language based OS? Are Low Level Languages more efficient?
@rtindru: even with 1 rep point you can accept an answer What does it mean when an answer is "accepted"?
Jun
28
comment Structuring Access Control In Hierarchical Object Graph
I'd say: take a leave out of an OS's book. Folder and file security deals with exactly the same problem. Windows uses inheritable attributes: any child folder/file inherits the security settings from its parent, unless a child is specifically given other settings. Please bear in mind that children of such a child can effectively revert the different settings by having their own specific settings that happen to be the same as those of their grandparent. Whichever option you choose, you are in complex territory and will carefully have to think through all possible permutations.
Jun
27
comment Does Agile (scrum) require one server environment?
What does team management (SCRUM) have to do with your development / server environment? If anything it would be that the team(s) decide what development environment works best for them and if the team decide that they need separate servers there is nothing in Agile or Scrum that prevents that.
Jun
27
comment Loose Coupling in Object Oriented Design
+1 Interesting read on this would also be the discussion of the Dependency Inversion Principle in DIP in the wild where the use of primitive types is actually seen as a Primitive Obsession "smell" with Value Object as the fix. To me that sounds like it would be better to pass a Track object that a whole gaggle of primitive types... And if you want to avoid dependency on / coupling with specific classes, use interfaces.
Jun
27
comment How should I architect a personal schedule manager that runs 24/7?
+1 This is exactly what we (actually I) have done for a command scheduler in a server application. Slightly different application/subject, but essence and solution are the same: incoming commands wrapped in scheduling items which are queued and taken off the queue by a scheduler that checks the scheduling item for its schedule and time constraints (execution window) and when that passes sends the item onto the execution thread(s). Recurrence is implemented in the scheduler simply by adding a clone of the scheduling item to its queue with an execution window that starts at now + interval.
Jun
26
answered Tester/Doer pattern: Assume the caller conforms to the pattern or be defensive and repeat the check?
Jun
26
comment Should we persist with an employee still writing bad code after many years?
+1 for the last paragraphs. Progress achieved by someone versus effort invested in guiding that someone both need to factor into any judgement of performance.
Jun
26
comment Should we persist with an employee still writing bad code after many years?
@WorldEngineer: disagree. Don't see a legal question in here at all. It's about merit and whether it is worth putting more effort into the person.
Jun
26
comment How to manually detect deadlocks
@MichaelBorgwardt: Ah, ok. Implicit locking at the row level. Would that be another case of a piece of software (DBMS) thinking it is smarter than it really is? Or developers relying too much on what is done automatically for them without considering the implications? Or both? Probably both? :-)
Jun
26
comment How to manually detect deadlocks
@MichaelBorgwardt: No, such scenario's only arise if you don't follow the "always acquire locks in the same order". That rule was invented long before I even started in IT (and that was a long time ago in itself).
Jun
26
comment Avoiding null in a controller
Research the Null Object Pattern.
Jun
26
comment Avoiding null in a controller
+1 for the null object pattern