Some thoughts about problem solving

by Bogdan Nedelcu 9. September 2009 14:52

I remember from a book called "How to build your own space ship - The science of personal space travel": one problem with the space modules was that of heating, once they are up in space, the temperature on the side facing the sun is tremendous high compared to the face facing the deep space. The design team was confronted with chosing between a complex head transfer engine or a sophisticated material which would resist both at high and very low temperatures. One brilliant engineer came up with the excellent idea to spin the vehicle at a certain speed in order regularize the temperature.

Problem solving is fascinating. Listen to this web cast and figure out what to do when such brilliant ideas are not available.

 

Tags: , ,

The WayBack Machine and archive.org project

by Bogdan Nedelcu 6. September 2009 21:27

Saturday night I had the pleasure to meet Aaron Binns and chatted with him for some hours. 
He is working on an interesting project called archive.org. Trying to archive everything available on the internet and store for eternity. A good application is the WayBack machine. It shows how your web site looked several years ago. Let's see TeamNet in the time machine.

Tags:

Scott building the case for VS 2010

by Bogdan Nedelcu 5. September 2009 19:03

ScottGu is building it's case around the features of Visual Studio 2010 and .NET 1.0

Follow it's blog for news on these subjects. 

Tags: ,

Blogs about Business Analysis

by Bogdan Nedelcu 3. September 2009 14:26

I conducted a survey about what to read in order to become e better business analyst.
Here are my results:

http://ivarblog.com/
http://practicalanalyst.com/
http://www.modernanalyst.com/Community/ModernAnalystBlog/tabid/181/Default.aspx
http://www.handbookofsoftwarearchitecture.com/index.jsp?page=Blog
Scott Ambler - http://www.agilemodeling.com/
Alistair Cockburn - http://alistair.cockburn.us/


And some books:
BABOK 1.6 - www.theiiba.org
Learning UML 2.0

Templates and checklists: "UML for IT Business analyst" si http://www.opfro.org

Tags: , , ,

Usecases and fractal theory

by Bogdan Nedelcu 19. August 2009 17:02

I had a discussion recently with a colleague about how to assure your project team to cover the entire scope of the project with usecases. The example was associated with a rectangle as the scope of the projectand some small rectangle, covering each other, and trying to cover the entire scope.

Although the problem of defining a use case is difficult,now I want to talk about how to cover entirely some area, not with shape, bu twith method.

Rectangle are simple, so are some projects. Most projects are difficult and their scope reveal to the team as time passes by and as more experience is acquired. As a parallel to geometrical figures we can imagine a project as being complex irregular geometry figure, which in order to becovered require different shapes, and rectangles are in most cases a bad choice.

Let’s introduce some theory: “A fractal is generally "arough or fragmented geometric shape that can be split into parts, each of whichis (at least approximately) a reduced-size copy of the whole”

In order to generate a fractal figure you have to have a starting figure and a method, and by applying the same method, over and over, you get the final figure. The more you work on, the more detailed the fractal figure gets.

Another interesting fact about fractal figures is that theycan have factionary dimension. It is well known that points have no dimension,lines are one dimension and the surface has 2 dimensions, space 3, and so on.

Fractals figure can face 1.5 dimensions, meaning that it ismore than a line, but not a surface. There are also fractal figures which have dimension two. This means that they can be assimilated to a surface, they can cover a surface. xample the Dragon Curve

You have a starting figure and a method. Apply the same method over and over and you will cover a surface, any figure.

Now, back to our problem, we must cover with use cases aproblem scope. We must find two things: the shape of the starting point, the method to be applied over and over, and not least the starting point.

Now, where should be good starting point ? Inside the shape given by all the actors of the system.

Conclusion: wisdom for the figure, and perseverance in applying the method will get you to cover the entire scope.

Tags: ,

TeamNet Data File Export - Librarie Open Source

by adrian.tosca 5. May 2009 12:03

Exportul de date in fisiere poate fi o parte importanta a unei aplicatii mai ales atunci cand este nevoie de interoperabilitate cu aplicatii mai vechi. TeamNet Data File Export este o librarie folosita intern de TeamNet care exporta in mod foarte simplu fisiere DBF si CSV dintr-o sursa de date existenta cum ar fi un DataSet sau o lista de obiecte. Aceasta librarie este acum open source si poate fi obtinuta de pe site-ul CodePlex.

Libraria este scrisa in c# si a fost conceputa pentru a nu avea nici un fel de dependinte externe. Design-ul librariei este orientat pentru exportul cu usurinta a datelor si extensibilitate. Pe pagina proiectului http://datafileexport.codeplex.com/ se gaseste si un exemplu de utilizare pentru exportul intr-un fisier DBF. Alte exemple de folosire se pot gasi in sursa proiectului de teste. 

