欢迎来到麦多课文档分享! | 帮助中心 海量文档,免费浏览,给你所需,享你所想!
麦多课文档分享
全部分类
  • 标准规范>
  • 教学课件>
  • 考试资料>
  • 办公文档>
  • 学术论文>
  • 行业资料>
  • 易语言源码>
  • ImageVerifierCode 换一换
    首页 麦多课文档分享 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    Enterprise Library for Framework 2.0-Core Architecture.ppt

    • 资源ID:374449       资源大小:1.67MB        全文页数:30页
    • 资源格式: PPT        下载积分:2000积分
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    二维码
    微信扫一扫登录
    下载资源需要2000积分(如需开发票,请勿充值!)
    邮箱/手机:
    温馨提示:
    如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如需开发票,请勿充值!如填写123,账号就是123,密码也是123。
    支付方式: 支付宝扫码支付    微信扫码支付   
    验证码:   换一换

    加入VIP,交流精品资源
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    Enterprise Library for Framework 2.0-Core Architecture.ppt

    1、Enterprise Library for .NET Framework 2.0: Core Architecture,Enterprise Library for .NET Framework 2.0,Major new release of Enterprise Library Designed for Microsoft .NET Framework 2.0 Leverages key new capabilities provided by the platform Certain features from Enterprise Library v1.x have been dep

    2、recated in favor of the platform Scenarios and features largely unchanged Public application programming interfaces (APIs) not identical, but changes are minor but many improvements are hiding under the covers!,Key Changes from Enterprise Library 1.x,Configuration now built on System.Configuration C

    3、onfiguration Application Block no longer exists Easier to use blocks with or without configuration files Instrumentation configurable and disabled by default Much improved Logging Application Block Flexibility and performance Simpler and more powerful Data Access Application Block Use with OLE-DB, O

    4、pen Database Connectivity (ODBC) or any managed provider Most of the Security Application Block has been removed Deprecated in favor of .NET Membership and Profile features,Caching,Security,Data Access,Logging,Exception Handling,Enterprise Library for .NET Framework 2.0,Cryptography,Core,Block Depen

    5、dency,Optional Provider Dependency,Caching,Security,Data Access,Logging,Exception Handling,Enterprise Library for .NET Framework 2.0,Plug-in,Config Helpers & Design,Instrumen- tation,Object Builder,Cryptography,Core,Block Dependency,Optional Provider Dependency,Core Architecture,Configuration runtim

    6、e Configuration design and tooling Instrumentation Factories and object builder,Configuration in Enterprise Library,All Enterprise Library blocks are configurable Controls how the blocks work in your application Specifies which plug-ins you are using Previous versions of Enterprise Library included

    7、a Configuration Application Block Supported reading/writing complex configuration objects from pluggable storage Used by all Enterprise Library blocks, and can be used by customer code In Enterprise Library for .NET Framework 2.0, the requirements are the same but the solution is different,System.Co

    8、nfiguration in .NET 2.0,Much more powerful than the Microsoft .NET Framework 1.x classes Supports reading and writing rich graphs of objects Automatic serialization and deserialization between configuration classes and XML using ConfigurationSection and ConfigurationElement Some Enterprise Library 1

    9、.x features are not directly supported Storing configuration somewhere other than XML Files Monitoring external changes to configuration,Configuration Runtime,Enterprise Library for .NET Framework 2.0 uses System.Configuration, but provides additional helper classes to provide more functionality All

    10、 blocks provide ConfigurationSections which are stored in app.config / web.config by default All System.Configuration features such as encryption and using external files are supported Configuration Runtime helper classes are in the Common assembly Used by all Enterprise Library application blocks C

    11、an be used by your apps, but you generally wont need to,Configuration Sources,Application Blocks or Custom Code,IConfigurationSource,SystemConfiguration Source,FileConfiguration Source,SqlConfiguration Source,app.config / web.config,foo.config,app.config / web.configDefault ConfigurationSource = ,Sy

    12、stem.Configuration,File Watcher,File Watcher,Configuration Sources,Abstract interface that supports loading/saving configuration and monitoring for changes Two implementations included in the core SystemConfigurationSource defers to System.Configuration to read from default configuration file (plus

    13、adds file watchers) FileConfigurationSource defers to System.Configuration but reads from arbitrary files SqlConfigurationSource included as a sample Requires that sections derive from SerializableConfigurationSection,Choosing a Configuration Source,Several ways of choosing a configuration source wh

    14、en using Enterprise Library If you access blocks using static faades or factories (Examples: DatabaseFactory, Logger), you will always use the applications default ConfigurationSource: If you define a ConfigurationSources section in your default.config file, you can specify which type of source shou

    15、ld be used If you dont have this section, SystemConfigurationSource is used If you use the instance factories (Examples:DatabaseProviderFactory, LogWriterFactory) you can specify a configuration source of your choosing Instantiated directly or using ConfigurationSourceFactory,Configuration Source Ex

    16、amples,/ Use default source specified in the app.config / web.config file Database db1 = DatabaseFactory.CreateDatabase(“Sales”);/ Use the specified source you dont need an app.config / web.config file FileConfigurationSource fileSource = new FileConfigurationSource(“tom.config”); DatabaseProviderFa

    17、ctory factory = new DatabaseProviderFactory(fileSource); Database db2 = factory.Create(“Sales”);,Change Notifications,IConfigurationSource supports monitoring configuration data for changes AddSectionHandler(string sectionName, ConfigurationChangedEventHandler handler) RemoveSectionHandler(string se

    18、ctionName, ConfigurationChangedEventHandler handler) Any code can register for changes and respond accordingly In Enterprise Library, only the Logging Application Block currently registers to receive change notification events,Configuration Design and Tooling,Configuration tool eliminates the need t

    19、o edit the blocks XML configuration files Quickly add default configuration for a block Strongly-typed properties and providers Validate configuration before you save No major changes to configuration tool user experience from previous versions of Enterprise Library Configuration design-time subsyst

    20、em can be used in your own applications and blocks to provide a similar experience for your users,Configuration Design-Time,Improved API Simple base configuration design manager Better node registration and command registration 3 to 4 simple classes to register your custom provider No more OnSited O

    21、ne configuration design manager per section Dependent configuration design managers Easy to interop with any .NET configuration,Instrumentation,All Enterprise Library blocks include instrumentation to assist in development, testing and operations Event Log events Performance Counters Microsoft Windo

    22、ws Management Instrumentation (WMI) events All instrumentation is disabled by default, but each type can be individually enabled using the configuration tool Instrumentation code contained in common assembly can be reused in your apps,Enabling Instrumentation,Run the installer classes to create the

    23、instrumentation artifacts: Run installservices.bat (using an admin account), or Run installutil.exe over each Enterprise Library assembly (using an admin account), or Create your own installers/MSI that do this Configure instrumentation for your app using the tool,Instrumentation Architecture,Event-

    24、driven architecture,Instrumentation Provider Class(es),Instrumentation Listener Class(es),Instrumentation Configuration Settings,WMI,Perf Counters,Event Log,Event,ObjectBuilder,Wires up,Application or Block,calls,Instrumentation Attributes,Instrumentation is wired up using attributes: Instrumentatio

    25、nListener Defined on a type within the block or application Specifies which listener will deal with instrumentation events InstrumentationProvider Defined on an event within the block or application Specifies the name of the event being fired InstrumentationConsumer Defined on a method within the in

    26、strumentation listener The method contains the instrumentation logic, and the name must match the one used in an InstrumentationProvider declaration,Instrumentation Example,public class Database : IInstrumentationEventProvider DbConnection OpenConnection() / Do stuffinstrumentationProvider.FireConne

    27、ctionOpenedEvent();public object GetInstrumentationEventProvider() return instrumentationProvider; ,InstrumentationListener( typeof(DataInstrumentationListener), typeof(DataInstrumentationListenerBinder)public class DataInstrumentationProvider InstrumentationProvider(“ConnectionOpened“)public event

    28、EventHandler connectionOpened;public void FireConnectionOpenedEvent() connectionOpened(this, new EventArgs(); ,internal class DataInstrumentationListener : InstrumentationListener public DataInstrumentationListener(string instanceName, bool perfCountersEnabled, bool eventLogEnabled, bool wmiEnabled)

    29、 :base(perf, event, wmi) InstrumentationConsumer( “ConnectionOpened“) public void ConnectionOpened(object sender, EventArgs e) if (PerformanceCountersEnabled)connectionOpenedCounter.Increment(); ,Instrumentation Installation Attributes,Running installutil over an instrumented class should install al

    30、l required event log sources, WMI schemas and performance counters Enterprise Library provides a ReflectionInstaller which uses reflection to find these, with the help of some attributes HasInstallableResources Indicates that there is instrumentation to install PerformanceCountersDefinition Defines

    31、the counters used by the block or app EventLogDefinition Defines the event log sources used by the block or app,Factories and Object Builder,Objects inside application blocks need to be constructed and configured There are different ways you can construct objects depending on what you want to do Use

    32、 a default configuration source Use a custom configuration source Dont use any configuration at all Inject instrumentation Although each block is different, all rely on similar types of factories for construction,Object Builder,New subsystem shared between EntLib and Composite UI Application Block R

    33、esponsible for building objects inside the application blocks Invoking the necessary custom factory using data from configuration Configuring instrumentation for the blocks Can be leveraged from your own apps, but understanding ObjectBuilder is not required to use Enterprise Library,Core,Application

    34、 Block,Factories,Static Factory or faade,Instance Provider Factory,Enterprise LibraryFactory,CustomFactory,Block Objects,Object Builder,Strategies,User Code,Configuration Source,Using Static Facades and Factories,Easiest way to use the blocks Configuration is retrieved from the default configuration

    35、 source Instrumentation is wired up (but may be disabled) Results in a call to an instance factory behind the scenes Examples: Dim db As Database = DatabaseFactory.CreateDatabase(“Sales”) Logger.Write(“My message”, “My Category”),Using Instance Provider Factories,You get slightly more control on how

    36、 objects are created You can choose your own configuration source Instrumentation is wired up (but may be disabled) Examples: Dim factory As New DatabaseProviderFactory(configSource) Dim db As Database = factory.Create(“Sales”) Dim factory As New LogWriterFactory(configSource) Dim writer As LogWrite

    37、r = factory.Create(),Creating Objects Directly,New up the object and any dependent objects yourself Configuration sources are not used Object Builder is not involved Instrumentation will not be automatically wired up (but you can add it yourself) Example: Dim db As SqlDatabase = New SqlDatabase(“server=(local)SQLEXPRESS;database=EntLibQuickStarts;Integrated Security=true“),Resources,Download Enterprise Library and related resources from: http:/ Join the Enterprise Library Community at: http:/ Read blogs from the Enterprise Library team at: http:/


    注意事项

    本文(Enterprise Library for Framework 2.0-Core Architecture.ppt)为本站会员(postpastor181)主动上传,麦多课文档分享仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文档分享(点击联系客服),我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1 

    收起
    展开