Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is a great question, even if the issue isn't new. As an industry, we've been changing the "conventional wisdom" on this subject frequently over the years. The answers you get today aren't necessarily what you'd get 5 years ago or 5 years in the future.</p> <p>In picturing how <em>I'd</em> like to handle this item, I'm wondering about some things you haven't stated: is your app the "system of record" for Dog entities? What other subsystems/layers/apps need to know about Dog entities.</p> <p>In Java, when you write brand new types like Animal > Dog, you get the following reward: the opportunity to write a whole bunch more code that knows how to interact with Animal objects and Dog objects. I'm less convinced in 2010 that this is a good idea than I was five years ago.</p> <p>Are you responsible for designing the database where Dog information is stored? We used to do that all the time, but nowadays I usually find myself integrating with data records that are actually managed by other systems: google APIs, LDAP entities, data warehouses, products like peoplesoft, etc.</p> <p>If you're <em>not</em> in charge of defining what a Dog is and how they interact with the universe, I'd look at a domain-agnostic way to model Dog information in memory. There are tons: XML/DOM, JSON, Map, etc.</p> <p>The advantages of moving other people's data around in these formats are many...</p> <ul> <li>you don't have to write POJOs</li> <li>these are rich in features, documentation, and testing</li> <li>there are numerous existing APIs to transform, manipulate, and serialize these creatures</li> <li>you might get to reuse your view/controller/other code across other domains</li> </ul> <p>On the other hand... if you are the system of record for Dog data, consider using interfaces instead of abstract classes. Or perhaps interfaces <em>and</em> abstract classes. Java only has single inheritance; tie your view/controller/other code to interfaces to guarentee the most future flexibility.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload