Contents

197 Articles
14 Comments

Search

#2 − eric

ashutoshweb3
(Attached to Article Why use an IOC? (hint: testing))

#1 − casket

ashutoshweb3

Affordable Funeral Plans to match your needs. Learn about prepaid funeral plans, funeral plans cost, funeral plans for over 50s. Call +448081699459
order of service funeral,funeral order of service template,avalon funeral plans,cheap funeral plans,funeral plans,prepaid funeral plans,sun life funeral plan,funeral plans uk,compare funeral plans,age uk funeral plans,dignity funeral plans,dignity funerals,cheap funeral,co op funeral plans,co op funeral,cooperative funeral,top 10 funeral plans,safe hands funeral plans,monthly funeral plans,funeralcare,best funeral plans,prepaid funerals,cooperative funeral plans,golden leaves funeral plans,compare the market funeral plans,funeral plans cost,funeral plans for over 50s,funeral plans under 50,best prepaid funeral plans,cheapest prepaid funeral plans,pre paid funeral plans uk,funeral care plan,plan my funeral,british seniors funeral plan,how to plan a funeral,over 50 funeral plan,asda funeral plan,age concern funeral plan,post office funeral plan,cheapest funeral uk,funeral uk,co op funeral plan costs,co op funeral plan prices,coop prepaid funeral plans,which funeral plans,saga funeral plans,prepaid funeral plans compare,prepaid funeral plans age concern,go compare funeral plans,pay monthly funeral plans,perfect choice funeral plans,funeral plans scotland,funeral planning services,cheapest funeral plan uk,aviva funeral plan,plan your funeral,planning your own funeral,promis life funeral plan,50 plus funeral plans,age uk funeral plans reviews,are funeral plans a good idea,are prepaid funeral plans a good idea,best funeral plans uk,best value funeral plans,buy a funeral plan,choice funeral plans,co op funeralcare plans,co operative pre paid funeral plancompare funeral plans uk,cost of prepaid funeral plans,dignity funeral plans reviews,dignity pre paid funeral plans,funeral insurance plans uk,funeral plan companies,funeral plan prices,funeral plan providers,funeral plan quotes,funeral planning template,funeral planning trust,funeral plans expert,funeral plans for over 60s,funeral plans reviews,funeral pre planning,funeral protection plan,funeral savings plans,how do funeral plans work,how much is a funeral plan,how to plan a funeral for a loved one,how to plan a funeral uk,how to plan your own funeral,joint funeral plans,low cost funeral plans,lv funeral plan,online funeral planningover 60 funeral plan,planning a funeral uk,planning for burial,pre paid funeral plan providers,pre paid funeral plans age uk,pre paid funeral plans comparison,pre paid funeral plans reviews,pre paid funeral plans scotland,pre payment funeral plans,promis funeral plan,simple funeral plans,tesco funeral plan,the best funeral plan,the co op funeral plan,what is a funeral plan,which is the best funeral plan,funeral costs,help with funeral costs,funeral cost,how much does a funeral cost,average funeral cost,funeral costs uk,breakdown of funeral costs,average funeral cost uk,low cost funerals,how much is a funeral,prepaid funeral costs,how much does a funeral cost uk,how much does the average funeral cost,help with funeral costs uk,basic funeral cost,funeral prices,cheapest funeral costs,co op funeral costs,coop funeral costs,islamic funeral costs,help towards funeral costs,funeral costs cremation,funeral costs scotland,how much is a funeral cost,funeral packages,how much is a basic funeral,how much is the average funeral,average price of a funeral,what is the average cost of a funeral,average cost of a funeral cremation,how much is a funeral uk,funeral service,muslim funeral,memorial service,dignity funeral services,muslim funeral service,funeral service program,funeral service times,funeral services near me,catholic funeral service,funeral directors,local funeral directors,dignity funeral directors,funeral directors londonindependent funeral directors,funeral directors wakefield,funeral directors uk,cheap funeral directors,compare funeral directors,what do funeral directors do,funeral directors costs,best funeral directors,funeral insurance,funeral insurance for over 50s,funeral insurance uk,funeral insurance cover,funeral insurance plans,funeral insurance cost,co op funeral insurance,funeral expense insurance,promise life funeral insurance,funeral insurance policy,funeral insurance over 50,funeral insurance comparison,funeral insurance quote,funeral insurance plans uk,funeral life insurance,funeral cost insurance uk,best funeral insurance,coop funeral insurance,cheap funeral insurance,funeral insurance for under 50,seniors funeral insurance,post office funeral insurance,british seniors funeral insurance,funeral insurance for over 80,life insurance funeral plan,funeral directors insurance,humanist funeral,humanist funeral cost,humanist funeral service,non religious funeral,non religious funeral service,funeral car,hearse,funeral hearse,funeral procession,funeral hearse,funeral cars cost,funeral car hire cost,funeral hearse cost,funeral wreaths,funeral wreaths uk,funeral flower wreath,funeral wreath prices,how to make a funeral wreath,funeral wreath cost,wreath flower arrangements,dad wreath for funeral,floral wreath for funeral,funeral wreath ideas,funeral wreaths online,baby wreaths for funeral,butterfly funeral wreath,cheap funeral wreaths,cross wreaths for funerals,grandad wreaths funerals,round funeral wreath,sister funeral wreath,funeral homes,funeral homes near me,dignity funeral home,funeral home services,memorial funeral home,home funeral,home funeral services,catholic funeral homes,cheap funeral homes,cheap funeral homes near me,funeral cover,funeral cover plans,funeral cover uk,cheap funeral cover,cheap funeral cover for extended family,funeral arrangements,how to arrange a funeral,funeral arrangements checklist,funeral checklist,funeral planning checklist,funeral planning checklist,funeral arrangements checklist,funeral checklist,how to arrange a funeral checklist,how to plan your own funeral checklist,funeral preparation checklist,organising a funeral checklist,how to plan a funeral checklist,plan your own funeral checklist,pre planning funeral arrangements checklistpre planning funeral checklisthow to prepare for a funeral checklistmaking funeral arrangements checklist,funeral payment,funeral payment plans,funeral expenses payment,funeral expenses,help paying for a funeral,paying for a funeral,funeral allowance,paying for funeral in advance,paying for a funeral in installments,pre payment funeral plans,can you pay for funerals monthly,how to pay for a funeral,pay for my funeral,pay for your own funeral,paying for a funeral on benefits,cremation process,cremation services,cremation service,cremation,direct cremation,cremation jewelry,crematorium near me,direct cremation uk,cremation cost,co op direct cremation,cremation funeral,cheap cremation,how does cremation work,cremation ashes,how much is cremation,cremation uk,cremation memorial,simple cremation,how much does cremation cost,dignity cremation,cost of cremation uk,cheap cremation uk,catholic cremation,direct cremation near me,cremation prices,hindu cremation,prepaid direct cremation,average cost of burying cremated ashes,what is direct cremation,cheapest direct cremation,local crematorium,how long is a cremation service,direct cremation scotland,how much does a cremation cost uk,private cremation,cremation fees,how much does it cost to be cremated,cremations only,how much is a cremation uk,cremation planning,cremation plans,human cremation,average cost of cremation,direct cremation costs,direct cremation costs uk,how much does a cremation cost in england,low cost cremation,alternatives to cremation,christian cremation,cremation prices uk,direct disposal cremation,how much is a cremation funeral,how much is it to be cremated,jewish cremation,prepaid cremation,golden casket,casket,caskets for ashes,funeral caskets,wicker casket,casket sprays,what is a casket,cremation caskets,casket prices,american casket,wooden caskets,caskets uk,burial caskets,caskets for sale,baby caskets,casket coffin,difference between coffin and casket,casket or coffin,funeral caskets prices,wicker funeral caskets,casket cost,how much is a casket,a casket,batesville casket,metal casket,pink casket,black casket,oak casket,unusual coffins and caskets,caskets and urns,biodegradable caskets,casket coffin prices,white casket,cheap caskets,cardboard casket,wicker coffin,cardboard coffins,willow coffins,coffin prices,coffins for sale,how much does a coffin cost,white coffin,coffin cost,eco coffins,coffin prices uk,how much is a coffin,baby coffin,types of coffins and prices,coffins for sale uk,wicker coffin prices,wooden coffin,cheap coffins,cheap coffins for cremation,funeral coffin,funeral coffin flowers,coffin designs,types of coffins,how much is a coffin uk,buy a coffin,coffins direct,basket coffin,coffin box,cost of coffins uk,black coffin,eco friendly coffins,coffin maker,biodegradable coffin,coffins uk,compare the coffin,cheap coffins uk,casket coffin,cremation coffin,a coffin,coffin manufacturers,oak coffin,coffin company,creative coffins,lead coffin,funny coffins,cheapest coffin you can buy,pine coffin,coffin case,natural coffins,coffin supplier,american coffin,coffin for burials,how much is the cheapest coffin,custom coffins,coffin decor,buy coffin online,wicker coffin cremation,how much do wicker coffins cost,willow coffins prices,wooden coffins prices,cardboard coffin prices uk,unusual coffins and caskets,casket coffin prices,average coffin price,baby coffins prices,eco coffins prices,green coffins,metal coffin,unusual coffins,simple coffin,basic coffin,coffin shop,coffins online,what are coffins made of,coffin plans,old coffin,used coffins,budget coffins,eco coffins direct,printed coffins,define coffin,modern coffins,basket coffin cost,oak coffin prices,cheapest coffin prices,wicker basket coffin prices,cheap coffins for sale,wicker coffins for sale,cheap coffins for sale uk,wooden coffin box,funeral basket coffin,cheap coffins and caskets,casket covers coffins,coffin purchase,average cost of a coffin,buying a coffin direct,where can i buy a coffin,where to buy a coffin,cheap coffins online,low cost coffins,wholesale coffins,standard coffin,buy coffins online uk,coffin with glass lid,low price coffins,discount coffins,bury coffin,old style coffin,what is the cheapest coffin,lead lined coffin cost,pine box coffin cost,how much a coffin cost,coffin flowers white lilies,cheap wooden coffin,buy wooden coffin,coffin at funeral,burial ground,burial,woodland burial,natural burial ground,natural burial,burial service,jewish burial,green burial,woodland burial sites,burial place,woodland burial ground,funeral burial,burial costs,burial plot cost,burial plots,natural burial sites,green burial sites,burial vault,eco burial,cost of burial plot uk,average cost of burying cremated ashes,burial insurance,catholic burial,cost of burial uk,how much does a burial cost,how much does a burial plot cost,how much does a woodland burial cost,natural burial cost,planning for burial,catholic burial,burial band,burial burial,burial ceremony,burial uk,green burial ground,how much is a burial,jewish burial customs,burial insurance companies,best burial insurance companies,final expense insurance companies,pre burial insurance,burial insurance cost,burial insurance for parents,burial insurance for seniors,burial insurance plans,burial insurance quotes,burial insurance rates,burial insurance uk,how much is burial insurance,burial insurance with no waiting period,low cost burial insurance,burial life insurance,prepaid burial insurance,burial life insurance for seniors,burial life insurance policies,funeral invitation,jewish funeral,funeral parlor,hindu funeral,catholic funeral,funeral rites,funeral benefit,simple funerals,funeral booklet,funeral ceremony,woodland funeral,budget funerals,organising a funeral,green funeral,direct funeral,funeral sermons,chinese funeral,buddhist funeral,funeral program,christian funeral,rose funeral,funeral ideas,funeral words,funeral choice,funeral help,direct disposal funeral,masonic funeral,new orleans funeral,eco funeral,how to organise a funeral,japanese funeral,natural funeral
 

