anti-patterns

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

白昼怎懂夜的黑 提交于 2019-11-29 06:24:08
问题 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

What is spaghetti code? [closed]

空扰寡人 提交于 2019-11-29 05:29:48
Can you post a short example of real, overdone spaghetti code, possibly saying what it does? Can you show me a little debugger's nightmare? I don't mean IOCCC code, that is science fiction. I mean real life examples that happened to you... Update The focus has changed from "post some spaghetti code" to "what is exactly spaghetti code?". From a historical perspective, the current choices seem to be: old Fortran code using computed gotos massively old Cobol code using the ALTER statement To me, a more modern example of spaghetti code is when you have 20 dlls and every DLL references each other

the significance of java RMI please? [closed]

跟風遠走 提交于 2019-11-29 03:18:07
Why do people use RMI, or when should I use RMI? I read those tutorials about RMI on oracle's website.But it doesn't provides enough practical examples. To my understanding, a software should have its modules as "unrelated and separated" as possible. RMI somehow seems to be an example of high coupling to me. Why is this not a bad coding practice? I thought the client should only fire instructions,whereas all the actually manipulations of the object were done by the server. (I am currently working towards a computer science bachelor degree and very inexperienced, so please correct me if I

Why is “log and throw” considered an anti-pattern? [closed]

耗尽温柔 提交于 2019-11-28 17:08:42
This question was sparked by a discussion around this article , where I did not receive any good answers. Why should logging your exception and then rethrowing it (preserving the original stack trace of course) be a bad idea if you can't handle it otherwise? I assume the answer is largely because why are you catching it if you can't handle it? Why not let whomever can handle it (or whomever is left with no choice but to handle it) log it, if they feel that it is log-worthy? If you catch it and log it and rethrow it, then there's no way for the upstream code to know that you've already logged

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

╄→尐↘猪︶ㄣ 提交于 2019-11-28 16:50:35
问题 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'

What is an anti-pattern?

眉间皱痕 提交于 2019-11-28 14:59:00
I am studying patterns and anti-patterns. I have a clear idea about patterns, but I don't get anti-patterns. Definitions from the web and Wikipedia confuse me a lot. Can anybody explain to me in simple words what an anti-pattern is? What is the purpose? What do they do? Is it a bad thing or good thing? coobird Anti-patterns are certain patterns in software development that are considered bad programming practices. As opposed to design patterns which are common approaches to common problems which have been formalized and are generally considered a good development practice, anti-patterns are

C# Antipatterns

北慕城南 提交于 2019-11-28 14:55:38
To cut a long story short: I find the Java antipatterns an indispensable resource. For beginners as much as for professionals. I have yet to find something like this for C#. So I'll open up this question as community wiki and invite everyone to share their knowledge on this. As I am new to C#, I am strongly interested in this, but cannot start with some antipatterns :/ Here are the answers which I find specifically true for C# and not other languages. I just copy/pasted these! Consider throwing a look on the comments on these as well. Throwing NullReferenceException Throwing the wrong

What anti-patterns exist for JavaScript? [closed]

…衆ロ難τιáo~ 提交于 2019-11-28 13:56:24
问题 I find that what not to do is a harder lesson to learn than what should be done. From my experience, what separates an expert from an intermediate is the ability to select from among various seemingly equivalent ways of doing the same thing. So, when it comes to JavaScript what kinds of things should you not do and why ? I'm able to find lots of these for Java, but since JavaScript's typical context (in a browser) is very different from Java's I'm curious to see what comes out. 回答1: Language:

Is it an anti-pattern to modify JavaScript's built-in prototypes?

折月煮酒 提交于 2019-11-28 11:33:18
问题 I understand from this post, that it's an anti-pattern to modify Object 's prototype in JavaScript. I was curious, however, if it's widely considered to be an antipattern to modify other 'built-in' prototypes. For example: say we wanted to add a setPixel(x,y,color) function to CanvasRenderingContext2D - to abstract out the duty of getting the context's image data, setting a pixel to a certain color, and putting the image data back. CanvasRenderingContext2D.prototype.setPixel = function(x, y,

Too much singletons in the project - is it a bad practice?

混江龙づ霸主 提交于 2019-11-28 04:53:25
问题 In almost every project I create a few classes which implement Singleton pattern. For example, data manager - if there's some work with file system, data loader - if an application connects to the internet, different resources managers, etc. Sometimes there are up to 5-7 such classes and I start feeling that I'm doing something wrong. Is it a bad practice to use Singleton pattern too much? 回答1: Singletons are not necessarily problems — having a single object that is an expert in its domain