help designing my classes

G

Guest

hey all,
i have a very simple asp.net application and i'm trying to decide where my
methods should reside in an n-tier context.

i have 2 classes:
BusinessLayer.cs
DataAccess.cs

all the application does is it goes to a database to populate my datatable
and then i dynamically populate an html table from that.

so far, i pass the html table to the businesslayer class which then gets
dynamically populated by a data table. the data table was populated thru the
dataaccess class. all the methods are static.

i could not decide whether the methods that dynamically populate the html
table should go in the ui layer, business layer, or data layer?

would this design also be automatically suitable for remoting?

general suggestions are also welcomed.

thanks,
rodchar
 
A

Anthony Jones

rodchar said:
hey all,
i have a very simple asp.net application and i'm trying to decide where my
methods should reside in an n-tier context.

i have 2 classes:
BusinessLayer.cs
DataAccess.cs

all the application does is it goes to a database to populate my datatable
and then i dynamically populate an html table from that.

so far, i pass the html table to the businesslayer class which then gets
dynamically populated by a data table. the data table was populated thru the
dataaccess class. all the methods are static.

i could not decide whether the methods that dynamically populate the html
table should go in the ui layer, business layer, or data layer?

Since the purpose of HTML is to describe how data should be presented then
HTML belongs in the UI layer. Your business object shouldn't have any clue
about HTML.
would this design also be automatically suitable for remoting?

general suggestions are also welcomed.

Another option is to take XML from the Business layer (this could be the XML
that underpins a strongly typed dataset) into the UI layer which uses XSL to
transform to html.
 
G

Guest

thank you for the discernment.
rod.

Anthony Jones said:
Since the purpose of HTML is to describe how data should be presented then
HTML belongs in the UI layer. Your business object shouldn't have any clue
about HTML.


Another option is to take XML from the Business layer (this could be the XML
that underpins a strongly typed dataset) into the UI layer which uses XSL to
transform to html.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top