Agile Development, Architecture, .NET and The Art of Listening  RSS 2.0

Navigation
 Sunday, October 12, 2008
//SINGLETON - C#

using NUnit.Framework;

[TestFixture()]
public class SingletonTest
{
    [Test()]
    public void ObjectsAreTheSameTest()
    {
        DeploymentInfo firstDeployment = Singleton<DeploymentInfo>.UniqueInstance;
        DeploymentInfo secondDeployment = Singleton<DeploymentInfo>.UniqueInstance;
        Assert.AreSame(firstDeployment, secondDeployment);
    }
}

//Singleton Pattern 
//Generic Version

public class Singleton<T> where T : class, new()
{
    private Singleton()
    {
    }

    private class SingletonCreator
    {
        static SingletonCreator()
        {
        }
        // Private object instantiated with private constructor
        static internal readonly T instance = new T();
    }

    public static T UniqueInstance {
        get { return SingletonCreator.instance; }
    }
}


'SINGLETON - VB.NET

Imports NUnit.Framework

<TestFixture()> _
Public Class SingletonTest
    <Test()> _
    Public Sub ObjectsAreTheSameTest()
        Dim firstDeployment As DeploymentInfo = Singleton(Of DeploymentInfo).UniqueInstance
        Dim secondDeployment As DeploymentInfo = Singleton(Of DeploymentInfo).UniqueInstance
        Assert.AreSame(firstDeployment, secondDeployment)
    End Sub
End Class

'Singleton Pattern 
'Generic Version

Public Class Singleton(Of T As {Class, New})
    Private Sub New()
    End Sub

    Private Class SingletonCreator
        Shared Sub New()
        End Sub
        ' Private object instantiated with private constructor
        Friend Shared ReadOnly instance As New T()
    End Class

    Public Shared ReadOnly Property UniqueInstance() As T
        Get
            Return SingletonCreator.instance
        End Get
    End Property
End Class

Sunday, October 12, 2008 5:40:08 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Patterns & Practices | Useful stuff
 Sunday, September 21, 2008
NHibernateDataSource: A DataSourceControl for ASP.NET 2.0

http://www.codeproject.com/KB/aspnet/NHibernateDataSource.aspx

Sunday, September 21, 2008 4:54:38 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | NHibernate
Rick Strahl posted his session slides and samples from his ASP.NET Connections. Really good presentations.
http://west-wind.com/weblog/posts/336745.aspx

Sunday, September 21, 2008 4:45:30 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Agile | AJAX | ASP.NET | JavaScript | LINQ | Useful stuff | WCF | Web Services
LINQPad lets you interactively query SQL databases in a modern query language: LINQ.  Kiss goodbye to SQL Management Studio!
http://www.linqpad.net/

Visual LINQ Query Builder
http://code.msdn.microsoft.com/vlinq/

Sunday, September 21, 2008 4:29:38 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | LINQ
Sunday, September 21, 2008 4:27:32 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Helped with work
 Saturday, April 26, 2008
Beth Massi posted nice presentation on Ling to XML on Infoq.com.
http://www.infoq.com/presentations/massi-linq-xml

She also rights regularily on her blog "Sharring the goodness tha is VB" - http://blogs.msdn.com/bethmassi/

VB.NET 9.0 has nice syntactic sugar tha C# 3.0 don't have for working with XML and Linq.
Saturday, April 26, 2008 12:27:46 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Helped with work | LINQ | People | Useful stuff | XML
 Monday, April 21, 2008
This sounds like a simple question. I will say like many other developers/architects/consultants - "It depends..."

Bottom line AJAX is bad for SEO!
For publicly facing company websites, were SEO important, stick with the server side scripting such as ASP.NET, PHP, Ruby on Rails and others.
I am not mentioning static HTML pages here since medium and big size companies most likely will have data driven web site.

If you are building Line of Service business application AJAX will only make your application better.
Do not think twice learn it well and use it.

If you absolutely have to use AJAX follow "Unobtrusive JavaScript" pattern.
AJAX is great tool when used for proper application types.

Here is my prediction -> 3 years from now Search engines will learn to understand and properly index and rank RIA/AJAX/FLASH/Silverlight/Flex/Put your faviorite client side technology here. Until then ...

AJAX and SEO: How to have an SEO Friendly AJAX website using jquery
http://www.davidpirek.com/blog.aspx?n=AJAX-and-SEO:-How-to-have-an-SEO-Friendly-AJAX-website-using-jquery

http://www.seomoz.org/crawl-test

