410 reputation
314
bio website dicasdotnet.blogspot.com
location
age
visits member for 4 years, 6 months
seen 14 hours ago

May
20
comment Where should my team start with becoming “modern”?
+1 for the link :)
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
@YazadKhambata That comment was also for you, but I can mention 2 users at the same comment ;)
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
@RobertHarvey You would have anemic models in the "transfer layer", they would be DTOs or somethink else, so you can avoid the json/xml parsing issue, but I wouldn't call them "business model". Ideally I would map them to non-anemic-models in the boundaries and process this non-adnemic-model inside my system. What are your opinions about it?
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
Obviously this can be due to bad implementation of this pattern. However, I have the feeling that DDD makes separating methods in smaller parts that make sense easier and using polymorphy easier.
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
Great answer. Yes, DDD seems (I haven't used in a real project, but I would love to try) to have some extra work at some points, but my experience with services is that at some point they start to grow in size and complexity and are thus harder to reuse. I've found a service-architecture project that had many similar methods because they had small differences and merging them would result in a very complex service.
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
Hi James! I don't know if I missunderstood your answer, but when I talk about DDD I do not mean generating code from diagrams and so on, I mean Domain Driven Design, which hash a great book about it amazon.de/Domain-Driven-Design-Tackling-Complexity-Software/dp/… I haven't tried that in a real project, but it seems elegant to me at a first glance :)
Apr
24
comment Why is a architecture with anemic models the JavaEE standard?
That is true. I am (still) not following. It is pretty hard to find projects that use this kind of architecture :(
Apr
22
comment Why is a architecture with anemic models the JavaEE standard?
Hm, I understand. The problem now is that everybody continues doing the same thing because now "It is the standard" and that is sad :(
Apr
22
comment Why is a architecture with anemic models the JavaEE standard?
yes, it states that it is OK for many "simple applications". I would say that a JavaEE application would be usually not simple.
Feb
26
comment How to use unit tests when using BDD?
@DocBrown as far as I understood, BDD is a technique/methodology. This technique includes unit testing, but focused on the feature the method implements. I want to understand how do I write the "test definition" or the test itself to achieve this goal
Feb
26
comment How to use unit tests when using BDD?
Sorry, I dont get it. You mean I should mock the dispenser? How would I test it?
Jan
22
comment Where should I place business logic validations?
Ok, perfect. And the question is: how do I send the information about the result of the validation back to the caller?
Jan
22
comment Where should I place business logic validations?
So I would have a method public OperationModel createAccount() and this class OperationModel would have an attribute validationMessage, right? If I do that, for every model that is used in a method that contains has some sort of validation, I will have to take an approach like this, so operation models would end up with validation information and then in the controller I would have to check for something like an isValid property and errorMessage property. That seems interesting, but I have mixed feelings about have this isValid in a Domain Class, but as more as I write, the better it sounds
Jan
20
comment Where should I place business logic validations?
That is interesting and seems a very nice idea. Would you have an answer to the argument that there is still a business knowledge when the controller knows that he has to call that specific validator in order to call the "save" method after that?
Jan
20
comment Where should I place business logic validations?
Just let me know if I understood: you are telling me to use something like the Validator class from sprint (docs.spring.io/spring-framework/docs/2.5.x/api/org/…) and use it to check in the business layer, correct? But if the validation fails, how do I give this feedback to the caller so a message can be shown to the user?
Jan
20
comment Where should I place business logic validations?
@JeffO please correct me if I am wrong, but in a layered architecture, the presentation layer should not access the data layer directly, it should go through the service layer. In this case specially, the business knowledge ("If the user already has an account request, he should not request for another") would be in the controller, instead of the business layer, this is not recommended.
Jan
20
comment Where should I place business logic validations?
@BartvanIngenSchenau in these cases we throw an Exception, but usually this is a exceptional scenario, so the exception is (as far as I know) correctly used.
Jan
20
comment Where should I place business logic validations?
Yes, this is currently our problem. As you said these validations shuold reside in the business logic, but we should neither use exceptions nor out parameters nor an extra object. How shoul I perform the communication from business to view about which validation failed and why?
Dec
18
comment Is it better to use strings or int to reference enums outside the java part of the system?
Yes, we went down this path, but we are using hibernate and we had to add some extra code to be able to parse the value to/from the database and it seemed kind of strange, so we decided to use the .STRING relationship and go with the enum name.
Dec
16
comment Is it better to use strings or int to reference enums outside the java part of the system?
Hm, seems interesting :) We will try this approach here and let's see what happens :) Thanks for your reply!