I'm trying to come up with something "generic" that holds up common information for present (and future) use in requests/responses when using Spring MVC. I also realize that the framework comes with RequestEntity and ResponseEntity, but both are generic and require a type in order to work (as usually). I think this is a requirement for RestTemplate since it uses both; there is also a fact, both extends from HttpEntity.
My point is I can have something like ResponseEntity (with some other name) and there's no need to be a "generic" type, since it will be the responsible for holding the data itself.
Can somebody tell me what's the best/recommended approach here? Should I reuse them as a wrapper for holding the type that I think should be ResponseEntity...or am I wrong here?
Aucun commentaire:
Enregistrer un commentaire