Navigation


Milos Solution Platform (External Blog)

The Milos Solution Platform is .NET's premier platform for building business applications. This blog is meant for developers who use or evaluate Milos. This blog is used to share tidbits of information provided by the Milos developers at EPS. Many of the posts put the spotlight on new features. We generally recommend that all Milos users (developers) at least scan this blog to keep up with the Milos news.

Content Area Footer

Wednesday, April 16, 2008
Data Load Controllers

We have recently introduced a fully-automatic way of creating external data loading mechanisms. This is achieved by means of so-called "data load controllers". So what is the basic idea behind these? Well, I am glad you asked! :-)

Milos provides great ways to load data in all kinds of data edit forms, from Windows to the Web, in all kinds of variation. For instance, one can simply use the SetEntityType<>() method to automatically load an entity of a certain type in a window or a web form. It is also possible to override LoadContents() and LoadSecondary() data methods to load additional data, or load it in slightly different ways.

This makes for easy ways of loading data. However, in some scenarios, we want to go even further. (We will always continue to support this approach as it provides the basis for all operations, but we want to provide more options). There are a few scenarios we want to simplify. Here are those considerations:

  1. This approach generally relies on inheritance. That is OK in many scenarios, but in some scenarios (such as ASP.NET web forms or WPF/Silverlight XAML), there are scenarios where one just wants to use an object instance for data loading. For instance, one might want to put a data panel into a web form without explicitly subclassing it. Those scenarios are currently supported by means of an event model. That is not a bad approach, but it is slightly different from the inheritance model, and the written code is not IL-compatible, since method signatures are differently, and so forth.
  2. Different interfaces may have a need to load the same data. For instance, 10 different forms of a windows application may need to load certain lookup tables. Or, an ASP.NET web form may need to load the same exact data as the WinForms or WPF equivalent. Neither the inheritance, nor the event model allows for simple code reuse in these scenarios.
  3. It is very hard to unit test data loading for UIs if the code is embedded in, or attached to the user interface classes.

We now provide an additional abstract option: All the data loading (and data handling) code can be put in an abstract class. Here is an example of such a class:

public class NameEditLoader : DataLoadController
{
    public override void Configure()
    {
        this.SetEntityType<NameBusinessEntity>();
    }

    public override object LoadSecondaryData()
    {
        NameBusinessObject names = NameBusinessObject.NewInstance();
        DataSet dsNames = names.GetList();
        names.Dispose();
        return dsNames;
    }
}

If you are familiar with current Milos loading code, then you will recognize all of this, because the code is identical to code that would go into a Windows Forms class as well as other types of UI classes. The main difference is that this code now sits in an external class. This class can now be used in an interface class. For instance, it could be used in a Windows Form or a WPF window like so:

public MyWindow() // Constructor
{
    InitializeComponent();
    this.DataLoadControllers.Add(new NameEditLoader());
}

The same exact object can also be used on a web form:

protected void Page_Load(object sender, EventArgs e)
{
    this.dataEditPanel1.DataLoadControllers.Add(new NameEditLoader());
}

The same object could also be used in XAML, or in a mobile app, and so forth. Also, the object can now be used stand-alone in unit test scenarios, which is extremely important in test driven development (TDD) and other scenarios where unit tests are needed. (And most applications need unit tests these days).

So we think this is a cool change. It is completely optional and everything that was there before is still available. But going forward, this is clearly the recommended approach.

 

Posted @ 4:08 AM by Egger, Markus (markus@code-magazine.com) -
Comments (16)




Comments:

RE: Data Load Controllers
Wednesday, June 29, 2011 7:27 PM by vibram 5 fingers - cai297472630@126.com

Great job on the blog, it looks great. I am going to save it and will make sure to visit weekly


rs gold sell
Tuesday, September 13, 2011 10:46 PM by Runescape - http://rs2web.com/

Runescape Accounts has different skills in which players can level up and try to achieve the maximum level. As of right now, the max level for every skill is set to 99. Not only this, but you also have multiple combat skills that you can use to defeat certain battles with. These combat skills include strength, attack, defense, magic, and ranged attack.Runescape items is always updating its content trying to keep players very occupied and entertained.rs2web.com is one reliable website that sells rs gold sell at very cheap rate.


RE: Data Load Controllers
Saturday, September 24, 2011 1:41 AM by Android developers - suchismita.pnda1989@gmail.com

