DirectorySoftwareBlog Details for "Adventures in .net and other Microsoft worlds"

Adventures in .net and other Microsoft worlds

Adventures in .net and other Microsoft worlds
On this blog we will talk about our experiences, problems and ideas in Microsoft technologies such as .net, WCF, asp.net, web services, architecture, SOA ....

Articles

Generics and covariance/contravariance
2007-10-09 18:16:00
Today I was writing code that looks like this: public interface IChild<TParent> {} public class GenericSet<TChild>     where TChild : IChild<GenericSet<TChild>> {} public class SpecificSet : GenericSet<ChildClass> {}    public class ChildClass : IChild<SpecificSet> {} If you try to compile this you'll get the following compiler error: The type 'ChildClass' must be convertible to 'IChild<GenericSet<ChildClass>&g t;' in order to use it as parameter 'TChild' in the generic type or method 'GenericSet<TChild>' Because ChildClass inherits from IChild<SpecificSet> and SpecificSet inherits from GenericSet<ChildClass> I assumed that this should work. Purely from an OO view ChildClass is a IChild<GenericSet<ChildClass>> ; through inheritance. Unfortunately C# and other .net languages do not support covariance and/or contravariance (definition), Eiffel.net seems to be an exception. The CLR itself on the othe...
More About: Generics , Neri
Visual Studio 2008 - Code Metrics and .net source code
2007-10-05 13:34:00
The new Visual Studio will have a new tool called Code Metrics , "Code Metrics is a new tool window that helps users find and act upon complex and unmaintainable areas within an application". More information can be found on the blog of the team. Scott Guthrie has some very good news, we'll be able to download the source code of the .net framework! Just think about all the geeky nights we'll have exploring this code :-)
More About: Source
DataView vs DataTable.Select
2007-10-03 15:07:00
This week I was working on some performance issues in an application and encountered a big difference between filtering data from a DataTable using a DataView or the DataTable.Select method. The application I'm talking about could be retrieving 40000 rows and then has to create the 40000 objects that have parent/child relationships between them. So I would start by finding the root elements and then iteratively build up the whole structure and in each iteration I would filter the child objects from the DataTable. The original code used a DataView to do the filtering, this worked well during initial testing with a few dozen elements but when we loaded the real data in the DB performance became an issue. When I changed the filtering to use the DataTable.Select method the application ran between 5 and 8 times faster. A possible explanation for the difference can be found on the blog of Chris Falter. Other performance solutions/advice: database - enough and correct indexes (also on v...
More About: Tata
Sparx Enterprise Architect tutorials
2007-08-27 09:00:00
Last night I found some nice tutorials/demos on how to use Enterprise Architect on the website of Spar x Systems. They also have some UML tutorials and how to create your own design patterns in EA. They have already created the classic patterns from GOF, you can download them on http://sparxsystems.com/resources/develop ers/uml_patterns.html. I didn't try this out yet so let me know how good (or bad) it is.
More About: Tutorials
Tracing WCF messages
2007-08-26 15:30:00
When you need to see the actual WCF message that gets over the wire you could use tools such as TcpTrac e but this won't work immediatly. The security of WCF doesn't allow communication when the "To" header of the message isn't the same as the endpoint address, to make it work you can do the following: 1. Change the configuration of your service to include a "listenUri" attribute: <endpoint    address="http://localhost:888/SomeSe rvice"    listenUri="http://localhost:777/Some Service"    binding="basicHttpBinding"    contract="ISomeService"/> This will cause the actual listener to run on port 777, in the WSDL you'll still see port 888. 2. TcpTrace configuration: listen port: 888 destination port: 777 3. On the client side make sure the endpoint is configured to send the messages to port 888 when TcpTrace is running.
More About: Messages , Mess , Ages
MaxItemsInObjectGraph and keeping references when serializing in WCF
2007-08-22 15:59:00
Yesterday when I was implementing a new WCF service I encountered a problem that the response of the service contained too much items ("System.Runtime.Serial ization.Seria lizationException : Maxi mum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota."). Items will probably also include types such as string, I only had about 2000 real object that needed to be returned. After some searching I found a solution on http://blogs.inetium.com/blogs/dmork/arch ive/2007/02/27/896.aspx. In short what you need to do is to tell the DataContractSerializer that it should allow more items in the object graph but you can only set this value in the constructor of the DataContractSerializer. A first possibility is that you create service and/or endpoint behaviors in the configuration of your WCF service: <behaviors>   <serviceBehaviors>     <behavior name="LargeServic...
More About: References , Ferenc
HITS is born
2007-08-21 16:47:00
Our new company Hill IT Solutions (HITS) is up and running for about one week now, all the paperwork is done and we're working on the first project, so life is good. HITS is specialized in delivering Microsoft solutions in the fields of analysis and development of distributed, smart client and web applications. On this blog we'll try to keep you informed of our adventures (and problems) in the different Microsoft technologies, specially for .net, WCF, web services and related distributed applications stuff. If you wish to contact us (for any reason) you can do so at <contact@hill-it.be>.
More About: Hits
40879 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2008 - SEO by FeWorks
eXTReMe Tracker