Name/Values Classes?

Posts   
 
    
Stoop
User
Posts: 66
Joined: 28-Feb-2004
# Posted on: 29-Feb-2004 22:16:17   

Hi

I just made the jump from using Rockford Lodka's Business Objects (CSLA) to LLgen. In CSLA there is a nice way to set up a Name/Value class that adds a name/value pairs ( 2 columns from a table) as an item in an arraylist. This is extremly useful in databinding to lists, comboboxes.

Please forgive me all if I missed how to do this in the documentation the LLGen way, but I was hoping someone could show me how to do this.

Maybe this could be a feature in a future version - the abilty to create these classes directly from the project explorer like you can with typelists..

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 01-Mar-2004 09:47:44   

Stoop wrote:

I just made the jump from using Rockford Lodka's Business Objects (CSLA) to LLgen. In CSLA there is a nice way to set up a Name/Value class that adds a name/value pairs ( 2 columns from a table) as an item in an arraylist. This is extremly useful in databinding to lists, comboboxes.

Please forgive me all if I missed how to do this in the documentation the LLGen way, but I was hoping someone could show me how to do this.

Maybe this could be a feature in a future version - the abilty to create these classes directly from the project explorer like you can with typelists..

I'm unfamiliar with the CSLA concept, but what you describe is a good idea. At first I thought it would be just a typed list, but a typed list is based on a datatable, and you probably don't want that. I assume there is no filtering possible, just pulling out 2 columns from a table (which probably form a lookup kind of table) in read-only fashion. I'm not sure when I can add this, but it can be helpful. I have to see if a typed list with these 2 columns isn't too much overkill because you can already create these lists using a typedlist feature.

Frans Bouma | Lead developer LLBLGen Pro
Stoop
User
Posts: 66
Joined: 28-Feb-2004
# Posted on: 01-Mar-2004 11:05:28   

Hi

Well, as I write this I'm currently making an honest effort to build these classes into the 'Self Servicing scheme'. Since I'm still into the learning curve of how the LLGen classes work, well, it might take me a while and leave a bit to desired. But, hey - that's how ya learn, right? simple_smile

So far I've created a base class (based on CSLA NameValueList.vb so the credit goes to Rockford Lohtka on that one), and a NameValueList class that inherits the above class , that I plopped in a folder called "NameValueListClasses", following along the lines of the "TypedListClasses" generated by the program. I'm currently working on how to get the data from the database based on the "Fill" methods, which with then be used to populate and ArrayList with Name/Value pairs which will be returned to the UI.

When I get it up and running, I'll make a small example program using the NW db and pass it on to you (or anyone else that wants a good laugh smile ), if it's OK with you

The Stoopster

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 01-Mar-2004 18:06:07   

Stoop wrote:

Hi

Well, as I write this I'm currently making an honest effort to build these classes into the 'Self Servicing scheme'. Since I'm still into the learning curve of how the LLGen classes work, well, it might take me a while and leave a bit to desired. But, hey - that's how ya learn, right? simple_smile

simple_smile Just try one or two. It won't be that hard I think.

So far I've created a base class (based on CSLA NameValueList.vb so the credit goes to Rockford Lohtka on that one), and a NameValueList class that inherits the above class , that I plopped in a folder called "NameValueListClasses", following along the lines of the "TypedListClasses" generated by the program. I'm currently working on how to get the data from the database based on the "Fill" methods, which with then be used to populate and ArrayList with Name/Value pairs which will be returned to the UI. When I get it up and running, I'll make a small example program using the NW db and pass it on to you (or anyone else that wants a good laugh smile ), if it's OK with you

That would be great! Good luck with the coding simple_smile

Frans Bouma | Lead developer LLBLGen Pro