最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

一個(gè)ACCESS數(shù)據(jù)庫(kù)訪問的類第3/3頁(yè)

 更新時(shí)間:2006年07月09日 00:00:00   作者:  

還有一個(gè)讀取XML的類 XmlReader:
<%
Class XmlReader Private Xml Public Sub Load(ByVal Path)
Xml.Load(Server.MapPath(Path))
End Sub Public Function SelectSingleNode(ByVal XPath)
Set SelectSingleNode = Xml.SelectSingleNode(XPath)
End Function Public Function SelectNodes(ByVal XPath)
Set SelectNodes = Xml.SelectNodes(XPath)
End Function

Private Sub Class_initialize()
Set Xml = Server.CreateObject("Microsoft.XMLDOM")
Xml.async = False
'Xml.setProperty "ServerHTTPRequest", True
End Sub
Private Sub Class_Terminate()
Set Xml = Nothing
End Sub End Class
%>

好了,萬事俱備,開始搭建基本的三層:
數(shù)據(jù)模型層:此層對(duì)應(yīng)成一個(gè)類,類的類名和字段屬性對(duì)應(yīng)于數(shù)據(jù)庫(kù)的相應(yīng)表名及字段。
考慮表News,其結(jié)構(gòu)如下:


則其對(duì)應(yīng)的模型層如下:
<%
Class DataNews Private IAddDate
Private IContent
Private ICount
Private INewsID
Private ITitle
Private IUserID
Private IUserName Public Property Let AddDate(ByVal Value)
IAddDate = Value
End Property
Public Property Get AddDate()
AddDate = IAddDate
End Property Public Property Let Content(ByVal Value)
IContent = Value
End Property
Public Property Get Content()
Content = IContent
End Property Public Property Let Count(ByVal Value)
ICount = Value
End Property
Public Property Get Count()
Count = ICount
End Property Public Property Let NewsID(ByVal Value)
INewsID = Value
End Property
Public Property Get NewsID()
NewsID = INewsID
End Property Public Property Let Title(ByVal Value)
ITitle = Value
End Property
Public Property Get Title()
Title = ITitle
End Property Public Property Let UserID(ByVal Value)
IUserID = Value
End Property
Public Property Get UserID()
UserID = IUserID
End Property Public Property Let UserName(ByVal Value)
IUserName = Value
End Property
Public Property Get UserName()
UserName = IUserName
End Property Private Sub Class_initialize()
End Sub
Private Sub Class_Terminate()
End Sub End Class
%>

這里用了類名DataNews,因?yàn)閂BScript不支持Namespace(-_-),以前綴區(qū)分,而類中私有屬性用I作前綴,沒什么特別含義,僅僅是因?yàn)镮所占寬度較小,不影響理解時(shí)的聯(lián)想反應(yīng)速度,如果非要拉點(diǎn)合理的解釋的話,那么就是,Private中的I,以區(qū)分于Public,不用m_之類,是因?yàn)橛X得它不夠美觀,影響編碼心情(所以不喜歡寫C),因?yàn)樾枰詢?yōu)雅之心情,編寫優(yōu)雅的代碼(哎呀,誰(shuí)扔的雞蛋?拜托換個(gè)新鮮點(diǎn)的)。

相關(guān)文章

最新評(píng)論

石棉县| 滕州市| 大丰市| 青龙| 澎湖县| 宁海县| 利川市| 庄浪县| 扎赉特旗| 铁力市| 和田县| 北海市| 济阳县| 普陀区| 石屏县| 正阳县| 海宁市| 株洲市| 山西省| 建瓯市| 深水埗区| 孝义市| 宁阳县| 平泉县| 依安县| 宣城市| 若尔盖县| 永春县| 抚州市| 昂仁县| 嘉鱼县| 云浮市| 尉犁县| 祁东县| 恩平市| 东海县| 大理市| 中方县| 滨海县| 玉屏| 白水县|