12 More SEO Tips for 2007 http://www.seochat.com/c/a/Search-Engine-Optimization-Help/12-More-SEO-Tips-for-2007/

SEO Myths  http://www.seochat.com/c/a/Search-Engine-Optimization-Help/SEO-Myths/3/
SEO for AJAX http://www.johnon.com/270/seo-for-ajax.html
AJAX, Web 2.0 and SEO http://www.hybrid6.com/webgeek/2007/01/ajax-web-20-and-seo.php
Web 2.0 Technologies and Search Visibility http://searchenginewatch.com/showPage.html?page=3624222
Unobtrusive JavaScript http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
CSS, AJAX, Web 2.0 & Search Engines http://www.seroundtable.com/archives/006889.html
Search engine optimization http://en.wikipedia.org/wiki/Search_engine_optimization
Monday, April 21, 2008 9:55:59 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Agile | AJAX | Architecture | Performance Tuning | SEO | Useful stuff
Link to Everything: A List of LINQ Providers
http://blogs.msdn.com/charlie/archive/2008/02/28/link-to-everything-a-list-of-linq-providers.aspx

LINQPad lets you interactively query SQL databases in a modern query language: LINQ.  Kiss goodbye to SQL Management Studio!
http://www.linqpad.net/

Visual LINQ Query Builder http://code.msdn.microsoft.com/vlinq/
Monday, April 21, 2008 9:40:12 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Cool | Helped with work | LINQ | Useful stuff
Monday, April 21, 2008 9:36:01 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Helped with work | Useful stuff
Monday, April 21, 2008 9:27:46 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Agile | Cool | Helped with work | Useful stuff
The SQL Site Map Provider You've Been Waiting For
http://msdn2.microsoft.com/en-us/magazine/cc163657.aspx

 Using Multiple Sitemap Files
 http://geekswithblogs.net/dlussier/archive/2007/10/04/115848.aspx
 How to: Configure Multiple Site Maps and Site-Map Providers
 http://msdn2.microsoft.com/en-us/library/ms178426.aspx

Sitemap Celebration
http://www.zabdesign.de/pro/public/sitemap/sitemap-styled.html

Monday, April 21, 2008 9:22:56 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ASP.NET | Helped with work
Monday, April 21, 2008 9:00:14 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Agile | IoC/DI | Useful stuff
 Saturday, March 22, 2008
Dingo is a pluggable Schema Compiler for .NET and will generate C# code. The goal is to provide a simple way to generate Domain Objects. .NET XSD currently only generates Data Objects. Dingo can delegate code generation with high granularity.
http://sourceforge.net/projects/dingo/
Saturday, March 22, 2008 11:54:37 AM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Tools | Useful stuff | Web Services | XML
 Sunday, March 02, 2008
 Monday, February 18, 2008
Monday, February 18, 2008 9:48:14 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ASP.NET | Helped with work | Useful stuff

Every company needs them. Every company wants them. Every company want to spend money on custom Content Management System that they can call their own. -->


Next time you try to reinvent CMS stop and first take a look at existing CMS systems that very liberally licensed. If you cannot use them at least take a look at their architecture. It will give you a good starting point.
I was just concentrating on the CMS that based on ASP.NET and had a good web presence and documentation.
----->
After some review of architectures Cuyahoga is leading this list for me. N2 is very close behind the Cuyahoga as of March 02, 2008.
When new frameworks come in to play I will review them and reassess.
Monday, February 18, 2008 8:58:45 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ASP.NET | Cool | Open Source | Useful stuff
 Wednesday, January 23, 2008
Wednesday, January 23, 2008 9:18:45 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | SOA | Useful stuff | Web Services | XML | WCF
 Sunday, January 20, 2008
"MindTouch Dream is a .NET REST framework for developing lightweight, highly decoupled web-services.  It runs on Microsoft .NET 2.0 and Novell Mono 1.2.2."
http://wiki.opengarden.org/Dream
Sunday, January 20, 2008 2:53:35 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Architecture | Open Source | Tools | Useful stuff | Web Services
"Spring.NET is an open source application framework that makes building enterprise .NET applications easier. Providing components based on proven design patterns that can be integrated into all tiers of your application architecture,Spring helps increase development productivity and improve application quality and performance..."
http://www.springframework.net
Sunday, January 20, 2008 2:35:31 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Agile | Architecture | Cool | Open Source | Tools | Useful stuff
 Thursday, January 17, 2008
Thursday, January 17, 2008 9:27:37 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Helped with work | Useful stuff
Creating a web service for an InfoPath form in 25 easy steps
http://blogs.msdn.com/philoj/archive/2005/11/08/490200.aspx

