PHP vs ASP.NET

The ageless debate has finally caught up with me... which is better? ASP.NET or PHP? I am no expert at PHP buit I have used it a couple of times and familiar with its syntax and features. and honestly in my humble opinion, I think that neither should be pit against the other. They work better in different scenarios. For e.g. for a simple personal website, ASP.NET might be a bit of an overkill, that's not to say it cannot be used. PHP was built from the ground up to be a fast and dirty coding language. ASp.NET on the other hand is more streamlined. For an enterprise environment, I would suggest working with ASP.NET simply because of the robustness offered by IIS/MS SQL/ASP.NET combination over LAMP. Again, this is not to say LAMP cannot be used in these scenarios, but Microsoft provides a lot more support while open source software relies so heavily on the community to provide the support backbone. PHP is unique in the sense that though it does support object oriented programming, it does not force the user into OOP. ASP.NET using C# or VB.NET will force the user from the start to have object oriented design and implementation.  While this might seem like a very good idea, it is usually a hinderance in the simpler projects.  PHP requires no prior declaration of variables unlike C# or VB.NET. These simple ideas make programming in PHP a breeze though not always the most efficient way to code. ASP.NET on the other hand keeps the code clean by adhering to OOP. I personally choose to work with ASP.NET because I honestly am biased towards the .NET framework having been more familiar to it. Microsoft offers a range of products and services which integrate with the .NET framework or are built on top of the .NET framework. This makes it easy for adding functionality by using one of the products ... for e.g using Microsoft Dynamics I can integrate Point of Sale functionality directly into the Web application I am working on. With PHP, this would usually mean searching for a 3rd party product which may or may not be free along with the fact that support for it might be non existent.

So does this mean PHP will soon fade away? The answer is no!! I think PHP is a solid and reliable solution for small scale projects which are constrained by budget. ASP.NET might be a tad bit more complex for some projects but it will always get the job done in the end.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

OpenSource Sharepoint?

I was wondering the other day if it was possible to run Sharepoint on a Linux server. Many clients run Linux based servers just to reduce their initial costs. It would prove beneficial if there was a way to run sharepoint services on linux. I have always been intrigued with the Mono project which tries to implement the .NET framework for Linux. Originally an open source community initiative it was later taken over by Novell who still continue to support its development. Currently Mono supports most command line application API's and supports most of the C# syntax. Winforms however are dependant upon Windows 32 API and it has not been possible to replicate this on Mono. However , GTK# serves a limited replacement for now. I wondered if it was indeed possible to run Sharepoint Services on top of the Mono framework. Considering that ASP.NET is partially supported over Mono, I was half expecting to see sharepoint on Mono. However it turned out to be a dead end. Quite simply because of the same reason as to why Winforms dont work on Mono. Too many calls to Win 32 API.. I have never disliked PInovke more!!

 I further continued my research and realized that there are opensource alternatives to Sharepoint on Linux.

Openfire: Ignite Realtime: Downloads
Ospaces: O3Spaces - The way to extend OpenOffice.org (from sun)
Alfresco: Open Source Enterprise Content Management from Alfresco .

They certainly do not offer the features that MOSS does, but for lowend jobs, they should do the trick.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

A future amongst the clouds?

It is interesting to see how techology seems to evolve exponentially. The Wright brothers first flight in 1903 only lasted a mere 7 seconds and yet in just about 50 years we made our first manned flight into spac. When ENIAC came into existence in 1943 it was the size of two football fields and had the computational capacity which can easily be rivaled by the simplest of calculators today and yet in a little over 60 years, computers have become extremely powerful and extremely small in size. Software development has come a long way from simple structred programs on the 60s to complex n-tier service oriented enterprise level applications. I was musing the other day as to where our future lay... not just as end users but as developers. What is the major technological advancement that is currently making its way out of laboratories around the world? Ironically, I was sitting in my lawn looking at the clear sky (which in itself is an exception) and looking at the clouds drifting by... clouds.

Cloud computing is no longer some experimental concept which is being prototyped in a remote lab under a rock. Cloud computing is today's reality and it is here to stay. But interestingly enough, cloud computing is not a recent discovery as it might seem. The idea of cloud computing was first theorized by John Mcarthy in 1960, when he suggested that one day computing resources might be supplied to households by centralized distributors like other utilies like gas and electric. In more recent years, Amazon has been backing the cloud computing idea since the early 2000.

According to a 2008 paper published by IEEE Internet Computing "Cloud Computing is a paradigm in which information is permanently stored in servers on the Internet and cached temporarily on clients that include desktops, entertainment centers, table computers, notebooks, wall computers, handhelds, sensors, monitors, etc.

Cloud computing is a general concept that incorporates software as a service (SaaS), Web 2.0 and other recent, well-known technology trends, in which the common theme is reliance on the Internet for satisfying the computing needs of the users. For example, Google Apps provides common business applications online that are accessed from a web browser, while the software and data are stored on the servers. Google's Online office applications such as Google Docs and Google Spreadsheet are prime examples of this idea. Considering the ongoing was between Microsoft and Google one would assume Microsoft would not be left far behind in the battle for cloud computing. I did a little searching around and I found something rather interesting: Microsoft intends to make the next version of Office (Office 14) a web based application as well instead of the usual desktop application that its predecessors have been. No doubt google's online apps have helped to shape Microsoft's change in strategy.

