Re: Better n-tier suggestions
- From: cbmeeks <cbmeeks@xxxxxxxxx>
- Date: Tue, 12 Feb 2008 13:12:18 -0800 (PST)
On Feb 12, 4:09 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
With all due respect, it can be made easier, use LINQ to SQL. Doing
something like this by hand for something this simple is just masochistic.
Even if you can't use LINQ to SQL, there are other options to make your
life much, much easier. NHibernate is an option that might be of use to
you.
In the end, if you use something with designer support, it will help
prevent you from having to make these changes by hand when they arise.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"cbmeeks" <cbme...@xxxxxxxxx> wrote in message
news:b4392309-0674-48a2-9658-5b9788c1a0ca@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I work for a small company that has existing code from several people.
The existing code base is pretty good overall but we do have lots of
embedded SQL, hard-coded this, and other types of garbage floating
around.
One thing I want to do is better separate our data layers with our
business layers. I would like to do that using some type of ORM.
However, here's the deal, I want to do it by hand...ie, the hard way.
Our needs are pretty slim for now so I don't believe this to be a
major problem.
I am looking for suggestions/pointers to accomplish the following:
Say I have a table in my database called Persons. Persons table
contains columns ID, Name, Age.
Now, in C#, I would like to do the following:
Persons p = new Persons();
p.Name = "Chuck U. Farley";
p.Age = 35;
p.Save();
The Save method would create the desired SQL for the insert.
Now, I can mock up something that actually works pretty well. But the
problem is if I decide to change the database column "Name" to
"FullName". I then have to change code, etc.
I use methods to reduce the amount of code changes but I just feel the
whole process could be made simpler.
Any suggestions?
Thanks!
Thanks. And yes, I did forget to mention that LINQ is out due to
machines only having .NET 2.0 and management doesn't want to roll out
3.5 (hey, I'm just a programmer...lol)
I will check out NHibernate.
Fortunately, our tables almost never change. We've had like 4 changes
in a year and they were very minor.
Thanks again.
.
- Follow-Ups:
- Re: Better n-tier suggestions
- From: Arne Vajhøj
- Re: Better n-tier suggestions
- References:
- Better n-tier suggestions
- From: cbmeeks
- Re: Better n-tier suggestions
- From: Nicholas Paldino [.NET/C# MVP]
- Better n-tier suggestions
- Prev by Date: Re: Multithreaded GC!
- Next by Date: Re: Newbie to dotnet
- Previous by thread: Re: Better n-tier suggestions
- Next by thread: Re: Better n-tier suggestions
- Index(es):
Relevant Pages
|