advertisement

Forum => Maximizing ASP.NET: Real World, Object-Oriented Development => I might be jumping ahead...

Jump to:

Next Oldest | Next Newest

8/12/2005 1:20:27 PM Link | Reply | Edit | Quote

Mikener

Profile Send Private Message Send E-Mail
Location: | Joined: 8/12/2005 | Posts: 16 | Offline

Based on a response you gave me in at another sites forum, I decided to purchase your book (I got it last night). So I know that I am jumping ahead of myself with this question, but here goes.

You mention a Customer class that gets/sets data in a database. I would assume then that this class is part of your data layer and that it does not contain any business logic.

Does this mean that the Customer class represents a Customer database table and that Customer specific Logic might be in another class that is part of the Business Layer?

In other words should I create a CustomerDB class that handles all of my Customer Database Logic and a CustomerBL class that contains business Logic for a Customer?

Would these two classes be independant of each other or would the CustomerBL class contain a reference to he CustomerDB class?

Normally I would wait to finish the book as a way to get these answers, but unfortunately I am in the process of designing a new system at work and no one (including me) has any experience using ASP.NET, C# and OO technologies (we are all old time structured programmers).

Thanks

8/12/2005 3:26:06 PM Link | Reply | Edit | Quote

Jeff

Profile Send Private Message Send E-Mail Web Site AOL Instant Message Yahoo Instant Message ICQ Message
Location: Cleveland, OH, USA | Joined: 8/15/2000 | Posts: 813 | Offline

To answer all of your questions at once, it depends entirely on how you want to design the class. In smaller applications (which we so frequently build for the Web), I frequently combine the data access and business logic into a single class. There just isn't enough meat to justify the extra work for these smaller apps.

I'm sure that doesn't help. Academics and programmers like to live in a world of absolutes, but I don't personally like to do that. If you've got a huge application, it makes sense to break out data and logic to keep you focused, make the app more maintainable, have cleaner unit testing, etc. It just depends on what your goals are.


Jeff 'Jones' Putz
POP World Media, LLC
Maximizing ASP.NET

8/12/2005 3:36:30 PM Link | Reply | Edit | Quote

Mikener

Profile Send Private Message Send E-Mail
Location: | Joined: 8/12/2005 | Posts: 16 | Offline

Actually that does help. Frankly, your sentiments mirror mine. Theory and practice don't always mesh. I have been told by some of my Java buddies that you must use 3-5 tiers when building systems. From my point of view, this type of absolute can sometimes create more work then it saves. Unfortunately I don't have enough experience at this point to know if I am making poor design decisions.

Thanks

8/12/2005 5:48:00 PM Link | Reply | Edit | Quote

Jeff

Profile Send Private Message Send E-Mail Web Site AOL Instant Message Yahoo Instant Message ICQ Message
Location: Cleveland, OH, USA | Joined: 8/15/2000 | Posts: 813 | Offline

I agree that your Java buddies are full of it. Two examples...

I needed to put together a simple content rotation system for a client. It's a couple hundred lines of code at most. I built a small class library that puts data access and logic into container classes, much like chapter 5 of my book.

On the other hand, I'm architect and chief code monkey on a huge project, and things are split up quite a bit. The data access code is set up in a provider-ish model, all in its own class. Logic and rules are handled by another class library. Then there's a layer of Web services that some Windows apps access, wrapping the logic stuff. The Web app accesses the logic stuff directly. We have a suite of unit tests (written first) that test all of the above. There's also a print service at the client that hits the database to get print jobs. It's huge!

But going back to the first example, would I really need all of that complexity from the second example? Of course not.


Jeff 'Jones' Putz
POP World Media, LLC
Maximizing ASP.NET

8/12/2005 6:59:13 PM Link | Reply | Edit | Quote

Mikener

Profile Send Private Message Send E-Mail
Location: | Joined: 8/12/2005 | Posts: 16 | Offline

Thanks. I can't wait to read your book. I have a feeling that I will enjoy it.

Forum => Maximizing ASP.NET: Real World, Object-Oriented Development => I might be jumping ahead...

Please login or register to post.