Click here to Skip to main content
15,887,746 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Communicating between plug-ins... Pin
led mike2-Nov-07 11:14
led mike2-Nov-07 11:14 
AnswerRe: Communicating between plug-ins... Pin
Cedric Moonen4-Nov-07 21:30
Cedric Moonen4-Nov-07 21:30 
GeneralCsv File Compare Pin
Brady Kelly31-Oct-07 23:14
Brady Kelly31-Oct-07 23:14 
GeneralRe: Csv File Compare Pin
led mike2-Nov-07 11:11
led mike2-Nov-07 11:11 
GeneralRe: Csv File Compare Pin
Brady Kelly3-Nov-07 15:39
Brady Kelly3-Nov-07 15:39 
GeneralRe: Csv File Compare Pin
egottwald6-Nov-07 2:52
egottwald6-Nov-07 2:52 
GeneralRe: Csv File Compare Pin
Brady Kelly6-Nov-07 3:13
Brady Kelly6-Nov-07 3:13 
QuestionComposed Business Objects Pin
Pawel Krakowiak29-Oct-07 4:32
Pawel Krakowiak29-Oct-07 4:32 
Hi!

I wasn't sure whether to post this in ASP.NET or Design and Architecture forum, but decided to land it here after all as I believe the same would apply to a WinForms app or even a web service.

I am working on an ASP.NET 2.0 project, this is my first attempt at a real multi tier architecture, before I was just binding a DataSet to my WebForms directly. I have a DAL, a BLL and an UI. All is fine, they work well together, but I came to the point where I need to display some reports in a GridView and my grasp of business layer started to fall apart. Wink | ;)

Look, the project is about embeddable web widgets, every widget belongs to some user. I have (among others) some classes in BLL (they communicate with DAL for CRUD and other database operations, BLL does not know anything about the database):

1. WidgetsBLL - this class 'manages' Widgets. You can create new widgets here, retrieve all widgets, retrieve widgets belonging to a particular user, etc.

2. Widget - this class represents a particular widget. It knows the widget's URL, clickthru count, theme and so on.

3. UsersBLL - same as WidgetsBLL, just deals with Users.

4. User - represents a user, stores data such as first & last name, e-mail address, etc.

It all worked great so far, but now I came to the point where I must display combined data in a GridView. I need data from Widget class (such as widget's ID, name and clickthru count) as well as owner's data from User class (first & last name, e-mail). Now, this data cannot be retrieved from a single class as you can see. I need to get a Widget instance, then get a User instance and display a list of rows which are built from those two classes, so the GridView needs columns such as:

Widget.WidgetId | Widget.WidgetName | User.LastName | User.Email

I am not sure what one should do to solve such problem, I don't have experience with this kind of architecture. I might just create a new class (WidgetStats?) - this seems like the easiest approach, but somehow it looks like bad design to me, because widget statistics is not a real object - it looks kind of artificial, doesn't it?

What is the best way to return an object composed of other objects? I began by calling WidgetsBLL.GetWidgets() and binding the result to the GridView. Then I can have TemplateFields and retrieve for example user's e-mail. But what about sorting in this scenario?!

Please, help. I have been trying to work this out for two days. Sigh | :sigh:

Kind regards,
Pawel Krakowiak

AnswerRe: Composed Business Objects Pin
led mike29-Oct-07 5:15
led mike29-Oct-07 5:15 
GeneralRe: Composed Business Objects Pin
Pawel Krakowiak29-Oct-07 5:22
Pawel Krakowiak29-Oct-07 5:22 
GeneralRe: Composed Business Objects Pin
led mike29-Oct-07 6:15
led mike29-Oct-07 6:15 
GeneralRe: Composed Business Objects Pin
Pawel Krakowiak29-Oct-07 6:36
Pawel Krakowiak29-Oct-07 6:36 
GeneralRe: Composed Business Objects Pin
led mike29-Oct-07 7:58
led mike29-Oct-07 7:58 
AnswerRe: Composed Business Objects Pin
Mark Churchill30-Oct-07 19:00
Mark Churchill30-Oct-07 19:00 
GeneralRe: Composed Business Objects Pin
Pawel Krakowiak30-Oct-07 22:11
Pawel Krakowiak30-Oct-07 22:11 
GeneralRe: Composed Business Objects Pin
led mike31-Oct-07 4:56
led mike31-Oct-07 4:56 
GeneralRe: Composed Business Objects Pin
Pawel Krakowiak31-Oct-07 5:08
Pawel Krakowiak31-Oct-07 5:08 
GeneralRe: Composed Business Objects Pin
led mike31-Oct-07 5:36
led mike31-Oct-07 5:36 
GeneralRe: Composed Business Objects Pin
Pawel Krakowiak31-Oct-07 7:54
Pawel Krakowiak31-Oct-07 7:54 
GeneralRe: Composed Business Objects Pin
Mark Churchill31-Oct-07 18:09
Mark Churchill31-Oct-07 18:09 
GeneralRe: Composed Business Objects Pin
Pawel Krakowiak1-Nov-07 4:16
Pawel Krakowiak1-Nov-07 4:16 
GeneralRe: Composed Business Objects Pin
Mark Churchill1-Nov-07 16:20
Mark Churchill1-Nov-07 16:20 
GeneralRe: Composed Business Objects Pin
Pawel Krakowiak1-Nov-07 23:41
Pawel Krakowiak1-Nov-07 23:41 
GeneralRe: Composed Business Objects Pin
Mark Churchill2-Nov-07 1:50
Mark Churchill2-Nov-07 1:50 
GeneralRe: Composed Business Objects Pin
Pawel Krakowiak2-Nov-07 2:01
Pawel Krakowiak2-Nov-07 2:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.