惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
SegmentFault 最新的问题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Attack and Defense Labs
Attack and Defense Labs
F
Full Disclosure
Vercel News
Vercel News
N
News | PayPal Newsroom
The GitHub Blog
The GitHub Blog
H
Hacker News: Front Page
H
Heimdal Security Blog
P
Privacy International News Feed
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cisco Blogs
L
Lohrmann on Cybersecurity
D
Docker
Recent Announcements
Recent Announcements
Security Archives - TechRepublic
Security Archives - TechRepublic
人人都是产品经理
人人都是产品经理
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Proofpoint News Feed
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 叶小钗
Google Online Security Blog
Google Online Security Blog
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
S
Secure Thoughts
博客园 - Franky
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
P
Palo Alto Networks Blog
Latest news
Latest news
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
Last Week in AI
Last Week in AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cyberwarzone
Cyberwarzone
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Threatpost
T
Tenable Blog
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学

博客园 - 中国Rainbow

dudu你真了不起! 中国DNN开通了『模块演示』栏目 DNN3.3.1 &4.3.1简体中文语言包发布 6月28日 中国DNN启用太阳网服务器-中国DNN的第三次邀请(更新) 好久没有写东西,今天报个到! 感恩的心 萍聚 把根留住 开始翻译DotNetNuke 3.0 Module Developer’s Guide-目录 请下载DotNetNue的技术文档DotNetNuke Code Access Security中文翻译稿 System.Xml 命名空间 sestem.Web 命名空间 System.Configuration 命名空间 System.Collections.Specialized 命名空间 System.Collections 命名空间 System.IO 命名空间 System 命名空间 DNN如何加载Provider信息 DNN的数据访问配置
DNN的数据访问的抽象类
中国Rainbow · 2005-06-30 · via 博客园 - 中国Rainbow

DNN的数据访问的抽象类在\Components\Providers\Data\DataProvider.vb,包括DNN的所有数据访问方法。其中 Instance()就是 factory自己,并且通过WEB.CONFIG加载相应的程序集。
 

        ' provider constants - eliminates need for Reflection later

        Private Const [ProviderType] As String = "data" ' maps to <sectionGroup> in web.config

        ' create a variable to store the reference to the instantiated object

        Private Shared objProvider As DataProvider

        Public Shared Function Instance() As DataProvider

            ' does the provider reference already exist?

            If objProvider Is Nothing Then

                Dim strCacheKey As String = [ProviderType] & "provider"

                ' use the cache because the reflection used later is expensive

                Dim objType As Type = CType(DataCache.GetCache(strCacheKey), Type)

                If objType Is Nothing Then

                    ' Get the provider configuration based on the type

                    Dim objProviderConfiguration As ProviderConfiguration = ProviderConfiguration.GetProviderConfiguration([ProviderType])

                    ' The assembly should be in \bin or GAC, so we simply need to get an instance of the type

                    Try

                        ' Get the typename of the Core DataProvider from web.config

                        Dim strTypeName As String = CType(objProviderConfiguration.Providers(objProviderConfiguration.DefaultProvider), Provider).Type

                        ' use reflection to get the type of the class that implements the provider

                        objType = Type.GetType(strTypeName, True)

                        ' 把类型插入到缓存

                        DataCache.SetCache(strCacheKey, objType)

                    Catch e As Exception

                        ' Could not load the provider - this is likely due to binary compatibility issues

                    End Try

                End If

                ' 保存引用

                objProvider = CType(Activator.CreateInstance(objType), DataProvider)

            End If

            Return objProvider

        End Function
所有的方法都要求重写,也就是说相关的调用都必须重写这个方法。
 

        ' 链接模块

        Public MustOverride Function GetLinks(ByVal ModuleId As Integer) As IDataReader

        Public MustOverride Function GetLink(ByVal ItemID As Integer, ByVal ModuleId As Integer) As IDataReader

        Public MustOverride Sub DeleteLink(ByVal ItemID As Integer)

        Public MustOverride Sub AddLink(ByVal ModuleId As Integer, ByVal UserName As String, ByVal Title As String, ByVal Url As String, ByVal MobileUrl As String, ByVal ViewOrder As String, ByVal Description As String, ByVal NewWindow As Boolean)

        Public MustOverride Sub UpdateLink(ByVal ItemId As Integer, ByVal UserName As String, ByVal Title As String, ByVal Url As String, ByVal MobileUrl As String, ByVal ViewOrder As String, ByVal Description As String, ByVal NewWindow As Boolean)