Thursday, 21 December 2017

Memory Jogger for Me - Object Lifetime Management...

Lifestyle
Description
Disposal
A new instance of the component will be created each time the service is requested from the container. If multiple consumers depend on the service within the same graph, each consumer will get its own new instance of the given service.
Never
For every request within an implicitly or explicitly defined scope.
Instances will be disposed when their scope ends.
There will be at most one instance of the registered service type and the container will hold on to that instance until the container is disposed or goes out of scope. Clients will always receive that same instance from the container.
Instances will be disposed when the container is disposed.


Lifestyle
Description
Disposal
Within a certain (explicitly defined) scope, there will be only one instance of a given service type A created scope is specific to one particular thread, and can’t be moved across threads.
Instance will be disposed when their scope gets disposed.
There will be only one instance of a given service type within a certain (explicitly defined) scope. This scope will automatically flow with the logical flow of control of asynchronous methods.
Instance will be disposed when their scope gets disposed.
Only one instance will be created by the container per web request. Use this lifestyle in ASP.NET Web Forms and ASP.NET MVC applications.
Instances will be disposed when the web request ends.
Only one instance will be created by the container during the lifetime of the WCF service class.
Instances will be disposed when the WCF service class is released.


The problems with MSBuild...

So I started to use MSBuild for our current clients CI server, told them to use TeamCity, Go, ninja or Octopus but they would not listen.

So I found myself try to debug the scripts. Ops! Big mistake I had to add yet more code to understand where I was going wrong. Therein lies the problem the scripts  become over complex and hard to understand let along document for the next poor sap!

The next problem I found was that the build server and my local VS2017 had two different MSBuild versions – why am I surprised I shouldn’t be it’s the way of the world or maybe I’m an alien!

Versioning was my next stone wall – I found that generated files are almost impossible to version using MSBuild – not for the faint hearted and I could only find advance topics on the matter, as time was against me I left that for a much later date. Why, it’s should be the same as a source code file or assembly info file.

As MSBuild is now open source everyone can jump and mop up the long awaited defect fixes that Microsoft never got round to. I for one will be jumping in b with both feet first or nag my current client until they finally given in.


Why I hate TFS, most of the time actually…

So I’m not in the best frame of mind today having being hit by TFS automatic merge even when I have it turned off it still thinks it’s smarter than the average bear, not!

Yes I have used PVCS, VSS and SVN for my sins in my professional career all of which I hate with the same if not less passion as I do TFS.

I my humble opinion Microsoft promised so much more when you moved to TFS from VSS, but it evaporated along with the morning mist!

VSS every time you looked at a file it would check it out without warning you. Try looking at a resource file in TFS and bang! Config file checked out.

TFS branching is poor compared to the rich functionality of GIT. Yes, I know you can use GIT from the VS/TFS interface but the client dictates the technology stack at the end of the day.

MS Build – one again so yesterday in my opinion Go, TeamCity and many more are so much better – agreed the implementation is the key but that aside they are so much better and informative when things go awry.

At one site I worked at, they migrated from VSS to GIT the Holy Grail in my opinion. I could was on about the feature rich functions but I will not just try it for yourself and see…enjoy.


The current contract I’m working at I have been waxing lyrical about Bitbucket, JIRA and Confluence that every other comment relates back the three best products in the market place today. 

They in turn bounce at back at me whenever I mention or they mention code repositories, CI or CD or SharePoint – YUK! I can’t believe I said that word. Another pet hate.