Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Naming is pretty subjective, but in my opinion there's 2 things to follow to have "good names".</p> <ol> <li>Be precise. </li> <li>Follow the <a href="http://en.wikipedia.org/wiki/Principle_of_least_astonishment" rel="nofollow">principle of least astonishment</a>.</li> </ol> <p>These two principles are important for maintenance; if you have a bunch of methods named <code>GetData</code>, people won't know what to expect and will waste time reading the doc to find the appropriate overload.</p> <p>You also want to have names representing the level of abstraction you're at. So let's say you want to get some entities named <code>Page</code>. At the DAO level it could easily be <code>public DataTable GetPagesTable();</code>, because you're dealing with tables. At a higher level of abstraction, with the List, you could change it to <code>public List GetPages();</code> (Removed Table from the name). You're far from the database, so the names should reflect that.</p> <p>If you're passing an object or ID, say it clearly in the method name to avoid any surprises, like <code>public DataTable GetPagesFromId(int id);</code> </p> <p>From your examples, I would probably end up with something like that :</p> <pre><code>public DataTable Get&lt;TableName&gt;Table() - returns the data from a given table public List Get&lt;ObjectName&gt;s() - returns the data in the form of List of objects public DataSet Get&lt;ComposedObjectName&gt;() - returns the data when there are multiple data tables associated with queries public objectx Get&lt;ObjectName&gt;(objecty) - returns selected object public DataSet Get&lt;ObjectName&gt;AsMasterChild(objecty) - returns selected object (ex: in case of master-child) </code></pre>
    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.
    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