Just how many lines of code in a Code Behind Page are too much?
I have seen thousands and thousands of lines of code in a business tier as
well, I see no difference.
I would also like to know the actual business SET of rules where this would
happen for each and every single web page.
I can think of only a few cases(i.e. web pages) where this might be,
(1.) Placing an order for like a shopping cart
(2.) Credit approval
(3.) Insurance approval
But that's it.
I see no reason to put the (1) login or (2) search (3)Order Details or the
rest of the web site all in a business tier.
People talk about these "so-called" business rules as if it's in every
single page of the web site. yet that's not true and only increases the
complexity of the web site.
[color=blue]
> It is just easier (well, for some of us, at least :-) to work with[/color]
logically[color=blue]
> separated parts of code - this one works with the database, this one[/color]
handles[color=blue]
> business rules and that one renders user interface.[/color]
Can you explain, "just why is it easier"? Like is there some feature I am
missing? I coded more pages and sites than any of the top coders I know,
database, business logic and all and possibly more than all of them put
together.
What about all the time you spend trying to figure out grey area rules?
Like is this really in this layer or that layer, or is it really a little
bit of both. And then trying to Later figure out where it is 2 months from
now.
"Dmitriy Lapshin [C# / .NET MVP]" <x-code@no-spam-please.hotpop.com> wrote
in message news:ecSn6nXZDHA.2960@tk2msftngp13.phx.gbl...[color=blue]
> Hi,
>
> Multi-tier architectures proved to be reasonable for considerably big
> projects where they facilitate maintenance and further development (have[/color]
you[color=blue]
> ever tried to debug a huge code-behind class with thousands of lines of
> code?).
>
> It is just easier (well, for some of us, at least :-) to work with[/color]
logically[color=blue]
> separated parts of code - this one works with the database, this one[/color]
handles[color=blue]
> business rules and that one renders user interface.
>
> By the way, the "business logic" tier, in my opinion, is reasonable only
> when there are many complex business rules to enforce. This tier can be
> omitted for web sites that merely store and display data, but do not[/color]
perform[color=blue]
> any sophisticated data processing.
>
> As for switching the databases...well..I would agree that it happens with
> very low probability, but if that happens and all your database code is
> spread across the code behind - long boring hours of monkey job are
> guaranteed.
>
> --
> Dmitriy Lapshin [C# / .NET MVP]
> X-Unity Unit Testing and Integration Environment
>
http://x-unity.miik.com.ua
> Deliver reliable .NET software
>
> "nospam" <n@ntspam.com> wrote in message
> news:#lGPJeXZDHA.1640@TK2MSFTNGP10.phx.gbl...[color=green]
> > Reasons for a 3-tier achitecture for the WEB?
> > (NOTE: I said, WEB, NOT WINDOWS.
> >
> > DON'T shoot your mouth off if you don't understand the difference.)
> >
> > I hear only one reason and that's to switch a database from SQL Server[/color][/color]
to[color=blue][color=green]
> > Oracle or DB2 or vice versa... and that's it.... And a lot of these
> > enterprises don't need it as they already know what database they are[/color]
> going[color=green]
> > to use and they don't plan on switching in and out database in the first
> > place, NOR can they afford to in the first place
> >
> > Nobody switches databases everyday yet Microsoft and MVP's are[/color]
> recommending[color=green]
> > these so called best practices for every single .NET implementation for[/color]
> the[color=green]
> > enterprise or the mom and pop....Sort of like Windows Advanced Server[/color][/color]
and[color=blue][color=green]
> > Windows Server....everybody's got to have Advanced server on their
> > LAPTOP.....
> >
> > I mean come on. Let Microsoft fix their own stuff FIRST before[/color]
> recommending[color=green]
> > any best practices.
> >
> > Also see no reason to have a business logic tier as that can be easily
> > contained in the code behind.
> >
> > QUESTION OF THE DAY:
> > I would really like to know, who's idea it was to have 3-tier[/color][/color]
architecture[color=blue][color=green]
> > for .NET Web Pages. All I see is a carry over of practices from DNA[/color][/color]
using[color=blue][color=green]
> > COM and .asp pages.....
> >
> > 3-tier is using the same OLD broken tools when a new technology, .NET,[/color]
> that[color=green]
> > has better and more simplier ways of doing things.
> >
> > I say there is some hidden motive (like job security) for making things[/color]
> more[color=green]
> > complicated and LESS performing when using 3-Tier or N-Tier.
> >
> > There are a LOT of mind-numb robot MVP's and Microsoft employees who[/color][/color]
never[color=blue][color=green]
> > question if a particular and well-entrenched way is the best way.......
> >
> > It's been 2 years and Mr. Bill is still saying things are going[/color][/color]
slow.....I[color=blue][color=green]
> > wonder why......
> >
> >
> >
> >
> >
> >[/color]
>[/color]