Click here to Skip to main content
15,900,511 members
Home / Discussions / C#
   

C#

 
GeneralRe: Avoid Peer 2 Peer acces Pin
fjdiewornncalwe3-Dec-10 1:15
professionalfjdiewornncalwe3-Dec-10 1:15 
AnswerRe: Avoid Peer 2 Peer acces Pin
T M Gray2-Dec-10 11:08
T M Gray2-Dec-10 11:08 
QuestionFlickering Pin
peropata2-Dec-10 3:43
peropata2-Dec-10 3:43 
AnswerRe: Flickering Pin
musefan2-Dec-10 3:52
musefan2-Dec-10 3:52 
AnswerRe: Flickering Pin
phil.o2-Dec-10 4:07
professionalphil.o2-Dec-10 4:07 
GeneralRe: Flickering Pin
musefan2-Dec-10 4:11
musefan2-Dec-10 4:11 
GeneralRe: Flickering [modified] Pin
phil.o2-Dec-10 4:46
professionalphil.o2-Dec-10 4:46 
GeneralRe: Flickering Pin
Luc Pattyn2-Dec-10 4:54
sitebuilderLuc Pattyn2-Dec-10 4:54 
GeneralRe: Flickering Pin
phil.o2-Dec-10 5:02
professionalphil.o2-Dec-10 5:02 
GeneralRe: Flickering Pin
musefan2-Dec-10 5:11
musefan2-Dec-10 5:11 
GeneralRe: Flickering Pin
peropata2-Dec-10 5:38
peropata2-Dec-10 5:38 
GeneralRe: Flickering Pin
Luc Pattyn2-Dec-10 6:43
sitebuilderLuc Pattyn2-Dec-10 6:43 
GeneralRe: Flickering Pin
peropata2-Dec-10 7:10
peropata2-Dec-10 7:10 
AnswerRe: Flickering Pin
Luc Pattyn2-Dec-10 4:10
sitebuilderLuc Pattyn2-Dec-10 4:10 
GeneralRe: Flickering Pin
musefan2-Dec-10 4:15
musefan2-Dec-10 4:15 
GeneralRe: Flickering Pin
Luc Pattyn2-Dec-10 4:22
sitebuilderLuc Pattyn2-Dec-10 4:22 
QuestionBeginners help with classes Pin
kruegs352-Dec-10 2:43
kruegs352-Dec-10 2:43 
AnswerRe: Beginners help with classes Pin
Hiren solanki2-Dec-10 2:55
Hiren solanki2-Dec-10 2:55 
AnswerRe: Beginners help with classes Pin
Luc Pattyn2-Dec-10 2:59
sitebuilderLuc Pattyn2-Dec-10 2:59 
AnswerRe: Beginners help with classes Pin
musefan2-Dec-10 3:13
musefan2-Dec-10 3:13 
GeneralRe: Beginners help with classes Pin
kruegs352-Dec-10 3:28
kruegs352-Dec-10 3:28 
GeneralRe: Beginners help with classes Pin
musefan2-Dec-10 3:38
musefan2-Dec-10 3:38 
GeneralRe: Beginners help with classes Pin
PIEBALDconsult2-Dec-10 8:25
mvePIEBALDconsult2-Dec-10 8:25 
Yes, yes you can. But does it make sense to do so in your particular application?

In my opinion (and it may be rather unpopular with the Linq-fanboys), you should only do that if you have the data hanging around for a while and interacting with other classes. In most of the applications I write, that doesn't happen. Maybe I read a line from a CSV file, parse it directly into SqlParameters and do an Insert, or query some data via a DataReader and write it out (CSV, XML, etc.) -- there is absolutely no need to store the data in a class, it would just needlessly bog things down.

But, there are times where having data in classes is useful. For instance maybe your car has an owner -- you can have separate classes for the car and its owner, with a relationship between them*. Now, I don't think Linq can do that (I could very easily be wrong about that), at most it would have separate classes for car and owner, but no relationship. In a DataSet (which I also don't use) the DataTables might have a relationship, but as far as I know, Linq won't.

I would also use a class if I'm passing data across a Web Service -- and I don't know whether or not Linq can do that.

So, when I use classes to hold data, I don't use Linq or EF or any other ORM tool -- I craft them myself.

*
class Person { ... }
class Car { ... Person Owner ... }

Person me = new Person(...) ;
Car mycar = new Car(...) ;
mycar.Owner = me ;

AnswerRe: Beginners help with classes Pin
#realJSOP2-Dec-10 3:21
professional#realJSOP2-Dec-10 3:21 
GeneralRe: Beginners help with classes Pin
kruegs352-Dec-10 3:45
kruegs352-Dec-10 3:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.