Blog RegisterLogin
Menu
 
Hosted by Webhost4life
Tags: IT , Blog
Blog
Author: Tomasz Modelski Created: 2009-02-13 15:19:07Z
Blog

I’m trying to do some Sharepoint (WSS/MOSS) 2007 development, mostly advanced custom forms …. .
I’m little bit flustrated and right now I think (feel) that SHAREPOINT SUCKS.

It’s so … overcomplicated … unclear … strange.
Sharepoint Designer is so unfriendly tool.

I’m … angry and typed ‘Sharepoint sucks’ into google:

  • http://furuknap.blogspot.com/2009/10/sharepoint-sucks-and-heres-why-part-1.html 
  • http://furuknap.blogspot.com/2009/10/sharepoint-sucks-and-heres-why-part-2.html 

    Customers are easily impressed and sold when a salesperson, whether that person is a consultant or a bone-fide seller, demonstrate how easy it is to hack together a working proof-of-concept.
    When a real architect or developer enters the project,
    customers are shocked to learn that developing a SharePoint solution is nothing different from any other software development project and is a lot more expensive than the impression left by the sales process.

    When shit hits the fan, blame is easily placed, but the customer is still left without what they want. So, the customer is asked, again, to adjust their requirements to meet the solution.

  • http://www.realsoftwaredevelopment.com/why-sharepoint-portal-server-is-terrible/ 
  • http://sheehantu.wordpress.com/2008/02/01/sharepoint-sucks/ – & comments
  • And finally post from 2005 about SPS 2003. It’s like a prophet :-):
    Five Things wrong with Sharepoint: http://www.informit.com/articles/article.aspx?p=391848 
  • AND FINALLY: http://vtimashkov.wordpress.com/sharepoint-disadvantages/  - good technical list of SPS bugs & stupidity.
  • AND FINAL FINAL FINAL (comment from here): Heh :-)
    Let me just say this, as primarily a BI guy who has become responsible for essentially a sharepoint frontend of reporting services.  I have spent the better part of a week trying to migrate our current production environment to a different dev server with a fresh sharepoint install.  I have run into more errors then I can count, and tried multiple sharepoint tools to try to accomplish this.  I have posted multiple times to the Sharepoint MSDN message boards with not even a single response other than myself practically begging for some advice.  For probably the first time in my life in IT I am looking at a situation where I have no clue how to successfully do what seems like a pretty typical task, and I see no hope in sight.  Hence my frustration and typing in Sharepoint sucks into google just for fun, and I stumble upon this.
  • !!!! sharepoint-not-the-social-answer !!!!!!  http://www.jimgoings.com/2008/03/sharepoint-not-the-social-answer/
    When we migrated from SharePoint 2003 to 2007 ……..
    …… You know what we had in the end? A freakin’ glorified file server. ……
    …………
    One of the comments:

    I know one guy (and I know people in 20+ contries that work with IT), that can handle all the needed aspects of running and developing Sharepoint. The list of knowledge you must have to develop and maintain this application, without stepping on a “land mine” is huge! This means you will have to have more IT personnel to end up with something that in the end, will not resolve anything. Cost goes up, frustration goes up, and resolutions does not exist.

    Instead of Sharepoint, build custom applications for the processes you can not cover with “out of the shelf” software, and instead put up a couple wiki pages, and a good search engine along with a good document handling system. Yes, you will end up with more than one application, but at least you will not end up with cahos.

  • http://enterknowl.blogspot.com/2008/10/sharepoint-summit.html

--------------------------

And Opposing voice:

Ref tells the compiler that the object is initialized before entering the function, while out tells the compiler that the object will be intialized inside the function.

So while ref is two-ways, out is out-only.

http://stackoverflow.com/questions/388464/c-whats-the-difference-between-the-ref-and-out-keywords/388467#388467
http://stackoverflow.com/questions/388464/c-whats-the-difference-between-the-ref-and-out-keywords

