January 2009 Entries

  • IDAL and services

    ff

  • Are projects getting more successful

    Im curious at the increase rate of sucess in a number of surveys such as the later CHAOS surveys. Looking in the detail however it appears that projects after peaking in 2000 the amount of time overrun and the amount of features completed have dropped dramatically in the vast majority of projects. Not sure what it means but to me it DOESNT mean software development is getting better if features are getting dropped  and there are increasing time blow outs. Things that come to mind Standards for success and projects have increasing amounts of over estimation to prevent...

  • Why do larger projects fail more often?

    Since larger projects have more opportunity to learn ans share code why do they fail more ?   However the report does not show all good news. Time overruns have significantly increased to 82% from a low of 63% in the year 2000. In addition, this year's research shows only 52% of required features and functions make it to the released product. This compares with 67% in the year 2000.

  • LINQ for SQL unit testing Part2

    I'm not really sure whether the benefits are worth it unless you need very high quality code and for larger applications.   I'm not sure why i feel this and whether this is due to compartmentalizing the LINQ code or whether its just TDD on LINQ code which can be tested via a test DB i suspect its the TDD.  Still storing all the sql in the various repositories is a plus.               } ---------------------------------------------------------------------------------------------------------------------------internal class ProvinceRepositry : RepositryBase<Province>, IProvinceRepositry{public ProvinceRepositry()base(new ProvinceUnitOfWork())public ProvinceRepositry(IUnitOfWork<Province> work)base(work)#region IProvinceRepositry Memberspublic ProvinceCollection GetWorld(string worldname)throw new System.NotImplementedException();public ProvinceCollection GetWorld()throw new System.NotImplementedException();public Province Get(int id)throw new System.NotImplementedException();public void Update(Province prov)Guard.ArgumentNotNull(prov, "PROVINCE"); public...

  • LINQ for SQL unit testing Part1

    Ian Cooper had some nice articles on how to do unit testing , i have implemented his code and ideas ( shown below) . See Part 2 for some Business code { { impl = source; queryableImpl = impl.AsQueryable(); } { }   { impl.Add(item); queryableImpl = impl.AsQueryable(); }                 { }     #region   { } { impl.Remove(item); queryableImpl = impl.AsQueryable(); } { impl.RemoveAll(MatchWithContainer); queryableImpl = impl.AsQueryable(); } { }     #endregion #region System.Collections. { }   #endregion #region { } { } { }   #endregion   }     public interface IDataSource<T> : IQueryable<T>, IEnumerable<T>,ITable, IQueryProvider { }     {         } public   {             } interface IUnitOfWork<T> :IDisposableILINQDataSource<T> DataSource{ get; set; } //table// bool ReadOnly { get; set; }void SubmitChanges(); // only call for inserts OR when all work is done     {           {   unitOfWork = work; }                     {     #region     {     {   }     { dataSource = } }       #region       public abstract class UnitOfWorkBase<T> : IUnitOfWork<T>ILINQDataSource<T> dataSource; IUnitofWork<T> Memberspublic ILINQDataSource<T> DataSourcegetreturn dataSource;setvalue ;abstract public bool ReadOnly { get; set; }abstract...

  • LINQ for SQL thread affinity Data context

    From http://www.cnblogs.com/sunrack/articles/1130866.html , for services we use mainly Thread Context ( the original allows a static context as well ). Thread context is very usefull for services.                           {                     { TDataContext result = (TDataContext) SetOptions(result); }               { TDataContext result = (TDataContext) SetOptions(result); } { options.LoadWith<   context.LoadOptions = options; }                 { }                 { }                 { key = context = { context = GetDataContext();   context = GetDataContext(ConnectionString); { threadData = } } }                     {     }                 {     }                 {     }     } ///<summary>/// This class provides several static methods for loading DataContext objects /// in a variety of ways. You can load the data context as normal one new instance/// at a time, or you can choose to use one of the scoped factory methods that/// can scope the DataContext to a WebRequest or a Thread context (in...

  • OO with services

    Are OO code and SOA diametrically opposed ? In a lot of ways this is true services tend to produce very anemic object models however this merely reduces reuse which is a myth in OO for the majority anyway . However services have a unique but familiar problem . The contract of the service is critical it needs to be designed for  - The ease of use of the client  - For performance  ( ie chunky calls , many small calls can bring many services down to its needs) - To be upgradeable and allow backward compatibility. - Compatible with an...

  • How to write a good service contracts

    ... not hand craft wsdl   Custom messages reduce churn and change in the contract   Lets say you have this datacontract   [DataContract] public class WorkEntry { [DataMember] public DateTime StartTime; [DataMember] public TimeSpan Duration; [DataMember] public string User; [DataMember] public string CostCentre; [DataMember] string Comments; }   What can go wrong here ? Using public fields is good , its tight and if you need to do custom things you can refactor it easily.  I think there is nothing really wrong here however if this is a business object also i would be concerned.  The big gotcha maybe DateTime  , lets say you have some other systems in your company that use Java . Now Java systems...

  • LINQ for SQL and reattaching objects in nTier scenarios

    One of the issues that keeps cropping up is LINQ for SQLs support for nTier scenarios and having to reattach the object to the DataContext. However this problem is exhibited by all ORMs in nTier scenarios ( though not in web sites) and  you basically have 2 choices - refetch the object from cache/DB and replay all changes to see what has changed then you can craft a custom Update to just change the items changed. - update all fields in the DB. While the 2nd method is easier the first is more efficient especially when you consider that it...

  • Is LINQ for sql dead

      There were a lot of comments about the supposed demise of LINQ for SQL people expected it to evolve into a nHibernate style framework (and rightly object to EF  Entity Frameworks change tracking http://weblogs.asp.net/fbouma/archive/2008/11/21/baby-sitter-framework-2-0-change-tracking-in-the-ef-v2-it-s-still-your-problem.aspx ) . I think people miss the point here , LINQ for SQL is and always will be a light weight solution for smaller or RAD style projects. As Damian Guard ( from the LINQ for SQL team ) explains it will be maintained and changes required by the  community will be implemented. http://damieng.com/blog/2008/10/31/linq-to-sql-next-steps. As it is now it is fine for most current and future needs....

  • Are Datasets dead

    Can anyone see a use for Datasets these days ? LINQ for SQL seems to have all the bases covered with a much easier and extensible model.

  • Simple services and Linq for SQL - match made in heaven

    Im a pretty big fan of Linq for SQL and it works so well with services especially smaller ones ( especially when there are no updates) . The fact services are normally responsible for about 3 tables /conceptual domain classes mean you can quickly drag the 3 tables onto the designer and generate the code.   If the structure changes you just recreate the data. Lightweight data Light weight service Light weight testing Light weight procedural code. . These services are quick to write and easy to maintain,

  • Post by Frans Bouma

    Loved this post  so had  to emphasize and post it. "That's not the case. A framework user doesn't give a **** about how many different patterns the framework is using and how great and awesome it's internally and how it will ultimately evolve in the bringer of world peace. A framework user is interested in whether the framework takes care of things the framework user can't afford to spend time on. After all, the framework user can't afford to spend time paid by the customer on plumbing, on writing infrastructure code. The framework user is paid to write code directly...

  • Stored Procs and SOA services

    I was just thinking about stored procs in services , now im definetly on the side of dynamic ( paramaterized) code instead of stored procsas i rarely think the benefits are worth the costs of another deployment tier or involving an additional team. The suposed benefits are Security, performance and organisation i will address these below....

  • Custom Collections and whether to use inheritance or not

    I will talk about Windows Communication Foundation collections in the next post and wanted to get this out of the way ; I'm always lost when creating a simple collection whether to contain a collection as a member or whether to extens a base one via in extion eg public  class Customers<Customer> or  Customers :  Collection < Customer> { ..} vs public  class Customers  ; ICollection<Customer> {  private List<Customer>  customers ; //Add etc  } While the second is  obviously better as you can hide elements i dont think its good use of time to implement each such collection unless the collection requires significant extentions anyaway.  A...

  • Architecting for the team

    One of the major differences between the  oft and bad used example of building Architecture  and Software architecture is people.  When you build a building people know how to pour the concrete and a few specialized roles are imported electricians etc  but with software we are expected to know all. If you have been writing Windows Forms apps for years if the new project is a web app it is expected  that you know write a web application , the only exception seems to be with languages people seem to except a C# programmer cant write VB or Java  -...

  • Business of colaboration

    The economy add income.