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

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

博客园 - 中国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)