Archive

Archive for March, 2010

Sum of even valued numbers in Fibonacci series

March 25th, 2010 No comments

Up to 4 million.

int f1 = 0;
int f2 = 1;
int temp = 0;
int sum = 0;
for (int i = 0; sum < 4000000;i++)
{
    temp = f1 + f2;
    f1 = f2;
    f2 = temp;
    if (f2 % 2 == 0)
        sum += f2;
    listBox1.Items.Add(f2.ToString());
}
textBox1.Text = sum.ToString();
VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: Code Snippets

Sum of multiples of 5 OR 3

March 25th, 2010 No comments
 
int sum = 0;
for(int i=0;i<1000;i++)
 
{
    if ((i % 3 == 0) || (i % 5 == 0))
    {
        sum += i;
    }
}
 
textBox1.Text = sum.ToString();
VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: Code Snippets

Should application architects write code?

March 24th, 2010 No comments

In my opinion, a technical architect must code! Most of the architects I know are hard-core coders. He must be knowing what developers are going to do. How one can build a house if he doesn’t know what is wood, cement, roof etc?

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: Architecture

How to print a WPF form

March 24th, 2010 No comments
            PrintDialog pd = new PrintDialog();
            pd.ShowDialog();
            pd.PrintVisual(this, "wpf printing");
VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)

Sample applications for your Architecture case study

March 18th, 2010 No comments

Here are few I’ve gone through while my architecture learning.

MS PetShop That demonstrates an enterprise architecture for building .NET Web Applications. The application can be used to compare to Sun Microsystem’s J2EE Pet Store application across architecture, programming model, productivity, performance, scalability and reliability. The new .NET Pet Shop 3.0 incorporates community feedback with an improved architecture that follows Microsoft Prescriptive Architecture Guidelines, and will be benchmarked by the Middleware Company in June, 2003 to compare with several J2EE implementations of the same application. The new .NET PetShop 3.0 implements a Data Access Layer against both SQL Server 2000 and Oracle 9i backend databases. Link
Fitch & Mather Stocks Fitch & Mather Stocks is a multitier, distributed business-to-consumer financial services application built specifically for the Microsoft® .NET platform. Its design, development, and deployment provide insight into how developers can leverage various features of the .NET platform. Link
Duwamish Duwamish is a fictitious, distributed, Web-based, e-commerce application. The sample is an end-to-end, business-to-consumer application that emphasizes functionality, scalability, securability, performance, and design methodology. Link
VN:F [1.9.18_1163]
Rating: 5.0/5 (1 vote cast)
Categories: Architecture

I am in Cochin

March 16th, 2010 No comments

Btw, I forgot to say I am in Cochin for last 3 months. :)

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: General

What is “Code smell”?

March 16th, 2010 No comments

Just got this piece from SearchWinDevelopment newsletter:

A code "smell" is a way of saying that there is potentially a problem with your code.

Wikipidea says:

code smell is any symptom in the source code of a program that possibly indicates a deeper problem.

Common code smells:

  • Duplicate code: identical or very similar code exists in more than one location.
  • Large method: a method, function, or procedure that has grown too large.
  • Large class: a class that has grown too large, see God object.
  • Feature envy: a class that uses methods of another class excessively.
  • Inappropriate intimacy: a class that has dependencies on implementation details of another class.
  • Refused bequest: a class that overrides a method of a base class in such a way that the contract of the base class is not honored by derived class. See Liskov substitution principle.
  • Lazy class: a class that does too little.
  • Contrived Complexity: forced usage of overly complicated design patterns where simpler design would suffice.
VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: Architecture

ASP.NET MVC 2 Released

March 12th, 2010 No comments

Final release of ASP.NET MVC 2 is now available for VS 2008/Visual Web Developer 2008 Express with ASP.NET 3.5.

Download Links:

 

What is new in ASP.NET MVC 2?

  • New Strongly Typed HTML Helpers
  • Enhanced Model Validation support across both server and client
  • Auto-Scaffold UI Helpers with Template Customization
  • Support for splitting up large applications into “Areas”
  • Asynchronous Controllers support that enables long running tasks in parallel
  • Support for rendering sub-sections of a page/site using Html.RenderAction
  • Lots of new helper functions, utilities, and API enhancements
  • Improved Visual Studio tooling support

 

Read ScottGu’s Blog entry

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: ASP.NET

IT Architecture bytes

March 10th, 2010 No comments

Design Principles at a glance. I will be adding more in coming days.

KISS
  • keep it simple and stupid
  • Keep it simple, stupid!
  • Keep it short and simple
  • The KISS principle states that simplicity should be a key goal in design, and that unnecessary complexity should be avoided
    YAGNI You ain’t gonna need it It is the principle in extreme programming that programmers should not add functionality until it is necessary
    DRY
  • Don’t Repeat Yourself
  • Duplication is Evil
  • Aimed at reducing repetition of information of all kinds. Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
    SOC Separation of Concerns It is the process of separating a computer program into distinct features that overlap in functionality as little as possible
    SRP Single Responsibility Principle Every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.
    TDD Test Driven Development Is a software development technique that relies on the repetition of a very short development cycle: First the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refractors the new code to acceptable standards.
    CI Continuous Integration continuous integration  implements continuous processes of applying quality control – small pieces of effort, applied frequently.
    BDD Behavior Driven Development Is an Agile software development technique that encourages collaboration between developers, QA and non-technical or business participants in a software project.
    DDD Domain Driven Design Is an approach to developing software for complex needs by deeply connecting the implementation to an evolving model of the core business concepts.
    POEAA Patterns of Enterprise Application Architecture A book by Martin Flower
    VN:F [1.9.18_1163]
    Rating: 0.0/5 (0 votes cast)
    Categories: Architecture

    Enterprise Service Bus

    March 4th, 2010 No comments

    Today I was discussing something with a friend (scenario anonymous ;) ) and came the topic Enterprise Service Bus. I checked its Wikipedia explanation and I wonder why I missed the link between its definition and title. Because I knew the concept but didn’t know Enterprise Service Bus was the name for that.

    An Enterprise Service Bus (or ESB) consists of a software architecture construct which provides fundamental services for complex architectures via an event-driven and standards-based messaging-engine (the bus).

    An ESB generally provides an abstraction layer on top of an implementation of an enterprise messaging system, which allows integration architects to exploit the value of messaging without writing code. Unlike the more classical enterprise application integration (EAI) approach of a monolithic stack in a hub and spoke architecture, an enterprise service bus builds on base functions broken up into their constituent parts, with distributed deployment where needed, working in harmony as necessary.

     

    Another good reading: http://www.microsoft.com/biztalk/en/us/esb-guidance.aspx

    What Is an Enterprise Service Bus?

    VN:F [1.9.18_1163]
    Rating: 0.0/5 (0 votes cast)
    Categories: Architecture