<div id="RTEContent">Thanks for your deep explaintation. It's well known that&nbsp; MythTV's architecture&nbsp; <br>with OOP thinking, It's programming&nbsp; with Class of Application or Interface(my English is poor ,Maybe I can explain what I am thinking), For example, There are a lots&nbsp; of Class of&nbsp; Application or&nbsp; Interface in&nbsp; ../libmythtv:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tv_play.h/tv_rec.h/channelbase.h/channel.h/recordedbase.h/dtvrecorder.h/<br> &nbsp;and so on. recoderbase is base Class, it was derived by DVBRecorder/HDTVRecorder/FireWareRecorder. channelbase is base class ,it also was derived by others. So I thinks Tables as Class and Record as Object is very different from MythTV's architecture. There are only four core tables for handle&nbsp; Channel/Program(i.e channel/program/record/recorded), These tables are&nbsp; dependent in OS/Application/Hardware, So I define these tables as follow:<br> Class ChannelInfo<br> {<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void getChannelInfo();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void setChannelInfo();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void ChangeContrast();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void ChangeHue();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void ChangeBrightness();<br> &nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void ChannelUp();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void ChannelDown();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void CheckChannelSignal();<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatype chanid;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatype channum;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatype callsign;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br> }<br> Class ProgramInfo<br> {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void getProgramInfo();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void setProgramInfo();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatype chanid;&nbsp; //pk(chanid)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; datatype
 starttime; //pk(starttime)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br> }<br> Class RecordInfo<br> {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void getRecordInfo();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void setRecordInfo();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void getRecType();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void getRecStatus();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void getRecPrority();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void isTimeslot();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void isSameProgram();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void
 isConflicting();<br> }<br> My question is how can I to define the methond of Class, That is my assume on above NOT ture for really. <br> Thanks <br><b><i>David Rudder &lt;drig@noses.org&gt;</i></b> Ð´µÀ£º<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> I think this is a good idea, but it's not as easy as all that. This is a <br>fairly standard programming problem. The problem with simply modeling <br>each table as a class is that it doesn't take into account foreign <br>relationships. For instance, with the CardInput class, you'd want to be <br>able to store a reference to the CaptureCard class, not just an integer <br>CardID. So, you can say "CaptureCard card = cardInput.getCaptureCard()" <br>and it will return a CaptureCard. Rather than having to say "CaptureCard <br>card = database.loadCaptureCard(cardInput.getCaptureCard())".<br><br>I guess what I'm saying is that I think you have a good beginning here <br>to make
 some very useful automation code, but you have to be careful <br>that your classes match the data model, or it'll end up being difficult <br>to use.<br><br>There's a Java project called Druid (available in Sourceforge. Search <br>google for it). It'll automatically generate C, C++ or Java code for <br>representing the data. It should help you get started.<br><br>Feel free to email me off line at<br>drig at noses dot org<br><br>-Dave<br><br>P.S. I also have 45 tables.<br>P.P.S. Once you have the database modeled in code, what are you going to <br>do with it? Any cool tools?<br><br>YanJun Lu wrote:<br><br>&gt; Hi All<br>&gt; How many tables in your database of MythTV,As for me, There are 45 <br>&gt; tables in my MySQL. I have a idea for that create Class for every <br>&gt; tables, Well, I mean that we can think table as an Class and record of <br>&gt; table as Object, So do my idea is good?<br>&gt;<br>&gt;
 ------------------------------------------------------------------------<br>&gt; ÑÅ»¢1GÃâ·ÑÓÊÏä°Ù·Ö°Ù·ÀÀ¬»øÐÅ <http:><br>&gt; ÑÅ»¢ÖúÊÖ-ËÑË÷¡¢É±¶¾¡¢·ÀɧÈÅ <http:><br>&gt;<br>&gt;------------------------------------------------------------------------<br>&gt;<br>&gt;_______________________________________________<br>&gt;mythtv-users mailing list<br>&gt;mythtv-users@mythtv.org<br>&gt;http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users<br>&gt;  <br>&gt;<br><br><br>_______________________________________________<br>mythtv-users mailing list<br>mythtv-users@mythtv.org<br>http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users<br></http:></http:></blockquote><br></div><p>__________________________________________________<br>¸Ï¿ì×¢²áÑÅ»¢³¬´óÈÝÁ¿Ãâ·ÑÓÊÏä?<br>http://cn.mail.yahoo.com