Question 75
You are designing a feature for a SharePoint 2010 solution that will be activated by default in your site definition. The values for the configuration settings are based on the particular Web site on which the feature is activated. You have the following requirements:
.Setting the configuration values should not cause downtime.
.The configuration settings must be accessible by other features.
You need to design how the configuration settings will be stored. Which approach should you recommend?
A. Specify the configuration settings using the SPWebConfigModification object.
B. Specify the configuration settings in the property bag for the Web site.
C. Place the configuration settings in the web.config file.
D. Place the configuration settings in a list created by the site definition.

解析:
  你计划创建一个网站定义,此网站定义中包含一个Feature,此Feature默认的会被自动激活, 相关的配置值取决于Feature被激活时所在的网站,也即与网站对象相关联, 并且需要满足如下要求:
  要求1. 在设置配置值时不得造成业务活动的停止
  要求2. 配置值可以被其它功能访问到
  你需要考虑如何保存这些配置值。
  在SharePoint里有许多地方可以存放配置数据。对于SharePoint委托控件(DelegateControl),你可以使用Element manifest文件。对于WebPart,你可以使用.webpart文件。对于全局配置,你可以使用web.config,自定义SharePoint列表,或者SPFarm,SPWebApplication,SPSite,SPWeb和SPList上的属性包。
  首先,根据要求1:在设置配置值时不得造成业务活动的停止,我们可以排除任何关于Web.config的修改,因为任何对此文件的修改都需要重新启动应用才能生效,由此必然导致业务活动停止。所以选项A.C均可排除。
其次选项B. Property Bags, 这是一个存放键-值对配置信息的好地方,Sharepoint的以下层次的对象中均提供了对应的Property Bags。
a. Farm (SPFarm class)
b. Web application (SPWebApplication class)
c. Site collection (SPSite class)
d. Site (SPWeb class)
e. List (SPList class)
   我们可以找到与特定的Web Site对应的Property Bag,使用它来存储配置信息并供其它Feature访问。示例代码如下:
设置配置值
SPSite siteCollection = new SPSite("  ");
SPWeb website = mySite.RootWeb;
website.Properties.Add(" KeyName ", "KeyValue");
website.Properties.Update

读取配置值:
SPSite siteCollection = new SPSite("");
SPWeb website = mySite.RootWeb;
string MyValue = website.AllProperties["KeyName"]);
   所以Property Bag应该是本题的正选。
   至于选项D,把配置信息保存在网站定义所内含的列表中,把列表作为保存配置信息的方式也不是不可,但这种方式并非是基于特定的SPWeb对象,而是基于特定的SPList对象的信息保存方式,与本题的” The values for the configuration settings are based on the particular Web site”所要求的层次级别不符,所以应该被排除。
因此本题答案应该选 B

参考 
http://msdn.microsoft.com/zh-cn/library/gg491705.aspx
http://msdn.microsoft.com/zh-cn/library/ms414322(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/gg491706(v=office.14).aspx

Question 76
You are designing a SharePoint 2010 solution. Site administrators do not have direct access to the file system on the Web servers. You need to design the solution according to following requirements:
.It must contain a set of Web Parts that receive information from a common collection of configuration data.
.Site administrators must be able to modify the configuration settings for individual sites using the standard SharePoint user interface. Which approach should you recommend?
A. Set the configuration data with the SPWebConfigModification object.
B. Set the configuration data with SharePoint persisted objects.
C. Set the configuration data in the property bag for each Web site.
D. Set the configuration data in a list on each site where the Web Parts are placed.

