views:

474

answers:

6

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
+2  A: 

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

Richard C. McGuire
+6  A: 

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...

barneytron
+1 you should see some of the patterns we've come up with for ensuring we properly dispose every SPWeb in a branching recursion
Rex M
I agree here too. SPWeb is a nightware to keep under control.
Ray Booysen
+1 SPWeb regularly hits my mom
Chris Ballance
+1  A: 

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.

Ray Booysen
Yes, this is a dangerous method in the wrong hands.
Chris Ballance
It would be great to see more details as to how you've seen it misused :)
Alex Angas
+2  A: 

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.

Ray Booysen
+1  A: 

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.

+1  A: 

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

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

Alex Angas
+1 for the "no documentation" remark. Drives me crazy.
Robert S.