Note that there are some explanatory texts on larger screens.

plurals
  1. PO'Static/Constant' business objects
    primarykey
    data
    text
    <p>I don't quite know how to ask this question, so I'll phrase it as an example instead:</p> <p>Imagine in an application you have a <code>Country</code> object. There are two properties of this object: <code>Name</code>, and a '<code>Bordering Countries</code>' collection. More properties might be added later, but it will be the kind of information that would change very rarely (e.g. changes of country names/borders)</p> <p>Lets say this application needs to know about all of the countries in the world. <strong>Where would you store these object's state? How would you new them up?</strong> It seems silly to store all this state in the DB, since it won't change very often.</p> <p>One option might be to have an abstract 'country' base object, and have a class for each country inheriting from this with the details of each country. But this doesn't seem quite right to me.</p> <p><strong>What is the proper way of dealing with these kinds of objects?</strong></p> <p>UPDATES:</p> <p>Someone asked about language: C#</p> <p>Also, I'm coming at this from a web application perspective, so there wouldn't be multiple client installations where I'd have to worry about updating hard coded values.</p> <p>Most people have suggested not hardcoding the data, but using the DB or XML files to store the data. <strong>Could anyone provide an example of how this kind of object would be 'newed up' (from e.g. an XML file)? Would you use some kind of helper or factory method to obtain instance of a particular country?</strong></p>
    singulars
    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.
 

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