Top tag
Next privilege 500 Rep.
Access review queues
1 7 18
~80k people reached

  • 0 posts edited
  • 1 helpful flag
  • 528 votes cast
comment Why would programmers ignore ISO standards?
You shouldn't store a date as string, use DATE data type instead.
comment In DOM, why is childNodes defined in the Node interface if only some node types can have childNodes?
Check my update, my point is why define something in the interface that not every Node will be capable to do it.
comment Shall I separate the admin part from the rest of the war
Also keep in mind that if the WARs need to comunicate to each other they will have to do so by webservices/EJB alike and that means serialization/deserealization which adds overhead.
comment Do MVC web frameworks favor anemic domain model in order to avoid duplication?
Anyway, even with this you still have to duplicate validation in the view model and the domain objects, suppose that you have a business rule that says that "Member" can only be age > 18, if you had used View Model you would have a field "age" in the View Model and also in the domain object, then you would have also the same validation in both the domain and the view model, that's a lot of duplication and if the business rule changes you would have to update all the view models that contain that validation.
comment Do MVC web frameworks favor anemic domain model in order to avoid duplication?
The problem with view model is that you have to duplicate a lot of fields, and that's a lot of maintenance but the counter argument is that it is worth because if the model changes you don't have to update the views and also gives you more security ensuring that the view can't update fields that are not supposed to be updated in that view.
comment Do MVC web frameworks favor anemic domain model in order to avoid duplication?
It's interesting that concepts that are used in some technology are not used in another one, for example the View Model you talk about is not known in Java (I've never heard it before either) and in Java, frameworks advice to bind directly to the domain objects. I've been reading about this in .NET (ASP.NET MVC) and the opinion is the total opposite, they say that you shouldn't bind directly to the domain objects and create what you said "view models". Very interesting how the opinions change depending on the technology.
comment How can I deal with a team member who dislikes making comments in code?
+1 but I think this doesn't apply to API doc which is very important because you need to have well documented what the function/method does and return.
comment Pattern for a class that does only one thing
@StevenJeuris I don't think it's an anti-pattern. An anti-pattern would be to clutter up refactored methods with lot parameters instead of storing this state that is common between these methods in an instance variable.
comment Is defining a variable to name a method argument a good practice?
@Caleb what about if you just pass to makeColor an RGB object for example: makeColor(new RGB(255,255,255)); More cleaner isn't it?
comment Why is Global State so Evil?
I think that passing a context object either by function parameter or dependency injection would cause problems if the context is mutable, same problem as using mutable global state.