(Attached to Article Why use an IOC? (hint: testing))

#3 − Got it

Marc

You’re right. Didn’t thougt about just removing a aspect and adding your own implementation. Way easier then using a IoC container.

I don’t like passing around the container anyway as it hides code-dependencies. I once was told folks even call it an anti-pattern. Eg this guy: http://blog.ploeh.dk/2010/02/03/ServiceLocatorisanAnti-Pattern/

#2 − IOC Overkill?

marco

I suppose you could do that as well, although we currently don’t have the IOC involved in creating metadata. Almost everything is a helper method to make it easier and quicker to create metadata—if you don’t like the way the helper method works, then just write your own helper method. We’ve been slowly but surely getting rid of larger extension/helper methods, so passing in an IOC so that it can create the aspect seems kind of like overkill.

You can either just write your own extension method, like so:

public static ClassCacheAspect SetSuperCacheAspectValues(
  this IMetaClass metaClass,
  Action<ClassCacheAspect> setValues)
{
  return metaClass.UpdateAspect<IClassCacheAspect, ClassCacheAspect>(
    new SuperClassCacheAspect(),
    setValues
  );
}

We can call this as follows:

Elements.Classes.Person.SetSuperCacheAspectValues(a => a.Capacity = 1000);

If I go the IOC route, then I would make the base helper method accept another parameter (I guess?). This is kind of neat, and would let me push the machinery for creating a new aspect down to the next-level methods.