Found on : http://www.eggheadcafe.com/software/aspnet/29145230/easiest-way-to-drop-all-t.aspx by ‘Damien’
It works :-)

I’m using it in our project with NHibernate, to recreate database schema.
There are some situation when NHibernate with Hbm2ddl.Auto = "create" won’t delete all old tables from db, and won’t create new schema.

 

declare boris cursor for
select
'alter table [' + USER_NAME(so.uid) + '].[' + OBJECT_NAME(sfk.fkeyid)
+ '] drop constraint [' + OBJECT_NAME(sfk.constid) + ']'
from
sysforeignkeys sfk
inner join
sysobjects so
on
sfk.fkeyid = so.id
where
OBJECTPROPERTY(so.ID,N'IsMSShipped') = 0 and
OBJECTPROPERTY(so.ID,N'IsTable') = 1

declare @sql varchar(8000)

open boris

fetch next from boris into @sql
while @@FETCH_STATUS = 0
begin
exec(@sql)

fetch next from boris into @sql
end

close boris
deallocate boris

declare boris cursor for
select
'drop table [' + USER_NAME(uid) + '].[' + OBJECT_NAME(ID) + ']'
from
sysobjects
where
OBJECTPROPERTY(ID,N'IsMSShipped') = 0 and
OBJECTPROPERTY(ID,N'IsTable') = 1

open boris

fetch next from boris into @sql
while @@FETCH_STATUS = 0
begin
exec(@sql)

fetch next from boris into @sql
end

close boris
deallocate boris

We are setting up architecture in new project and it’s not easy to decide which DAL / ORM technology use in it.
NHibernate or Entity Framework ?
I’m determined to use NHibernate, but 2 of team members are familiar with EF and don’t now NH at all.

I was looking for post about NH vs EF, there are many (most of them are 1 year old) but only a few are recent , those recent ones are here:


UPDATE
(05-01-2010):

First, we decided to use Entity Framework. After 2 weeks, we swiched back to NHibernate.
I’ll explain it in further posts, but main reason was buggy EF Designer in Visual Studio. It was hard & time consuming to build model.

Especially updating model from database was painful and buggy process.

Some few additional links:

My advice is: If you are creating enterprise application, don’t touch EF. Use NHibernate.
I’ve tested it.

I’ve created FAQ page for DNN Tagged Content solution.
Dear customer, feel free to ask questions if you have doubts or you don’t know how to achieve Tagged Content functionality you can see on my website.

Few months ago I’ve published first version of my ListUnique.
ListUnique is .Net C# generic list which keeps insertion order, you can iterate through it and it has only unique values, with IListUnique interface.

Below is next version, with unit tests.
What’s new :

  • new methods AddUniqueOnly & AddRangeUniqueOnly – those methods will add only unique values, won’t throw exception if value is already in list.
    Just add unique values and omit existing ones.

This post is also online test of SyntaxHighlighter.
I’ve integrated it with DotNetNuke Blog module.
Within few days I’ll release this module (called BlogPlus) – it contains fixes & modifications & new features for core Blog module, SyntaxHighlighter is one of new features.

using System;
using System.Collections.Generic;


namespace TM.Common.Collections
{
	/// <summary>
	/// List that allows only unique values
	/// </summary>
	/// <typeparam name="T">Must implement IComparable T </typeparam>
	public class ListUnique<T> : List<T>, IListUnique<T> where T : IComparable<T>
	{
		
		public new void Add(T item)
		{	
			if( Exists(itemList => itemList.CompareTo(item) == 0) )
			{
				throw new ArgumentException("Cannot add not unique value to collection");
			}
			
			base.Add(item);
		}
		
		/// <summary>
		/// Adds element only if is unique
		/// </summary>
		/// <param name="item"></param>
		/// <returns>Return added or not</returns>
		public bool AddUniqueOnly(T item)
		{
			if( Exists(itemList => itemList.CompareTo(item) == 0) )
				return false;
			
			base.Add(item);
			return true;
		}