Tags:

Value Mapping

by ion.robu 24. February 2009 11:31

 

There can be cases in mapping development when the developer needs to map some fields conditionally. More exactly, let say that there is need to map in the following situation: if a source field has a value, then a second source field must be mapped to a destination field, else, a third source field must be mapped to the destination field:

 

IF(SourceField1 == Value1) THEN

            DestinationField1 = SourceField2

ELSE [IF(SourceField1 == Value2)]

DestinationField1 = SourceField3

 

There are several solution to do this mapping (for example, using a Script functiod). In this example, we will do that using ValueMapping functoid.

Let’s consider the following example: we have a Biztalk application which simply receive a flat file, disassemble it according to a receive schema, perform a mapping as described above, assemble it according to a send schema and output the resulting file to a send port.

The input file is:

Receive schema is:

 

Tag field if the first character from record (in our example, A or B), Data1 is testdata1_1..5 and Data2 is testdata2_1..5

 

Send schema is:

 

And map is:

 

 

(of course, is a very simplified map and schemas).

The logic of the mapping is:

IF(Tag == “A”) THEN

            Dest.Data1 = Source.Data1

ELSE IF(SourceField2 == “B”)

Data2 = Source.Data2

            In Equal functoids, we have 2 comparisons which return true or false:

and

 

The ValueMapping functoids functions as follows: if the first parameter is true, then second parameter value is returned and is mapped to destination fields. Else, no value is returned, and destination field does not receive anything.

Thus, in our example, for the fields which starts with “A”, Data1 value will be mapped (testdata1_1..5), else, Data2 field will be mapped(testdata2_1..5).

According to these, we obtain output file:

 

 

We can see that, for records 1, 2, and 4 from source file, that start with “A” (Atestdata1_1testdata2_1, AtestData1_2testdata2_2, Atestdata1_4testdata2_4) we have Data1 fields in destination file (testdata1_1, testdata1_2, testdata1_4) and for records 3 and 5, that start with “B” (Btestdata1_3testdata2_3, Btestdata1_5testdata2_5), we have Data2 in destination file (testdata2_3, testdata2_5)

 

 

ValueMapping.rar (14.41 kb)

Tags:

Programming

Debatching SWIFT messages

by ion.robu 24. February 2009 11:24

 

SWIFT is a standard which describe acollection of messages formats. There are a lot of financial applications whichworks with financial transactions, and, often, these applications must communicatebetween them. Because each of them worked with certain formats, there washarder and harder to maintain a good transmission of information, and requireda lot of time and effort.