解析:
  你设计一个Sharepoint2010解决方案,网站管理员无权直接访问Web服务器上的文件系统,你的解决方案需要满足如下要求:
  要求1. 包含一组Web Parts,它们可以从普通的配置信息集中获取信息
  要求2. 网站管理员可以通过Sharepoint用户界面修改各个网站的配置数据。
  你应该采用哪种方法来实现需求。
   由于选项A.B.C均没有提供用户界面来修改相应的配置,而且也不属于普通的配置信息。
   其中选项A是使用 SharePoint Foundation 对象模型来修改 web.config 设置,而根据题干管理员无权直接访问Web服务器上的文件系统。
   选项B通过Persistent Object, 我们知道SPPersistedObject类是用于为对象提供自动序列化其状态值并持久保存以及在需要时获取前面所保存的值并反序列化的相关方法。也即,它属于定义自定义管理设置方面的类。在 Windows SharePoint Services 平台上构建应用程序时,您可能需要创建一个类以定义应用程序的自定义属性设置并提供用于存储这些设置的方法。很明显它不是普通的配置信息,也没有提供用户界面以供修改。
   选项C通过属性包,如我们前面所述,这是一个存放键-值对配置信息的好地方,Sharepoint对SPFarm,SPWebApplication,SPSite,SPWeb和SPList这几个层次的对象均提供了属性包,但我们并没有用户界面来修改它们。
    所以只剩下了选项D.通过保存在列表中的配置信息来达到本题要求。
  因此本题答案应该选 D

参考 
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.administration.sppersistedobject.aspx
http://msdn.microsoft.com/zh-cn/library/gg491706(v=office.14).aspx

Question 77
 You are designing a SharePoint 2010 application that connects to an external Microsoft SQL Server database. You have the following requirements:
.Server administrators can add and edit connection strings at the Web application level.
.SharePoint users must not be able to view or modify sensitive data in the connection strings.
.Server administrators can add or change the connection strings declaratively with no custom UI required.
.The connection strings can be modified programmatically without redeploying code.
You need to create a plan to store connection strings for the database within the SharePoint system. Which approach should you recommend?
A. Add or change the connection strings in the web.config file.
B. Use a hierarchical object store configuration approach to store the connection strings.
C. Use a property bag configuration approach to store the connection strings.
D. Use SharePoint lists to store the connection strings.

解析:
   你设计一个Sharepoint2010应用程序,需要连接到Sharepoint系统外部的SQL数据库, 并满足如下要求:
  要求1. 服务器管理员可以在Web Application级别添加,修改数据库连接字符串
  要求2. 必须禁止Sharepoint用户查看和修改连接字符串中的敏感数据
  要求3. 服务器管理员可以通过非定制界面添加或修改连接字符串
  要求4. 可以无需重新部署代码来以可编程方式修改连接字符串
   你需要考虑在Sharepoint系统内采取哪种方式来保存连接字符串以达到上述要求。
   首先根据要求4,我们可以排除选项B. C。其中选项B使用hierarchical object store ,所谓hierarchical object store是指你通过创建继承自SPPersistedObject类的对象类实例来保存关于Farm, Web applications, features等等层次的用户的配置信息。此方法适用于你需要保存比较复杂的对象时使用。而选项C则通过属性包,我们知道Sharepoint对SPFarm,SPWebApplication,SPSite,SPWeb和SPList这几个层次的对象均提供了属性包。不管怎样,选项B.C均需要通过代码编程来应用,而且它们也并没有提供用户界面来修改维护。
   其次,选项D,使用列表保存配置信息,这种方式很明显违背了要求2,因为Sharepiont用户是可以查看到列表信息的,而且它也不满足服务器管理员可以在Web Application级别添加,修改数据库连接字符串这个要求。
    至于选项A,满足本题所有的要求。
 因此本题答案应该选 A

参考 
http://msdn.microsoft.com/en-us/library/ff647766.aspx
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.administration.sppersistedobject.aspx
http://msdn.microsoft.com/en-au/library/ms460914(v=office.12).aspx

