Monday 2 July 2012

Integrating crucial hierarchical binding feature to the trading applications

Hierarchical binding present in the trading and financial applications offer a variety of features to its users. Most of the .Net grid or MFC grid based applications implement Hierarchical binding. The benefits of using Hierarchical binding are many. For example an application implementing the Hierarchical binding techniques can easily sort and filter data compared to ones that do not. Thus the use of Hierarchical binding techniques is becoming more and more popular. Most of the developers working on the .Net platform and designing trading applications make use of Hierarchical binding benefits. The Hierarchical binding techniques also allow better data integration techniques in case of real time data update. Since most of the modern day trading and financial applications need real time voluminous updates therefore hierarchical binding is necessary to implement performance and security. Most of the hierarchical binding modules can be designed in secured manner to ensure data and application integrity.
public class Order
{
    private readonly string _instrument;
    private readonly double _price;
    private readonly long _quantity;

    public Order(string instrument, double price, long quantity)
    {
        _instrument = instrument;
        _price = price;
        _quantity = quantity;
    }

    public string Instrument
    {
        get { return _instrument; }
    }

    public double Price
    {
        get { return _price; }
    }

    public long Quantity
    {
        get { return _quantity; }
    }
}

public void PopulateGrid(Grid grid)
{
    BindingList<Order> orders = new BindingList<Order>();

    orders.Add(new Order("Instrument1", 10.55, 34));
    orders.Add(new Order("Instrument2", 12.26, 154));
    orders.Add(new Order("Instrument1", 13.16, 14));
    orders.Add(new Order("Instrument5", 9.85, 52));
    orders.Add(new Order("Instrument1", 16.47, 11));

    grid.DataSource = orders;
}
The above code implements the hierarchical binding features. Most of the hierarchical binding modules enable better data integration customizability along with data safety. The hierarchical binding modules also allow the developer to make the application more robust and scalable for regular use.
public void PopulateGrid(Grid grid)
{
    Strategy strategy = new Strategy("Strategy 1");
    strategy.Orders.Add(new Order("SubOrder1", 10.15, 34));
    strategy.Orders.Add(new Order("SubOrder2", 30.51, 43));
    grid.Rows.Add(strategy);

    Strategy strategy = new Strategy("Strategy 2");
    strategy.Orders.Add(new Order("SubOrder1", 10.15, 34));
    strategy.Orders.Add(new Order("SubOrder2", 30.51, 43));
    grid.Rows.Add(strategy);
}

public class Order : INotifyPropertyChanged
{
    ...

    public double Price
    {
        get { return _price; }
        set
        {
            _price = value;
            if(PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("Price"));
            }
        }
    }

    public long Quantity
    {
        get { return _quantity; }
        set
        {
            _quantity = value;
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("Quantity"));
            }
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;
}
In the above code the hierarchical binding modules implement two known features of Data binding with multi threading features and the INotifyPropertyChanged feature. The hierarchical binding modules are applied in such a way that these features are used effectively in designing the applications for regular usage. Since most of the applications are financial and trading in such cases therefore the use of these features are crucial for development.

1 comment:

  1. I ‘d point out that most of us readers actually are unequivocally lucky to live in a fantastic place with so many lovely individuals with very helpful solutions.
    http://www.dapfor.com/en/net-suite/net-grid/features/performance

    ReplyDelete