Because of that, SWIFT standard wasreleased to describe how the messages should be structured and how to exposethe information, in order to be properly interpreted, to be easier tomanipulate and, thanks God, make developer life easier. [More...

Tags:

Programming

LateBinding

by ion.robu 10. February 2009 16:55

In this article we will present a sample about how to use late binding in .NET using System.Reflection namespace and System.Type class.

What is Late Binding? – is a mechanism which allow to instantiate types and accessing members of objects created without knowing these types at compile time. Shortly, these types are not referred “classically”, through dot and new operators, but at runtime, acquiring information about structure type, instantiating objects and invoking its members. All of these without referring that type at all (anyway, we cannot do that, given that we did not include information about that type at compiling time.). All we need is to know structure of used type, more exactly, knowing what methods and properties we need to use.

This approach can be very useful in a lot of cases, due of these capabilities to manipulate objects at runtime, while they are unknown at compile time; this fact help us to provide a much more flexibility to our applications when interacting with others application and/or third-party software (such as COM).

Example – in the following example, we will manipulate objects from a .NET assembly using reflection mechanisms. In this assembly we have class Employee, which exposes some members and methods, and class EmployeeMethods, which exposes a collection of Employee objects and some methods which works on this collection. These 2 types (classes) will be used from main application (a website) without referring it at developing type, but operating on it at execution time. The referred assembly is stored on disk, and its location is given in web.config (you should copy it manually in this location).

Here is the code:

Code from assembly Objects.LateBinding.dll

using System;

using System.Collections.Generic;

namespace Objects.LateBinding

{

       public class Employee

       {

              public string EmployeeName = "";

              public int EmployeeAge = 0;

              public string EmployeeFunction = "";

              public Employee(string name, int age, string function)

              {

                     EmployeeName = name;

                     EmployeeAge = age;

                     EmployeeFunction = function;

              }

              public string PresentEmployee()

              {

                     return string.Format("Hi, I am {0}, {1} years old and I work as {2}", EmployeeName,EmployeeAge, EmployeeFunction);

              }

       }

       public class EmployeeMethods

       {

              public List<Employee> Employees;

              public void Init()

              {

                     //in real scenarios, data will be loaded from various sources

                     Employees = new List<Employee>();

                     Employees.Add(new Employee("John", 26, "Programmer"));

                     Employees.Add(new Employee("Joe", 30, "Web developer"));

                     Employees.Add(new Employee("Jim", 40, "Software architect"));

              }

              public Employee GetEmployee(int i)

              {

                     return Employees[i];

              }

              public int GetEmployeesCount()

              {

                     return Employees.Count;

              }

              public void AddEmployee(string name, int age, string function)

              {

                     Employees.Add(new Employee(name, age, function));

              }

       }

}

Code from Default.aspx.cs from main application:

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Reflection;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page

{

       Assembly Asmb = null;

       Type EmployeeMethods = null;

       Type EmployeeType = null;

       object EmpMethods = null;

    protected void Page_Load(object sender, EventArgs e)

    {

              InitTypes();

              if (!IsPostBack)

              {

                     InitEmployees();

                     PresentEmployees();

              }

    }

       private void InitTypes()

       {

              //get assembly with Employee classes

              Asmb = Assembly.LoadFrom(System.Configuration.ConfigurationManager.AppSettings["TestAssembly"]);

              //get EmployeeMethods type information

              EmployeeMethods = Asmb.GetType("Objects.LateBinding.EmployeeMethods");

              EmpMethods = Activator.CreateInstance(EmployeeMethods);

       }

       private void InitEmployees()

       {

              //invoke Init method on EmployeeMethods to init employee collection

              MethodInfo mtdInfo = EmployeeMethods.GetMethod("Init");

              mtdInfo.Invoke(EmpMethods, null);

       }

       private void PresentEmployees()

       {

              //get employees count from EmployeeMethods object created earlier

              MethodInfo mtdInfoEmpCount = EmployeeMethods.GetMethod("GetEmployeesCount");

              object employeesCount = mtdInfoEmpCount.Invoke(EmpMethods, null);

              int emplCount = (int)employeesCount;

              //get each employee object

              for (int i = 0; i < emplCount; i++ )

              {

                     object[] parEmpl = new object[] { i };

                     MethodInfo mtdInfoEmp = EmployeeMethods.GetMethod("GetEmployee");

                     object employee = mtdInfoEmp.Invoke(EmpMethods, parEmpl);//get employee

                     //invoke PresentEmployee method for current employee

                     EmployeeType = employee.GetType();

                     MethodInfo mtdInfoEmpPresent = EmployeeType.GetMethod("PresentEmployee");

                     object employeePresent = mtdInfoEmpPresent.Invoke(employee, null);

                     //display the 'response' of the method

                     Response.Write(employeePresent.ToString() + "<br/>");

              }

       }

       private void AddEmployee(string Name, int Age, string Function)

       {

              //Add employee with values from interface

              object[] parEmpl = new object[] { Name, Age, Function };

              MethodInfo mtdInfoEmpAdd = EmployeeMethods.GetMethod("AddEmployee");

              mtdInfoEmpAdd.Invoke(EmpMethods, parEmpl);

       }

       protected void btnAddEmployee_Click(object sender, EventArgs e)

       {

              InitEmployees();

              AddEmployee(txtName.Text, int.Parse(txtAge.Text), txtFunction.Text);

              PresentEmployees();

       }

}

Code from Default.aspx:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

    <title>Late binding</title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

              <table>

                     <tr>

                           <td colspan="2"><b>Add an employee:</b></td>

                     </tr>

                     <tr>

                           <td>Name:</td>

                           <td><asp:TextBox ID="txtName" runat="server"></asp:TextBox></td>

                     </tr>

                     <tr>

                           <td>Age:</td>

                           <td><asp:TextBox ID="txtAge" runat="server"></asp:TextBox></td>

                     </tr>

                     <tr>

                           <td>Function:</td>

                           <td><asp:TextBox ID="txtFunction" runat="server"></asp:TextBox></td>

                     </tr>

                     <tr>

                           <td colspan="2"><asp:Button ID="btnAddEmployee" runat="server" OnClick="btnAddEmployee_Click" Text="Add employee"/></td>

                     </tr>

              </table>

    </div>

    </form>

</body>

</html>

In this example we list some employees, hardcoded, and add a new one through web interface, using only reflection mechanisms.

Note: Code is not optimized, and no validation was made, since is not point of interest in this article.

Prj.rar (7.70 kb)

Tags:

Programming

Saga as a substitution for a orchetration

by Bogdan Nedelcu 21. January 2009 23:18

As I am a fan of Biztalk I was surprised to find a clean and very powerfull implementation of the orchestration pattern inside a open source project for .NET

The concept is called "a saga" and can be found in NServiceBus.

It is described in Ayende's blog.

MassTransit is another service bus implementing the same pattern.

Tags:

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

RecentComments

Comment RSS

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar