Re: Architetural Decisions

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Bruno Rodrigues" <BrunoRodrigues@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:377A4C2C-8E60-42F8-B26D-FC599E7701BD@xxxxxxxxxxxxxxxx
> Hi,
>
> I'm on my way to my first OOP-for-real project in C#, and having some big
> trouble with code architeture.
<snip>
> A snapshot from my database:

Did you just say OOP-for-real and then describe the design problem by
telling us about your database structure?

<snip>

> What I need, is to compute the total of an individual OrderDetail, and of
> the entire order. I create this total fields with sum in sql, the fastest
> way, and it's working nice.
>
> But... This calc is bussiness logic, and it should be in my "Classes"
> namespace, isn't that right? Cause if I have some special discount to
> apply,
> for example, I'm in trouble. But, the only way to do this logic in the
> "Classes" namespace, is looping through each object of the collection I
> have
> already created - this sucks.

If looping through a collection sucks then there are a lot of sucky
applications out there. And when an order item changes and you have still
not persisted this change back to the database, how were you planning on
getting the updated order total?

> What concept I am misleading? What should I do?

OOP like you said you were doing

SP


.



Relevant Pages

  • Re: subjunctive mood and Microsoft
    ... Imagine a book laid out on top-posting principles. ... and it gets tedious if they don't snip at all. ... > it is more trouble than it is worth to mark the current ... > message as unread, display all messages, find the unread one, and ...
    (microsoft.public.word.application.errors)
  • Re: Why C is really a bad programming language
    ... A 30-year mortgage schedule is already in ... shorter-term projections are going to start ... running into trouble in the not-to-distant future. ...
    (comp.lang.c)
  • Re: KSER Regional Rep (was Re: Even bigger problems at BN ?)
    ... this very newsgroup that BN was in trouble: ... Naturism in the UK [snip] We need a new regime, ... of 2005 saw Bn nearly go bust. ... symptom of a wrong approach than the fundamental problem. ...
    (uk.rec.naturist)
  • Re: Yo Greasy Rider.
    ... This guy doesn't look like he'd have too much trouble. ... Mr. Remington will be ... handy until I know the final disposition. ...
    (rec.motorcycles.harley)
  • Re: Architetural Decisions
    ... > I'm on my way to my first OOP-for-real project in C#, ... While I cant evangelise design patterns there are some very ... interesting perspectives there that are well worth adding to your ...
    (microsoft.public.dotnet.languages.csharp)