		/// <summary>
		/// Adds elements of the specified collection to the end of the list
		/// </summary>
		/// <param name="coll"></param>
		public new void AddRange(IEnumerable<T> coll)
		{
			foreach (T item in coll)
			{
				Add(item);
			}
		}

		/// <summary>
		/// Adds only unique elements of the specified collection to the end of the list
		/// </summary>
		/// <param name="coll"></param>
		public void AddRangeUnique(IEnumerable<T> coll)
		{
			foreach (T item in coll)
			{
				try
				{
					Add(item);
				}
				catch (ArgumentException)
				{  }
			}
		}

		public List<T> ToList()
		{
			return this;
		}

		public ListUnique(IEnumerable<T> collection)
		{
			foreach (T t in collection)
			{
				Add(t);
			}
		}

		public ListUnique(int capacity): base(capacity)
		{
		}

		public ListUnique()
		{
		}
	}

	/// <summary>
	/// IList that allows only unique values
	/// </summary>
	/// <typeparam name="T">Must implement IComparable T </typeparam>
	public interface IListUnique<T> : IList<T> where T : IComparable<T>
	{
		List<T> ToList();

		bool AddUniqueOnly(T item);

		/// <summary>
		/// Adds elements of the specified collection to the end of the list, throws exception on unique violation
		/// </summary>
		/// <param name="coll"></param>
		void AddRange(IEnumerable<T> coll);

		/// <summary>
		/// Adds only unique elements of the specified collection to the end of the list
		/// </summary>
		/// <param name="coll"></param>
		void AddRangeUnique(IEnumerable<T> coll);
	}
}

And Unit tests:

using System;
using System.Collections.Generic;
using NUnit.Framework;

namespace TM.Common.Collections.Tests
{
	[TestFixture]
	public class ListUnique_Test
	{
		[Test]
		public void CreateNew()
		{
			IListUnique<string> listUnique = new ListUnique<string>();
		}
		
		[Test]
		public void AddUniqueValues()
		{
			IListUnique<string> listUnique = new ListUnique<string>();
			
			listUnique.Add("a");
			listUnique.Add("b");
			listUnique.Add("c");
			listUnique.Add("d");
			
			Assert.AreEqual(4,listUnique.Count);
			Assert.AreEqual("a",listUnique[0]);
			Assert.AreEqual("d", listUnique[3]);
		}
		
		[Test]
		public void AddUniqueOnly_Basic()
		{
			IListUnique<int> listUnique = new ListUnique<int>();
			
			listUnique.AddUniqueOnly(1);
			listUnique.AddUniqueOnly(2);
			listUnique.AddUniqueOnly(3);
			listUnique.AddUniqueOnly(4);

			bool addStatus;
			
			addStatus=listUnique.AddUniqueOnly(3);
			Assert.IsFalse(addStatus);
			
			Assert.AreEqual(4,listUnique.Count);
		}
		
		[Test]
		public void AddRangeUnique()
		{
			List<string> list = new List<string>();
			list.Add("a");
			list.Add("b");
			list.Add("c");
			list.Add("d");
			
			IListUnique<string> listUnique = new ListUnique<string>();

			listUnique.AddRange(list);

			Assert.AreEqual(4, listUnique.Count);
			Assert.AreEqual("a", listUnique[0]);
			Assert.AreEqual("d", listUnique[3]);
		}

		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void AddRangeNotUnique_ExceptionExpected()
		{
			List<string> list;
			
			list = new List<string>();
			list.Add("a");
			list.Add("b");
			list.Add("c");
			list.Add("d");

			IListUnique<string> listUnique = new ListUnique<string>();

			listUnique.AddRange(list);

			list = new List<string>();
			list.Add("e");
			list.Add("f");
			list.Add("a");	// <- not unique
			list.Add("h");

			listUnique.AddRange(list); // <- exception expected
		}