The method that works with aspects that implement ICopyTarget looks like this:

public static TConcrete SetAspectValues<TService, TConcrete>(
  this IMetaClass metaClass,
  IServiceRequestHandler handler,
  Action<TConcrete> setValues
)
  where TConcrete : TService, ICopyTarget<TService>
  where TService : IMetaAspect
{
  return metaClass.UpdateAspect<TService, TConcrete>(
    handler,
    (aspect, existingAspect) => aspect.CopyFrom(existingAspect),
    setValues
  );
}

The fully generalized one that has no expectations of the aspect actually creates the aspect using the IOC.

public static TConcrete SetAspectValues<TService, TConcrete>(
  this IMetaClass metaClass,
  IServiceRequestHandler handler,
  Action<TConcrete, TService> copyValues,
  Action<TConcrete> setValues
)
  where TConcrete : TService
  where TService : IMetaAspect
{
  var aspect = handler.GetInstance<TConcrete>();
  var existingAspect = metaClass.Aspects.FirstOfTypeOrDefault<TService>();
  if (existingAspect != null)
  {
    copyValues(aspect, existingAspect);
  }

  setValues(aspect);

  return aspect;
}

And, finally, the caching-specific method looks like this:

public static ClassCacheAspect SetCacheAspectValues(
  this IMetaClass metaClass,
  IServiceRequestHandler handler,
  Action<ClassCacheAspect> setValues)
{
  return metaClass.UpdateAspect<IClassCacheAspect, ClassCacheAspect>(
    handler,
    setValues
  );
}