Sharepoint学习笔记—习题系列--70-576习题解析 -(Q75-Q77)的更多相关文章

  1. Sharepoint学习笔记—ECM系列—文档列表的Metedata Navigation与Key Filter功能的实现

    如果一个文档列表中存放了成百上千的文档,想要快速的找到你想要的还真不是件容易的事,Sharepoint提供了Metedata Navigation与Key Filter功能可以帮助我们快速的过滤和定位 ...

  2. Sharepoint学习笔记—ECM系列--文档集(Document Set)的实现

    文档集是 SharePoint Server 2010 中的一项新功能,它使组织能够管理单个可交付文档或工作产品(可包含多个文档或文件).文档集是特殊类型的文件夹,它合并了唯一的文档集属性以及文件夹和 ...

  3. Sharepoint学习笔记—习题系列--70-576习题解析 --索引目录

        Sharepoint学习笔记—习题系列--70-576习题解析  为便于查阅,这里整理并列出了70-576习题解析系列的所有问题,有些内容可能会在以后更新. 需要事先申明的是:     1. ...

  4. Sharepoint学习笔记—习题系列--70-573习题解析 --索引目录

                  Sharepoint学习笔记—习题系列--70-573习题解析 为便于查阅,这里整理并列出了我前面播客中的关于70-573习题解析系列的所有问题,有些内容可能会在以后更新, ...

  5. Deep Learning(深度学习)学习笔记整理系列之(五)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  6. Deep Learning(深度学习)学习笔记整理系列之(八)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  7. Deep Learning(深度学习)学习笔记整理系列之(七)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  8. Deep Learning(深度学习)学习笔记整理系列之(六)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  9. Deep Learning(深度学习)学习笔记整理系列之(四)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  10. Deep Learning(深度学习)学习笔记整理系列之(三)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

随机推荐

  1. Sql Server优化之索引提示----我们为什么需要查询提示,Sql Server默认情况下优化策略选择的不足

    环境: Sql Server2012 SP3企业版,Windows Server2008 标准版 问题由来: 最近在做DB优化的时候,发现一个存储过程有非常严重的性能问题, 由于整个SP整体逻辑是一个 ...

  2. Android抓包方法(一)之Fiddler代理

    Android抓包方法(一) 之Fiddler代理 前言: 做前端测试,基本要求会抓包,会分析请求数据包,查看接口是否调用正确,数据返回是否正确,问题产生是定位根本原因等. 不管是之前做HTML5手机 ...

  3. 【模式匹配】更快的Boyer-Moore算法

    1. 引言 前一篇中介绍了字符串KMP算法,其利用失配时已匹配的字符信息,以确定下一次匹配时模式串的起始位置.本文所要介绍的Boyer-Moore算法是一种比KMP更快的字符串匹配算法,它到底是怎么快 ...

  4. SQL Server中的事务日志管理(8/9):优化日志吞吐量

    当一切正常时,没有必要特别留意什么是事务日志,它是如何工作的.你只要确保每个数据库都有正确的备份.当出现问题时,事务日志的理解对于采取修正操作是重要的,尤其在需要紧急恢复数据库到指定点时.这系列文章会 ...

  5. 使用Microsoft Fakes进行单元测试(2)

    接上一篇使用Microsoft Fakes进行单元测试(1) 下面进行Shim的演示. 2.使用Shim替换静态方法 假设我们需要一个工具方法用来格式化当前时间为字符串,因为DateTime.Now一 ...

  6. 30天C#基础巩固------了解委托,string练习

    ---->了解委托.     生活中的例子:我要打官司,我需要找一个律师,法庭上面律师为当事人辩护,它真正执行的是当事人的陈词,这时律师 就相当于一个委托对象.当事人则委托律师为自己辩解.    ...

  7. JS的跳转

    需要在下面的button中实现跳转,之前直接写了个<a>标签,但是在手机上的效果太差了,这是老大写的 js跳转.记下来,要学会贯通. <div class="ps-lt&q ...

  8. 为html.EditorFor添加样式

    有网友问及,怎样为html.EditorFor添加样式. 解决方法,可以参考下面语法: 先new一个htmlAttributes. @model Book @using Insus.NET.Model ...

  9. 一道java算法题分析

    最近在面试中遇到这样的一道算法题:       求100!的结果的各位数之和为多少?       如:5!=5*4*3*2*1=120,那么他们的和为1+2+0=3这道题不算难,不过倒是注意的细节也有 ...

  10. 分享一个递归无限级拼接Json的方法---ExtJs的TreePanel和TreeGrid均适用(Ef,Lambda,Linq,IQueryable,List)

    话不多说,先上实体类,如果你不是codefirst,就把它当成数据表结构. 下面是底层BaseDal获取数据的方法  (如果你没有Base类,直接写在你的DAL层和BLL层) 下面是BaseServi ...