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

Thursday, January 17, 2008
Generic Sub Item Collections in Business Entities

The latest Milos version has a pretty neat enhancement in the business entity model: Sub item collections are now available as generics. Here's why that's cool:

So far, in order to create collections of sub items in business entities ("1-to-many relationships"), one had to create the individual item objects, as well as a collection class that could hold those items. The trouble with that is that it is a lot of work to create the collection class, and the only benefit of this class is a strongly typed interface. (The strongly typed interface is needed so one can access parent.Children[x] and then get all the properties on that object).

Using the new generic version of the sub item collection, one usually does not have to create a subclass. Instead, one just creates the class for the individual items, and then instantiates the generic version of the collection, with the generic being the item type.

Example: An invoice entity with a line item collection could simply instantiate an appropriate collection like so:

protected override void  LoadSubItemCollections()
{
   this.colLineItems =
       new GenericEntitySubItemCollection<LineItem>(
         this,
         "PK_LineItem",
         "FK_Invoice",
         "Invoices",
         "PK_Invoice",
         this.GetInternalData().Tables["LineItems"] );
}

For more details and a detailed explanation, consult the "How-To: Creating a Collection of Child Items" topic in the Milos documentation.

Of course, the old way is still supported as well. The main benefit of using the generic version is in creating collections by hand. When using any of the code generator tools, one isn't exposed to the collection anyway (in most cases), so the benefit is minimal. So far, the code generator tools do not use the generic collection yet. There are considerations around backward compatibility. However, we are considering to change the tools in the future...



Posted @ 4:05 PM by Egger, Markus (markus@code-magazine.com) -
Comments (18)




Comments:

RE: Generic Sub Item Collections in Business Entities
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


RE: Generic Sub Item Collections in Business Entities
Saturday, September 24, 2011 1:34 AM by Android developers - suchismita.pnda1989@gmail.com

I got very good idea about sub-class..Sub-class is one of the part of main class..Very nice Information..Keep it up try to bring this kind of Information..


RE: Generic Sub Item Collections in Business Entities
Tuesday, November 08, 2011 6:53 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.


Roblox Robux
Monday, March 06, 2017 9:07 PM by Free Robux

The makers of the game Roblox have decided to distribute free Roblox Robux online.


RE: Generic Sub Item Collections in Business Entities
Saturday, June 03, 2017 5:49 PM by best uk essay writing services review - assd@yahoo.com

I know of this business entities work cause i did this whole best uk essay writing services review so i was well equipped with this knowledge, hope it helps others as well you know!


RE: Generic Sub Item Collections in Business Entities
Wednesday, July 12, 2017 9:44 PM by replica rolex watches - yaoek142@yahoo.com

Chances are that PART of your job is that type of work. Why not look half way around the world and find someone else to off-load that part to? Give yourself a little more vacation...


RE: Generic Sub Item Collections in Business Entities
Saturday, July 29, 2017 8:56 PM by cheap yeezy boost - flyly08@yahoo.com

good


RE: Generic Sub Item Collections in Business Entities
Sunday, September 10, 2017 10:23 AM by Interested in Sex - sirking79@gmail.com

Please share more like that.


RE: Generic Sub Item Collections in Business Entities
Monday, September 11, 2017 5:06 PM by Leg Workouts - alikhan@gmail.com

I like to recommend exclusively fine plus efficient information and facts, hence notice it:


RE: Generic Sub Item Collections in Business Entities
Tuesday, September 12, 2017 1:43 PM by Signs he loves you - alikhan@gmail.com

Why do only so much written on this subject? Here you see more.


RE: Generic Sub Item Collections in Business Entities
Tuesday, September 12, 2017 3:10 PM by Questions to ask boyfriend - alikhan@gmail.com

Gives you the best website address I know there alone you'll find how easy it is.


is aptoide safe
Friday, October 13, 2017 7:19 AM by is aptoide safe - kranthisurya@mail.com


is aptoide safe People who are very curious to download Aptoide apk will surely ask this question


RE: Generic Sub Item Collections in Business Entities
Wednesday, November 01, 2017 10:44 PM by free robux hack

Great post


RE: Generic Sub Item Collections in Business Entities
Thursday, June 07, 2018 2:27 AM by loemrntdherid1 - loemrntdherid@yahoo.com.sg

nice post I like this.


C Assignment Help
Wednesday, June 20, 2018 12:44 AM by C Assignment Help - kennethmgideon@gmail.com

Things Are Very Open And Intensely Clear Explanation Of Issues. Was Truly Information. Your Website Is Very Beneficial.


Do My Online Exam
Wednesday, June 20, 2018 4:06 AM by Do My Online Exam - joeym.silva12@gmail.com

This Is Really Great Work. Thank You For Sharing Such A Useful Information Here In The Blog.


RE: Generic Sub Item Collections in Business Entities
Friday, June 22, 2018 1:08 AM by buy coursework online - rosesandra642@gmail.com

Thank you for your work on the blog! You're doing a good job!


RE: Generic Sub Item Collections in Business Entities
Tuesday, July 17, 2018 12:25 AM by windows hosting service - alvinaash873@gmail.com

Compare the internet's top Windows Hosting providers: 100% genuine user reviews, expert reviews, uptime, support and more.




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.