anti-patterns

What is soft coding? (Anti-pattern)

女生的网名这么多〃 提交于 2019-11-30 17:21:01
I found the Wikipedia entry on the soft coding anti-pattern terse and confusing. So what is soft coding? In what settings is it a bad practice (anti-pattern)? Also, when could it be considered beneficial, and if so, how should it be implemented? Short answer: Going to extremes to avoid Hard Coding and ending up with some monster convoluted abstraction layer to maintain that is worse than if the hard coded values had been there from the start. i.e. over engineering. Like: SpecialFileClass file = new SpecialFileClass( 200 ); // hard coded SpecialFileClass file = new SpecialFileClass( DBConfig

What is soft coding? (Anti-pattern)

随声附和 提交于 2019-11-30 16:44:30
问题 I found the Wikipedia entry on the soft coding anti-pattern terse and confusing. So what is soft coding? In what settings is it a bad practice (anti-pattern)? Also, when could it be considered beneficial, and if so, how should it be implemented? 回答1: Short answer: Going to extremes to avoid Hard Coding and ending up with some monster convoluted abstraction layer to maintain that is worse than if the hard coded values had been there from the start. i.e. over engineering. Like: SpecialFileClass

Why defining properties in the prototype is considered an antipattern

心已入冬 提交于 2019-11-30 14:11:16
问题 I often see this pattern to define javascript objects function Person(name) { this.name = name; } Person.prototype.describe = function () { return "Person called "+this.name; }; And in this article it says that adding properties directly to the prototype objct is considered an anti-pattern. Coming from "classical class based" languages, having to define the properties apart from methods doesn't sound quite right, moreoever in javascript, where a method should be just a property with a

Need refactoring ideas for Arrow Anti-Pattern

感情迁移 提交于 2019-11-30 11:50:37
I have inherited a monster. It is masquerading as a .NET 1.1 application processes text files that conform to Healthcare Claim Payment (ANSI 835) standards, but it's a monster. The information being processed relates to healthcare claims, EOBs, and reimbursements. These files consist of records that have an identifier in the first few positions and data fields formatted according to the specs for that type of record. Some record ids are Control Segment ids, which delimit groups of records relating to a particular type of transaction. To process a file, my little monster reads the first record,

What's the most unsound program you've had to maintain? [closed]

南楼画角 提交于 2019-11-30 11:24:36
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I periodically am called upon to do maintenance work on a system that was built by a real rocket surgeon. There's so much wrong with

Anemic Domain Model's vs. Domain Model in a simple domain driven design

耗尽温柔 提交于 2019-11-30 06:42:40
I recently read a post on " The Anemic Domain Model Pattern " which caught my attention. As I read through this I found that the Anemic Domain Model description applied to many of the projects that I have worked on and built. I never thought of this as a bad design decision as it felt very natural. I thought that in the case where the domain model was light weight and not very complex the Anemic Domain Model moniker fit quite well. Why add complexity to the domain model where it doesn't need to be just so the title of "Anemic Domain Model" doesn't aptly describe your code? Question: At what

Concrete examples on why the 'Anemic Domain Model' is considered an anti-pattern [closed]

蹲街弑〆低调 提交于 2019-11-29 20:43:09
I apologize if this is a duplicate, but I couldn't find any concrete examples on the topic in related questions. After reading Martin Fowler's article on the 'Anemic Domain Model' , I'm left wandering as to why is this considered an anti-pattern. Even does the majority of enterprise developers consider it an anti-pattern, since AFAIK probably 90% of the j2ee applications are designed in an 'anemic' way ? Can someone recommend further reading on the topic (other than the 'Domain Driven Design' book), or even better, give a concrete examples on how this anti-pattern is affecting application

What to do about a 11000 lines C++ source file?

北城以北 提交于 2019-11-29 19:03:21
So we have this huge (is 11000 lines huge?) mainmodule.cpp source file in our project and every time I have to touch it I cringe. As this file is so central and large, it keeps accumulating more and more code and I can't think of a good way to make it actually start to shrink. The file is used and actively changed in several (> 10) maintenance versions of our product and so it is really hard to refactor it. If I were to "simply" split it up, say for a start, into 3 files, then merging back changes from maintenance versions will become a nightmare. And also if you split up a file with such a

A Factory Pattern that will satisfy the Open/Closed Principle?

爷,独闯天下 提交于 2019-11-29 18:23:01
问题 I have the following concrete Animal products: Dog and Cat . I am using a parameterized Factory method to create said products. Depending on the AnimalInfo parameter that is passed to the Factory method, a concrete product will be created. The mapping logic is placed in the Factory method. Here is my code: public abstract class AnimalInfo { public abstract String Sound { get; } } public class DogInfo : AnimalInfo { public override string Sound { get { return "Bark"; } } } public class CatInfo

Need refactoring ideas for Arrow Anti-Pattern

有些话、适合烂在心里 提交于 2019-11-29 17:45:57
问题 I have inherited a monster. It is masquerading as a .NET 1.1 application processes text files that conform to Healthcare Claim Payment (ANSI 835) standards, but it's a monster. The information being processed relates to healthcare claims, EOBs, and reimbursements. These files consist of records that have an identifier in the first few positions and data fields formatted according to the specs for that type of record. Some record ids are Control Segment ids, which delimit groups of records