c# - Combine Class/Table with middletable value -
i'm trying learn structure (datamodel)classes reflect database structure.
coming web-development haven't bothered in past creating objects reflected database content. i've been used working raw array data.
the structure of data in system i'm trying develop based around translations. after bit of research decided split tables "static" , "translation" data storage. below example of database structure using sqlite:
table: tutorial (pk)id : integer positionx : integer positiony: integer table: tutorial_translation (fk)tutorial_id : integer (fk)language_id : integer title : text text : text table: language (pk)id : integer title : text country : text
now idea, may have guessed, store text tutorials in middletable "tutorial_translation". when wish display given tutorial, i'd join "tutorial_translation" values "title" , "text" "tutorial" table based on "tutorial id" , "language id" has been set beforehand.
so far good.. "problem" occour here, have structure system classes around these database tables, work flawlessly using sqlite framework.
i feedback of idea class structure i'm thinking using:
class: tutorial id : int position : point _positionx : int _positiony : int titletext : tutorialtranslation class: tutorialtranslation tutorial_id : int language_id : int title : string text : string
if use structure this, instantiate object of tutorial , call it's title or text, through tutorialtranslation object.
my questions are:
- is (enough) structure of system classes reflect database design?
- if so, best way create object of tutorialtranslation in constructor of tutorial? -> there way sqlite me?
is (enough) structure of system classes reflect database design?
far can tell, looks okay me.if so, best way create object of tutorialtranslation in constructor of tutorial? -> there way sqlite me?
have create custom class in project pull relevant information database. when these results have been obtained, class initialize fields data obtained. don't know how done in 'web-development' environment coming inc#
, have quite bit of work on own.
Comments
Post a Comment