Skip to main content
15 events
when toggle format what by license comment
Dec 23, 2016 at 12:40 comment added Radu Murzea I would be cautious regarding how much "cosmetization" the repository layer adds on the data it returns. I think a great rule of thumb is: only do reversible customizations. Why ? Because there (or will) be other services in the future that will rely on that repository. In your case: the "export-to-PDF" functionality will soon be side-by-side with a "export-to-CSV" or something similar.
Nov 29, 2016 at 13:21 history tweeted twitter.com/StackSoftEng/status/803589676690849793
Nov 28, 2016 at 22:02 comment added user188153 A user requesting it is a requirement. The "why" is in the business/use case. You need to model towards this, not against a single requirement. Basically the answer from kayess is fine. But the whole story is more complex. You should model the use cases first, before starting to model classes.
Nov 28, 2016 at 21:23 vote accept Dennis
Nov 28, 2016 at 21:19 comment added Dennis @Thomas ... why? The user of the application requested it. Why user requested that way? the customer needs to see if the value is in mm or inches, as customer's country is used to a particular measurement system. Why tolerances? Customer needs to see tolerances as well so that the manufactured equipment fits for the parts that are designed for it. Neither though tells me anything about how to code that, not from what I can tell. Why am I coding it this way? I'm refactoring the existing legacy code, and it currently does not properly fit the purpose -- too many bugs, so I'm rewriting it
Nov 28, 2016 at 20:44 comment added Robert Harvey The best practice is the one that most effectively satisfies your business objectives. See also meta.stackexchange.com/a/142354
Nov 28, 2016 at 20:00 comment added user188153 If you elaborate just a bit on the "why" for doing the above I could try. What is the intention of doing the additions and augmenting the values?
Nov 28, 2016 at 19:40 answer added kayess timeline score: 3
Nov 28, 2016 at 18:09 comment added Dennis @Thomas, I am not sure how to use your approach. . can you give me a starting example?
Nov 28, 2016 at 18:08 comment added Dennis yes .. but that's pretty arbitrary. I am curious to see if there is a best practice. I was told before that something like "using a Data-Access-Object or a Repository to retrieve raw data from Database" is anemic ... and I might as well convert it into an object that's usable by my application without any further transformation. Thus ... it may be good to do data transformation from raw to business object in the repository. But in my case it is less clear what my business object is
Nov 28, 2016 at 18:07 comment added user188153 If you want to do it OO you need to focus on the "why", not on the "what/how" like above. Start with classes, not functionality.
Nov 28, 2016 at 17:38 comment added Teimpz Does it make sense to just add an intermediate layer in between?
Nov 28, 2016 at 16:23 history edited Dennis CC BY-SA 3.0
add concrete use case
Nov 28, 2016 at 16:15 history edited Dennis CC BY-SA 3.0
added 165 characters in body
Nov 28, 2016 at 16:02 history asked Dennis CC BY-SA 3.0