I initially assumed that this would undoubtedly be some kind of extension to the existing MOSS. But considering the nature of the apps themselves, to be deployed over the internet will possibly millions of users, this would probably not be the best way to do it. Sharepoint has always been more about web content management than document management. I looked around further and found my answer - Azure

Microsoft's Azure is a cloud computing platform built on top of the .NET 3.5 Framework. The Azure Services Platform uses a specialized version of Windows Server, Windows Azure to run its "fabric layer" — a cluster hosted at Microsoft's datacenters that manages computing and storage resources of the computers and provisions the resources (or a subset of them) to applications running on top of Windows Azure. The platform also includes five services — Live Services, SQL Services, .NET Services, SharePoint Services and Dynamics CRM — which the developers can use to build the applications that will run in the cloud. A client library, in managed code, and associated tools are also provided for developing cloud applications in Visual Studio. Scaling and reliability are controlled by the Azure Fabric Controller so the services and environment don't crash if one of the servers crash within the Microsoft datacenter and provides the management of the user's web application like memory resources and load balancing.

The Azure Services Platform can currently run .NET Framework applications written in C#, while supporting the ASP.NET application framework and associated deployment methods to deploy the applications onto the cloud platform. Two SDKs have been made available for interoperability with the Azure Services Platform: The Java SDK for .NET Services and the Ruby SDK for .NET Services. These enable Java and Ruby developers to integrate with .NET Services.

The good news is that Sharepoint in its current form can be used to consume Azure's Services. This can be done by using out of the box SharePoint functionality like the Data View Web Part or in code using ASMX Web Services or WCF Web Services in a custom web part.

It is quite interesting to see how the future will turn out. Software as a Service is already making breakthroughs and major backers like Amazon, google, Microsoft, IBM , Sun etc are all getting ready to launch their Cloud computing based products in the near future. As sharepoint developers, We should get ourselves acquainted with Azure so that in the furture, we can learn to adapt to this ideology with ease.

 

More Information - http://www.microsoft.com/azure/default.mspx

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Active Directory Usefull Methods

Here are a few methods that will enable you to do some tasks in Active Directory.

Add Member
DirectoryEntry.Properties["member"].Add(fullUserPath);
DirectoryEntry.CommitChanges();
Directory.Close();

Remove Member
DirectoryEntry.Properties["member"].Remove(fullUserPath);
DirectoryEntry.CommitChanges();
Directory.Close();


Move Directory Object

currentLocation.MoveTo(oldLocationDirectory, newLocationDirectory);

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Add Value To SharePoint Farm Property Bag

When creating SharePoint applications I found using the propertybag very usefull. 
As it makes accessing important data accross the SharePoint
farm very easy.
I do though always sugest enryption dependant on the importants
of
the information stored
. 

SPFarm farm = SPFarm.Local;

farm.Properties.Add(object Key, Object Value);

 Wink

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Active Dirctory Permissions

Working on AD I found that permissions play a huge part in allowing access to directory objects.
I think that creating a new abject without using any kind of elevation of privileges is a very bad
idea as you will get an exception that is not very useful. So to counter this heart ache we use elevation.

Elevation Code 

DirectoryServicesPermission dPermission = new DirectoryServicesPermission
(System.Security.Permissions.PermissionState.Unrestricted);

dPermission.Assert();

Hope this helps with AD!

Laughing

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SharePoint Web Part Architecture

When working on coding standards I came up with a possible design for
a WebPart based largely on a few design patterns that I looked at. I wanted to
present this to everyone for possible feed back.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

LINQ to Active Directory

I have found an amazing LINQ to AD open source assembly. Makes life for programming AD very easy here is a sample.

// NOTE: Entity type definition "User" omitted in sample - see samples in release.

var users = new DirectorySource<User>(ROOT, SearchScope.Subtree);

users.Log = Console.Out;

var res = from usr in users

where usr.FirstName.StartsWith("B") && usr.Office == "2525"

select new { Name = usr.FirstName + " " + usr.LastName, usr.Office, usr.LogonCount };

foreach (var u in res)
{

Console.WriteLine(u);u.Office = "5252";

u.SetPassword(pwd);

}

users.Update();

        
Look at how simple that is, if anyone is confused the var is an object created by the LINQ class so you just use it as any normal type. The good thing about this class is that changing any kind of property is very easy and straight forward.  Cool

If you don’t understand LINQ very well here is a URL for some help.

http://msdn.microsoft.com/en-us/netframework/aa904594.aspx

 

Download the LINQ to AD source

http://www.codeplex.com/LINQtoAD/Release/ProjectReleases.aspx?ReleaseId=8629

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Getting the current login name from SharePoint

Hi guys,

Recently I was creating a Web Part and I needed to get hold of the current login name for comparison. It was simple and didn’t require great amounts of code. Thanks you
SharePoint for making life easier.   Laughing 

string userName = SPContext.Current.Web.CurrentUser.LoginName;

Returns
domain\LoginName

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

 

Dilbert of the day