Regarding MOSS or WSS 3.0, What parts of the API might have been implemented better?

孤人 提交于 2019-12-04 23:42:05

问题


Such as:

  • Sealed Methods you might have liked to extend
  • Exceptions thrown are more vague than is helpful
  • Elimination of Connected Content which was a major feature in MCMS 2002
  • HTML is stripped from fields when stored and returned. No easy option to work around this problem
  • Creating an SPWeb takes an eternity.
  • Nonexistant migration path from MCMC 2002

回答1:


I wish that the Sharepoint object model was purely managed code. Although having .NET wrappers is convenient, having to worry about disposing the many objects that implement IDisposable is a pain. It's so easy to run into memory issues when dispose does not get called in a WSS app. And I thought the reason for moving to .NET was to free developers from having to deal with memory management...




回答2:


How about refactoring Properties that result in additional database calls to methods instead, for example the Items property on SPList.




回答3:


Any of the SPList API could use a complete rewrite. Trying to deal with libraries with nested folders is a complete nightmare with the list being completely flattened with no obvious hierarchical structure.

Another wonderful addition would be adding interfaces to SPWeb, SPList and other Sharepoint classes to aid testing.




回答4:


Has anyone seen this method: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx This method shows the unbelievable nonsense that Sharepoint exposes to developers.




回答5:


My personal favourite is the SPField.GetFieldValue Method. I have no idea why they designed it the way they did, but to me it does hardly make sense. To get a object out of a ListItem you have to do somethine like:

SPField field = ((SPList)list).Fields.GetField("FieldName"); 
object fieldValue = field.GetFieldValue(((SPListItem)item)[field.Title].ToString());

Getting an object out of a ListItem is IMO a basic operation, so this should not be that complicated.




回答6:


Inconsistencies when passing field names to methods or arrays. For example:

  • SPFieldCollection.ContainsField(): Internal name or display name
  • SPFieldCollection.GetField(): Internal name or display name
  • SPFieldCollection.GetFieldByInternalName(): Internal name
  • SPFieldCollection.Item: Display name
  • SPListItem.Item: Internal name or display name
  • SPListItem.GetFormattedValue(): Internal name or display name
  • SPViewFieldCollection.Exists: Internal name

To put the icing on the cake, there is usually no documentation about whether a method takes internal and/or display name.



来源:https://stackoverflow.com/questions/525968/regarding-moss-or-wss-3-0-what-parts-of-the-api-might-have-been-implemented-bet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!