CSLA Basics

CSLA Basics

Old forum URL: forums.lhotka.net/forums/t/3936.aspx


alfredg posted on Sunday, November 25, 2007

I am using CodeSmith to create my CSLA objects and wanted to make sure I understood some of the basics. I have all of Mr. Lhotka's books since VB6 Business Objects but have always been prevented from doing a full CSLA project.

My question is related to List objects. The objectInfo classes used in the BO books seem to be their own CSLA template, and are not editable child or read-only child objects. Is this correct?

What I want to accomplish is a very simple UI.

A output control (datagrid) is bound to a read only collection of objects. When a user selects edit, an editable root object is loaded.

In this case I believe I need one editable-root object, one readonly-list object, and what else?

McManus replied on Monday, November 26, 2007

Alfred,

Typically, you use a read-only child object in a read-only list. However, this is not a requirement. You can also use a "normal" class or even a struct.

Cheers,
Herman

maheshm replied on Monday, November 26, 2007

The BusinessList Classes will have businessbase as child and ReadOnlyList will contain Readonlybase objects (recomended) . But you can use Other type of objects or structs also in ReadonlyList but is not recommended .

Plowking replied on Tuesday, November 27, 2007

Yep:

for your readonly list inherit ReadOnlyListBase
for your list items, inherit: ReadOnlyBase
for your editable root object, inherit: Business Base

The Project Tracker sample application has good examples of implementation, as does the class skeletons project.

Copyright (c) Marimer LLC