414 reputation
415
bio website
location
age
visits member for 4 years
seen 2 days ago

Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
@Oscar agree, you would not directly expose your domain model with a web service. You'd do just as you said, with the service built on top of the domain layer just like any other client interface (GUI, command line, etc.)
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
@RobertHarvey rather you can't move logic between two platforms. Logic is code, not data... unless you're going to write something that converts between one language to the other on the fly. Finally web service contracts are NOT the same thing as domain models. If you're tying those together you're asking for pain.
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
@YazadKhambata the state is encapsulated in anemic models but not the behavior. when you're talking about two different platforms you're inherently talking about two different applications which are different bounded contexts. You'd connection them probably via web service but the service contracts are just service contracts, they do not have to represent the shape of the domain models the service uses to do its job.
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
"people go to the anemic domain model antipattern instead in order to not have two objects representing the "same" object.". bingo. The problem is that people are comparing objects by the data they contain instead of the behavior they encapsulate, which imho goes against OO design.
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
@RobertHarvey You don't in those cases, you end up having to duplicate the code. Anemic models don't even have logic to transfer anyway, they're by definition dumb.
Apr
23
comment Why is a architecture with anemic models the JavaEE standard?
@Oscar it is sad and it seems there are a lot of devs out there that think they're following ddd but aren't.
Apr
23
comment Why is a architecture with anemic models the JavaEE standard?
"Contracts should define the expected structure of inputs, outputs (and exceptions) not the business logic.". interfaces are contracts (and in .net Code Contracts lets you define real DbC contracts which are enforced), not objects. The anemic models you describe effectively revert OO back to procedural programming. Pojos which are designed around being serializable aren't domain objects at all, models should not be anemic, the should be the source of truth for whatever they represent.
Apr
16
comment How do I do SQL Server mapping with a new Desktop application written in C#?
SRP is useful when you are maintaining the class; you're not worrying about maintaining DbContext yourself, someone else is, you should only care that it works. What you claim is your main point appears as a couple of sentences in your entire answer, you just spout out that you believe EF does "too much" and should just avoid it in favor of ORMs which do less.
Apr
16
comment How do I do SQL Server mapping with a new Desktop application written in C#?
Srp applies to a class not a framework. And its a principal mot a hard and fast rule.
Apr
9
comment Should one use Dependency Injection even if the class is used only once?
@AvetisG no, it makes no sense whatsoever, because all those external pieces need to be kept in a state you expect or your tests will start failing, and you won't know if its the code or the state that's broken. They also will be far less detailed (offer less coverage) than good unit tests. I've done plenty of the kinds of tests your talking about, and its far easier to mock than try to keep web services / DBs in their proper state.
Apr
9
comment Should one use Dependency Injection even if the class is used only once?
@AvetisG Seriously? Go google it. Relying on external state for automated tests makes them that much more fragile, prone to false negatives and slower (DB will be much slower than in memory). Acceptance testing means you have people manually trying stuff, which besides the fact that it takes longer also means if you ever find the error, you're much further down the development pipeline than if you had a good unit test and the further away from a local developer workstation it takes to find / fix a bug the more expensive it is.
Apr
9
comment Should one use Dependency Injection even if the class is used only once?
"Unit testing also falls off since I would rather do an integration or acceptance test to see how the method is interacting with the database in a real-life application.". integration or acceptance tests are more costly in terms of maintenance than a unit test, so I'm not sure why those would be your preference. If this is going to be common as you move forward with other classes, the costs of this are going to be very real. Especially if the class representing the legacy code will be rewritten to not be legacy (by further decomposition), you may want to rethink.
Apr
5
comment Is there a way to support different coding styles in a development team
A variety of styles between files is much harder to deal with than just having a consistent style.
Mar
28
comment Can we replace XML with JSON entirely?
@SK-logic are you seriously suggesting a lack of good tooling for xml?
Mar
28
comment Why did Alan Kay say, “The Internet was so well done, but the web was by amateurs”?
For its designed purpose, hypertext, html is fine. But as an application platform it fails miserably. The only advantage was no deployment and platform agnostic. Searching is not the only thing people do on a computer. Financial planning, games, social interactions, etc. Who cares if I can't search my blackjack game? Given a choice between web app and mobile app, people overwhelmingly choose the native app. There's a reason for that.
Mar
28
comment Why did Alan Kay say, “The Internet was so well done, but the web was by amateurs”?
@mpw no, the browser isn't fulfilling that. Brower "apps" are horrible because they try to abuse the browser into being something its not. It offers the most basic of controls and JavaScript is used to try and make anything remotely close to the rich control set of desktops. What is pushing kays vision forward are the app stores from Microsoft, Apple and Google. I suspect normal users will use browsers less as apps continue their rise. The web will still be there but it will be used behind the scenes by apps.
Mar
28
comment Why did Alan Kay say, “The Internet was so well done, but the web was by amateurs”?
"well specified declarative language like HTML ". That's rich.
Mar
13
comment Should one check for null if he does not expect null?
Use code contracts and add Ensures where appropriate (almost everywhere).
Mar
12
answered Put Business Logic and Model Declaration in Different DLL
Mar
12
comment Why JavaScript? What's the advantages?
" it's pretty hard to find something that's not possible to do in JS" Well that's true in any language really.