Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can't use Frameworks but you can use the patterns the frameworks themselves use. So I recommend you these solutions based on the <a href="http://martinfowler.com/eaaCatalog/" rel="nofollow">P of EAA. by Martin Fowler</a></p> <ol> <li><p>You could use your first option <strong>(Operation with workerId and customerId fields)</strong> and use a <a href="http://martinfowler.com/eaaCatalog/rowDataGateway.html" rel="nofollow">Row Data Gateway</a> for every entity (Operation, Worker, Customer). Now, if memory is an issue and your model requires it, keep control of all the Worker and Customer loaded instances with an <a href="http://martinfowler.com/eaaCatalog/identityMap.html" rel="nofollow">Identity Map</a> and avoid reloading.</p></li> <li><p>You could use your second option <strong>(having an worker and customer instance in Operation)</strong> and use a <a href="http://martinfowler.com/eaaCatalog/tableDataGateway.html" rel="nofollow">Table Data Gateway</a> with <a href="http://martinfowler.com/eaaCatalog/lazyLoad.html" rel="nofollow">Lazy Load</a> to load the instances only when required.</p></li> </ol> <p>Worrying whether having multiple instances loaded or not depends on the type of application you are building and the scope of the instances; for instance, if you are a creating CRUD based application, you instances will normally have a request scope, so use the second approach and don't worry about memory waste or data inconsistencies.</p> <p>Advice: Use interfaces to define your types.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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