I've been working software developer for 1 year and I don't understand how people decide what way to choose in application design.
First. No it's not opinion based question. I'm not asking what approach is "better". I need advices how to achieve understanding in the field. Maybe there are some kind of books etc that could help me go to next level in making software.
I've read M.Fouler's PEAA, GOf and Clean code but this didn't help me much.
Few examples from real life:
FooController{
@Mapping
ResponseEntity getFoo(ID){
return responseUtil.wrapOrNotNull(fooDao.findOne(ID));
}
}
ResponseUtil{
static ResponseEntity wrapOrNotNull(T t){
if(!= null) return ResponseEntity<T>;
else return ResponseEntity(404 NOT FOUND);
}
}
Example 2:
FooController{
@Mapping
ResponseEntity getFoo(ID){
return fooService.get(ID));
}
}
FooService{
get(ID){
Foo found = fooDao.findOne(ID);
if(!= null) return found;
else throw new FooNotFoundExeption();
}
}
ExeptionHandler{
ResponseEntity handle(FooNotFoundExeption){
return ResponseEntity(404 NOT FOUND);
}
}
I can't understand how did they decide which way to choose in so similar cases. Assume I'm working with team 2. So when I move on to another team will they tell me "it's CodeSmell"?
Aucun commentaire:
Enregistrer un commentaire