There are mainly three type of member function we used..private,public and protected..Public can access by outside class also.. From your Information I came to know about all these thing..


RE: Data Load Controllers
Tuesday, November 08, 2011 6:47 PM by iPhone 4S Ringtone Maker - plant2013@gmail.com

iPhone 4S Ringtone Maker is the fastest and easiest way to create custom ringtones for your iPhone.


RE: Data Load Controllers
Tuesday, November 29, 2011 2:54 AM by JR. Tresor Paris - galas262031416@yahoo.cn

Nice blog.I love reading your blog because it has very interesting topics.


RE: Data Load Controllers
Wednesday, December 13, 2017 12:07 PM by boomessays.com review - damonkorbin@hotmail.com

I have always wanted to know how these controllers really worked and I found the perfectly explained article here. This article is great and I would love to see some more great articles like this on other topics as well.


RE: Data Load Controllers
Saturday, January 27, 2018 1:10 PM by Watch Oscars 2018 online

A great blog post written on Data Load controllers here. I can't believe that this was written in 2008. I didn't even have internet in my home back then.


RE: Data Load Controllers
Friday, February 16, 2018 12:45 PM by best dissertation writer - quenby2@yahoo.com

A process of data load controllers with complete detail and cover all possible aspects or components. In other words this guide is the finest source to be part of these kinds of controllers. That is really helpful who direct or indirect involve in it.


RE: Data Load Controllers
Monday, February 19, 2018 1:46 PM by www.deserttoursdubai.com

You compose extraordinary posts consistently and that is astonishing! This is another fabulous post composed by you and I adore it. On the off chance that you quit doing this reliable work, I would be extremely dismal.


RE: Data Load Controllers
Monday, May 21, 2018 4:32 AM by bomberman 64

If you're a fan of classic arcade games, then you have to try out the latest bomberman 64 game, which can be played on PC. This title was originally released on Nintendo Switch, but you can play it on PC now. You won't be able to tell the difference.


RE: Data Load Controllers
Saturday, June 02, 2018 5:58 AM by cocktail dresses

Nice article written here. The details about this topic were always a bit blurry to me, but they've been explained really well here. I will share these details with my mates to see if they know about this, as well.


RE: Data Load Controllers
Saturday, June 09, 2018 8:30 AM by SEO Agency

Incredible work done here, however some change is required. I was inspired by the substance here, however the written work is still somewhat adequate. I might want to have a word with this author, so I can tell the individual how to fix this.


RE: Data Load Controllers
Thursday, June 14, 2018 6:18 AM by ????????????

Cool work done here, old buddy. I didn't expect anything, not as much as a great article from you, and you've proven me wrong here. Would love to see some more stunning work like this from you.


RE: Data Load Controllers
Monday, June 18, 2018 2:36 PM by ??????????

Many people online think this site does not deliver when it comes to quality work. Those people wouldn't recognize quality work if it stared them right in the face. That's the truth and you should accept it now.


RE: Data Load Controllers
Tuesday, June 19, 2018 3:06 PM by UFABET

There is not a single better article than this one right now. If you think there is, I would like to know which article it is. Even my mates agree with the statement that I've made at the start of this comment.


RE: Data Load Controllers
Saturday, July 21, 2018 5:17 AM by cheap wigs for sale

Rinsing Rinse under warm running warm water, using downwards stroking movements until it rinses clear and clean.




Post a Comment:

Comment Title (required)

Your Name (optional)

Your Email (optional)

Your Web Site (optional)

Your Comment (required)

 

 

 

 

 

 

 

Syndication RSS 2.0 RSS 2.0

All My Blogs:
My personal blogs:
Dev and Publishing Dev and Publishing
Travel and Internat. Living Travel and Internat. Living
Other blogs I contribute to:
Milos Blog (US) Milos Blog (US)
VFPConv. Dev Blog (US) VFPConv. Dev Blog (US)
VFPConv. Dev Blog (DE) VFPConv. Dev Blog (DE)

 

Blog Archives
All Blog Posts

2010
    November (1)
2009
    July (2)
    February (2)
    January (1)
2008
    December (1)
    October (3)
    June (1)
    April (3)
    February (1)
    January (1)
2007
    December (1)
    October (2)
    September (2)
    July (1)
    June (2)
    May (4)
    April (6)
    March (8)
    February (3)
    January (2)
2006
    December (2)
    November (2)

 

 

 

This Blog is powered by MilosTM Collaboration Components.