		[Test]
		public void AddRangeUnique_NotUnique()
		{
			List<string> list;

			list = new List<string>();
			list.Add("a");
			list.Add("b");
			list.Add("c");
			list.Add("d");

			IListUnique<string> listUnique = new ListUnique<string>();

			listUnique.AddRange(list);

			list = new List<string>();
			list.Add("e");
			list.Add("f");
			list.Add("a");	// <- not unique
			list.Add("h");

			listUnique.AddRangeUnique(list);
			
			Assert.AreEqual( 7 ,listUnique.Count);
			Assert.AreEqual("a", listUnique[0]);
			Assert.AreEqual("d", listUnique[3]);
			Assert.AreEqual("h", listUnique[6]);
		}
		
		[Test]
		public void CreateFromUniqueList()
		{
			List<string> list=new List<string>();
			list.Add("a");
			list.Add("b");
			list.Add("c");
			list.Add("d");

			IListUnique<string> listUnique = new ListUnique<string>(list);

			Assert.AreEqual(4, listUnique.Count);
			Assert.AreEqual("a", listUnique[0]);
			Assert.AreEqual("d", listUnique[3]);
		}
		
		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void AddNonUnique()
		{
			IListUnique<string> listUnique = new ListUnique<string>();

			listUnique.Add("a");
			listUnique.Add("b");
			listUnique.Add("b");
			listUnique.Add("d");

			Assert.AreEqual(3, listUnique.Count);
			Assert.AreEqual("a", listUnique[0]);
			Assert.AreEqual("d", listUnique[2]);
		}

		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void CreateFromNotUniqueList()
		{
			List<string> list = new List<string>();
			list.Add("a");
			list.Add("b");
			list.Add("b");
			list.Add("d");

			IListUnique<string> listUnique = new ListUnique<string>(list);

			Assert.AreEqual(3, listUnique.Count);
			Assert.AreEqual("a", listUnique[0]);
			Assert.AreEqual("d", listUnique[2]);
		}
	}
}

31 Days of Refactoring is a serie of refactoring tips and producing good quality code by Sean Chambers from Los Techies.
It’s also available as ebook.

Below is index of those refactoring tips (copy from original index):

  1. Refactoring Day 1 : Encapsulate Collection
  2. Refactoring Day 2 : Move Method
  3. Refactoring Day 3 : Pull Up Method
  4. Refactoring Day 4 : Push Down Method
  5. Refactoring Day 5 : Pull Up Field
  6. Refactoring Day 6 : Push Down Field
  7. Refactoring Day 7 : Rename (method, class, parameter)
  8. Refactoring Day 8 : Replace Inheritance with Delegation
  9. Refactoring Day 9 : Extract Interface
  10. Refactoring Day 10 : Extract Method
  11. Refactoring Day 11 : Switch to Strategy
  12. Refactoring Day 12 : Break Dependencies
  13. Refactoring Day 13 : Extract Method Object
  14. Refactoring Day 14 : Break Responsibilities
  15. Refactoring Day 15 : Remove Duplication
  16. Refactoring Day 16 : Encapsulate Conditional
  17. Refactoring Day 17 : Extract Superclass
  18. Refactoring Day 18 : Replace exception with conditional
  19. Refactoring Day 19 : Extract Factory Class
  20. Refactoring Day 20 : Extract Subclass
  21. Refactoring Day 21 : Collapse Hierarchy
  22. Refactoring Day 22 : Break Method
  23. Refactoring Day 23 : Introduce Parameter Object
  24. Refactoring Day 24 : Remove Arrowhead Antipattern
  25. Refactoring Day 25 : Introduce Design By Contract Checks
  26. Refactoring Day 26 : Remove Double Negative
  27. Refactoring Day 27 : Remove God Classes
  28. Refactoring Day 28 : Rename boolean methods
  29. Refactoring Day 29 : Remove Middle Man
  30. Refactoring Day 30 : Return ASAP
  31. Refactoring Day 31 : Replace Conditional with Polymorphism

 
Related content
 
Search_Blog
 
Blog Tags
 
Blog_Archive
 
Related