Developing InfoPath Forms for Anonymous Access
http://www.paylasimnoktasi.com/en/anonymousinfopathforms.aspx

All About SharePoint - S.S. Ahmed - MVP Microsoft SharePoint
http://www.sharepointblogs.com/ssa/default.aspx

Programmatically create an InfoPath form from scratch using a Console application and C# code
http://enterprise-solutions.swits.net/infopath2007/programmatically-create-infopath-form-console-app.htm


Thursday, January 17, 2008 9:26:19 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Helped with work | Web Services | XML | InfoPath | SharePoint
 Sunday, January 13, 2008
ScrewTurn Wiki is a fast, powerful and simple ASP.NET wiki engine, installs in a matter of minutes and it's available in different packages, fitting every need. It's even free and opensource.
http://www.screwturn.eu/
Sunday, January 13, 2008 11:49:16 AM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ASP.NET | Cool | Open Source | Tools | Useful stuff | XML
 Monday, January 07, 2008
Monday, January 07, 2008 9:47:12 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Cool | Open Source | Tools | Useful stuff
 Sunday, January 06, 2008
Sunday, January 06, 2008 2:39:31 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Architecture | Useful stuff | Patterns & Practices
 Monday, December 24, 2007
Monday, December 24, 2007 3:25:08 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ASP.NET | Useful stuff
 Sunday, December 23, 2007
Sunday, December 23, 2007 7:21:48 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | SOA | Web Services | When things go wrong
Sunday, December 23, 2007 7:20:40 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ASP.NET | Performance Tuning | Web Services | XML
Sunday, December 23, 2007 7:18:48 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | When things go wrong
Sunday, December 23, 2007 7:17:09 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ASP.NET | Web Services
Sunday, December 23, 2007 7:16:26 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ASP.NET | Web Services
Source Link

I am developing a web service for a customer. The service has a method, that
returns an array of Forms. Each form has a Name property of Type String.

The customer wants the contract to specify, thath the name is mandatory and
not nullable. To reflect this, they want the xml in the wsdl (the Form part)
to look similar to this:

<xs:complexType name="Form">
<xs:sequence>
...
<xs:element minoccurs="1" maxoccurs="1" name="Name" nillable="false" type="xs:string">
...

So, minOccurs should be 1 and nillable should be false (or omitted), to
ensure the value is present and not null.

No matter how I go about this, however, I cannot make the wsdl generate the
desired values. I have tried to do contract-first development using WSCF from
thinktecture, and have the schema dictate the above values for minOccurs and
nillable, but this approach has not remedied the problem.

Is it at all possible to do what I want using .Net and Visual Studio 2005? I
hope my problem is described adequately, otherwise please request more
information. Any help is greatly appreciated.


Regarding on the webservice class property definition problem you
mentioned, here are some of my understanding and suggestion:

1. .NET webservice will always generate the xsd scheme for class property
as below:

** for value type(primitive types or struct), it will use minOccurs="1"
since value type will always be assigned a value(doesn't have null value
unless you use nullable type).

** for reference type(such as normal class), it will use minOccurs="0"
since value type will always support null value, the "string" type in your
case is just conform to this policy.

So far this rule is not changable in our custom code(attribute).

2. Also, XML XSD schema definition's element definition doesn't 100%
completely identical to .NET(or OO ) class/type definition. For example, if
you have the following xsd schema

<element minOccurs="1" ..../>

you can not find a reference type to mapping it since reference type always
support null reference value. I think you can consider define a wrapper
class(which inherit from ValueType ), property of such type will be
automatically generated as minOccurs="1" in XSD schema. However, you still
need to ensure that any sub property of reference type(such as string) has
been supplied a value in your own code.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead







Sunday, December 23, 2007 7:09:59 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Web Services | When things go wrong | XML
Sunday, December 23, 2007 6:16:10 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Security
Sunday, December 23, 2007 6:15:32 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Performance Tuning | Useful stuff | Web Services
Sunday, December 23, 2007 6:12:23 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET
Sunday, December 23, 2007 5:53:31 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Useful stuff | Powershell
Sunday, December 23, 2007 5:49:05 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Tools
Sunday, December 23, 2007 5:48:04 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | IDE
Sunday, December 23, 2007 5:24:34 PM (Central America Standard Time, UTC-06:00)  #    Comments [0] -
.NET | Helped with work | Tools | Open Source
Sunday, December 23, 2007 5:03:34 PM (Central America Standard Time, UTC-06:00)