Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are better ways, but let's take a step back and look at it conceptually. What are all objects doing? Loading and Saving. When you get the object from memory, you really don't to have to care whether it gets its information from a file, a database, or the windows registry. You just want the object loaded. That's important to remember because later on, your maintanence programmer will look at the LoadFromFile() method and wonder, "Why is it called that since it really doesn't load anything from a file?"</p> <p>Secondly, you're running into the issue that we all run into, and it's based in dividing work. You want a level that handles getting data from a physical source; you want a level that manipulates this data, and you want a level that displays this data. This is the crux of <a href="http://csharpstruggles.blogspot.com/2004/08/n-tier-development.html" rel="nofollow noreferrer">N-Tier Development</a>. I've linked to an article that <a href="http://www.simple-talk.com/dotnet/.net-framework/.net-application-architecture-the-data-access-layer/" rel="nofollow noreferrer">discusses your problem</a> in great detail, and details how to create a Data Access Layer to resolve your issue. There are also numerous code projects <a href="http://www.dotnetheaven.com/Uploadfile/tavanover/NTierDevelopmentwithMS102052006231650PM/NTierDevelopmentwithMS1.aspx" rel="nofollow noreferrer">here</a> and <a href="http://geekswithblogs.net/steveclements/archive/2006/08/31/89892.aspx" rel="nofollow noreferrer">here</a>. </p> <p>If it's Java you seek, simply substitute 'java' for .NET and search for 'Java N-Tier development'. However, besides syntactical differences, the design structure is the same.</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