<div id="RTEContent">Thanks for your deep explaintation. It's well known that MythTV's architecture <br>with OOP thinking, It's programming with Class of Application or Interface(my English is poor ,Maybe I can explain what I am thinking), For example, There are a lots of Class of Application or Interface in ../libmythtv:<br> tv_play.h/tv_rec.h/channelbase.h/channel.h/recordedbase.h/dtvrecorder.h/<br> 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 Channel/Program(i.e channel/program/record/recorded), These tables are dependent in OS/Application/Hardware, So I define these tables as follow:<br> Class ChannelInfo<br> {<br>
public:<br> ...<br> void getChannelInfo();<br> void setChannelInfo();<br> <br> void ChangeContrast();<br> void ChangeHue();<br> void ChangeBrightness();<br> <br> void ChannelUp();<br> void ChannelDown();<br> <br> void CheckChannelSignal();<br>
...<br> datatype chanid;<br> datatype channum;<br> datatype callsign;<br> ...<br> }<br> Class ProgramInfo<br> {<br> public:<br> ...<br> void getProgramInfo();<br> void setProgramInfo();<br> <br> ...<br> datatype chanid; //pk(chanid)<br> datatype
starttime; //pk(starttime)<br> ...<br> }<br> Class RecordInfo<br> {<br> public:<br> ...<br> void getRecordInfo();<br> void setRecordInfo();<br> ...<br> void getRecType();<br> void getRecStatus();<br> void getRecPrority();<br> ...<br> void isTimeslot();<br> void isSameProgram();<br> 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 <drig@noses.org></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>> Hi All<br>> How many tables in your database of MythTV,As for me, There are 45 <br>> tables in my MySQL. I have a idea for that create Class for every <br>> tables, Well, I mean that we can think table as an Class and record of <br>> table as Object, So do my idea is good?<br>><br>>
------------------------------------------------------------------------<br>> ÑÅ»¢1GÃâ·ÑÓÊÏä°Ù·Ö°Ù·ÀÀ¬»øÐÅ <http:><br>> ÑÅ»¢ÖúÊÖ-ËÑË÷¡¢É±¶¾¡¢·ÀɧÈÅ <http:><br>><br>>------------------------------------------------------------------------<br>><br>>_______________________________________________<br>>mythtv-users mailing list<br>>mythtv-users@mythtv.org<br>>http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users<br>> <br>><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