Showing posts with label classes. Show all posts
Showing posts with label classes. Show all posts

Thursday, March 22, 2012

classes Vs structs

Hi All

i want to know for passsing the data between layers in my application ,is it better i use class or struct acoording to advantage and disadvantages of them ,and i dont need to serialazation of data or hierarchy that only class have these advantages ,whic one is better to use?

thanks

It depends on your requirements. It is hard to say one way or the other. You should probably redirect the question to the Visual Studio data access forum or one of the programming language forums since this has nothing to do with TSQL.sqlsql

Classes Per Table ( and vice versa ) Design

I work on the Clinical Surgery Department Data Application.
The patient gets through the Admission, Surgery, PostSurgery and Discharge stages during his staying in the department. The Doctors just insert their medical data in to the different tables. I have three main classes: User, Patient and Portfolio ( patients portfolio ) and all the business bases on these classes.
The problem is with the Classes per Medical Data Tables. The Medical tables should exist cause it includes the medical data about the patient however what is not clear: Whether I should create Business and Entity classes per each medical data table ( and this is something like 50 tables ) or I should insert all the functions in the Portfolio class and then there will be a mess of functions in one class? What is the accepted way to perform it ?I'd create a base portfolio class, then create sub-classes for each of the sub-types. Put the common functions for all portfolio entries in the parent class, then put the specific functions into the appropriate sub-class.

-PatP