Now I don’t have to ever call new for an aspect, but I have to pass in the handler, every single time.

Elements.Classes.Person.SetSuperCacheAspectValues(handler, a => a.Capacity = 1000);

I would have to make sure that the handler (IOC) was available during metadata construction (which it generally isn’t, but could be, via constructor injection on the metadata builder class, e.g.)

I think this is a matter of preference, but given how small the chance is that I would want a different cache aspect to be created—and how easy it is to make my own helper method—then I would opt not to use the IOC, just so I don’t force all callers to (A) have a reference to an IOC around and (B) have an extra parameter that isn’t needed in 99.9% of the cases.

Although, since these are helper methods, there’s nothing stopping anyone from creating the methods I outlined above and using that pattern instead. Perfectly valid to use the IOC there, but a bit uglier to get it down to where it can be used.

#1 − Nice article but …

Marc (updated by Marc)

… what about replacing the aspect implementation with another one? DI came in my mind when reading this article. What about using a IoC container for construction? Maybe with constructor injection?

Cheers, Marc

#1 − Nice post!

Marc
(Attached to Article ABD: Refactoring and refining an API)

#1 − Sounds familiar

Marc

ASP.Net 5 (aka vNext) does some parts very similar. See here …
Cheers, Marc

#1 − 7.17 Sample 2

Marc

In this sample the Where() could be replaced with a TypeOf<>() I guess. But yes, I got the point ;-)

#1 − Another clever and succinct solution

marco

This one’s from Chris Meadowcroft:

const string EnglishListPrefix = "{";
const string EnglishListSuffix = "}";
const string IntermediateSeparator = ", ";
const string LastSeparator = " and ";
static string BuildStringWithEnglishListSyntax(IEnumerable<string> itemsEnumerable)
{
  StringBuilder result = new StringBuilder(EnglishListPrefix);
  using(IEnumerator<string> items = itemsEnumerable.GetEnumerator())
  {
    if(items.MoveNext())  // make sure it's not an empty list
    {
      bool isFirstString = true;
      bool isLastString = false;
      while(!isLastString)
      {
        string current = items.Current;
        isLastString = !items.MoveNext();
        if(!isFirstString)
        {
          result.Append(isLastString ? LastSeparator : IntermediateSeparator);
        }
        else
        {
          isFirstString = false;
        }
        result.Append(current);
       }
     }
   }
   result.Append(EnglishListSuffix);
   return result.ToString();
}
(Attached to Article Elegant Code vs.(?) Clean Code)

#1 − wow

Marc

surprised that he really recommend to use com-automation at all. its shaky even für interactive winform-apps. but using com-automation in asp.net app?!?!? … don’t know how they get fogbugz stable at all using these techniques…

(Attached to Article Office Formats)

#2 − Try the up arrow …

marco

#2

marco

Wildcards are a way to provide partial support for propert generics, in which—if B inherits from A—List<B> also inherits from List<A>. In both Java and C#, this is not the case, which makes passing generic parameters all the more difficult.

The where keyword in C# corresponds to the extends keyword in Java. It indicates that the actual generic parameter must conform to the given base type (which can be a class or an interface). In your example, the implementation of the generic class may call any features defined in MYBASETYPE on MYTYPE.

(Attached to Article Wildcard Generics)

#1 − just to get sure

Marc

hi marco,

just to get things the right way (as i don’t know java very well):

is this wildcard-thing the same as the “WHERE” in C# 2?

For example:

public class A<MYTYPE>
where MYTYPE : MYBASETYPE, new
{

}

have to try your examples above in the c# and see if i get this working as well as it looks like a nice exercise for rainy weekends like this ;-)

cheers, marc

(Attached to Article Wildcard Generics)

#1 − Cool one !

anon@c-213-160-55-86.customer.ggaweb.ch

Didn’t know that.
So, we definitivly should cancel IE ;-)
btw: i am missing a “thumbs up” image for the comments :)

cheers, marc