Looking for opinion on code size for presention tier asp.net application.

J

JollyK

Hello everyone...
I have created a user-control that has a fairly complex datagrid (with
template columns) which includes localization, custom paging, sorting,
filtering, searching, caching, options to add, edit, and delete record, and
then enabling and disabling links inside the datagrid based on different
conditions. Everything is working fine now. I have hand-coded everything and
the total length of my code-behind file is around 1900 lines. My code-behind
file contains only presentation logic. No other code is there in my
code-behind file. Data-access logic and business logic code are totally
seperate and are located in different assemblies. My code-behind file
doesn't even contain designer code. All designer code are in the ASCX file.
So my question is, is 1900 lines of code too large for presentation tier
code ? I have to admit, there is also a fair amount of comments in the code
to describe what I am doing. Also in the future, the size of this file will
increase, cause I will have to implement some security features. Well there
would be a seperate "security library" but my code will have to access it,
so additional lines of code will be added.


I will really like to hear from senior programmers and what you have to say
about this. I am just worried, is this a bad thing that my presentation tier
code is turning out to be so large ? I really don't know what to do cause
there is so much logic on my presentation tier that I need to implement.

Really looking forward for some opinions.

Thanks

JK
 
G

Guest

My understanding is, as long as your presentation logic can be easily decopled from your business logic and any other tiers, then you are fine. The size of the actual presentation code shouldn't make a difference, Its how couples or tied it is to other tiers; the less the better

Rasika Wijayaratne
 
K

Kevin Spencer

There may be some things you can do to "lighten the load" in your page.
First, is all of this functionality necessary in a single page, or can you
split it out into more than one smaller page? For example, you say that this
page has functionality for adding, editing, and deleting records. This could
be split into 3 different pages. Can you do any dynamic loading of controls?
In other words, are all the controls in the page used for every Request, or
is a smaller subset of controls loaded depending upon conditions? By making
controls that are not always needed to load dynamically, you are not loading
them when you don't need them.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
J

JollyK

Thanks for your input. I am just wondering, is it unusual to have
presentation tier code going above 1900 lines of code. :-(
 
K

Kevin Spencer

Unusual? I couldn't answer that, as I'm not aware of any statistics. It is
certainly unusual from my own experience. However, it is not necessarily
beyond the bounds of what is appropriate under the right circumstances.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

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

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top