410 reputation
314
bio website dicasdotnet.blogspot.com
location
age
visits member for 4 years, 6 months
seen May 22 at 15:33

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?
Jan
20
asked Where should I place business logic validations?
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
accepted Is it better to use strings or int to reference enums outside the java part of the system?
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!
Dec
16
comment Is it better to use strings or int to reference enums outside the java part of the system?
I've edited the question and I hope it is clearer now: by "reference to an enum" I mean referencing the value when exchanging data from JavaScript to the Server or the other way around or storing a value in the database
Dec
16
revised Is it better to use strings or int to reference enums outside the java part of the system?
added 243 characters in body
Dec
16
asked Is it better to use strings or int to reference enums outside the java part of the system?
Sep
5
accepted Does Play framework approach necessarily leads to confuse code?
Sep
5
comment Does Play framework approach necessarily leads to confuse code?
Interesting point. I have a very limited experience with rails, but I really liked the language. The similarity to rails caught my attention in Play framework. I am starting the research now. I will make some prototypes to see it in action, thanks :)
Sep
5
comment How to use ViewModels in a layered architecture?
I feel relieved that it is normal. I like your separations ideas, I will propose to our team, thanks :D
Sep
5
accepted How to use ViewModels in a layered architecture?
Sep
3
comment Does Play framework approach necessarily leads to confuse code?
Yes, your points are valid. I just don't want to spend some time coding things and get with a confusing code that is hard to maintiain after some time (and then wasting more time getting around my code that implementing new things)
Sep
3
comment Does Play framework approach necessarily leads to confuse code?
I will take a look on this link, thanks :)
Sep
3
asked Does Play framework approach necessarily leads to confuse code?
Aug
25
asked How to use ViewModels in a layered architecture?
Jul
5
awarded  Nice Answer