Re: Is this too much OOP?



Op 20 Sep 2006 14:15:52 -0700 schreef needin4mation@xxxxxxxxx:


Hi,

Beginner OOP Question.

I wanted to know if real designers that know OOP - that really use it
to create applications - use the models found in books.

Sure. Even worse: I use code and libraries of other people and also
their thoughts. The most usefull things for me are analogies from
other domains, but I guess that depends on your way of thinking(
divergent/convergent for instance)

For example, I am writing a web application with asp.net c#. It will
handle employee data. In books I usually see the example that there is
a base employee class. From that class, a specialization is done when
a Manager or line staff employee derives from the employee class.


From what you say here I wouldnt hesitate to say: bull. The simple
fact that your application will "handle" employee data doesnt tell me
*anything* about the design. Apriori overemphasizing of inheritance
is the best way to screw every design effort before it really starts.
If you really look at the good books and patterns in which you can
find "employee" objects you wll find significant behaviors attached.
Those are the clue to the design solution.

Since I am not that great an OOP programmer and probably have a lot of
jumbled code, I wanted to know if it was too much for me to really
write web apps using this model. Would someone really create an
Employee class that held say, lastname, firstname, ssn, etc. and have
methods to insert that name into the database, update and and delete?


Another problem with webapplications is its stateless nature which
doesnt collobarate very fine with the OO way of doing things( keeping
state and behavior together). If we talk about .net apps specifically
then I would for this 2 tier application strongly suggest to use the
datamodel apprioach inherent in the webservice architecture.

Now I just have a page that handles it. Granted the page could be
considered a class, but it is not really encapsulated and I don't
believe it would really ever be instantiated or referenced from other
pages.

You are absolutely right and you could add to that the fact that the
database ALSO has this kind of datarelations. Why in heavens name
duplicate it ?

I guess I've never seen real programming code that was "good." My
stuff works, doesn't break, but I know something is "wrong" with its
design. Thanks for any thoughts.

You might explore that feeling a little bit more. Is there really
something "wrong " ? In what circumstances do you feel that way about
that code ? In what kind of situations you wish you had done it
differently ?

Rick
.



Relevant Pages

  • Re: Database Design & Normalization Question
    ... understand the logic behind the books, videos, software, ... didn't have to change the database design to store new ...
    (microsoft.public.sqlserver.server)
  • Re: MVC design questions
    ... Instead of a single CRUD GUI program I've got two, the idea being that one can be given to anybody because it can't damage the database (no insert/update/ delete capability at all while the other, which can do these things, is intended only for suitable authorised users: most data is bulk loaded and the update GUI is only there for removing to odd piece of junk and tidying up. ... In fact, i'd create three - a full-access account for the DBA, an account with the ability to edit the data, but not do DDL, for the update app, and a read-only one for the search app. ... I have almost no OO background and have no idea who the currently recognised OO design gurus are. ... That era was dominated by big ideas - big processes, big notations, big books, big words. ...
    (comp.lang.java.programmer)
  • Re: Database design
    ... On my single table database I have 28 categories and ... Jason's design is much preferable. ... Contacts who qualify for SAY; ... I have three books that cost me over $500 and none cover this topic! ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Is this too much OOP?
    ... to create applications - use the models found in books. ... a base employee class. ... a Manager or line staff employee derives from the employee class. ... is the best way to screw every design effort before it really starts. ...
    (comp.object)
  • Re: I want to learn access
    ... up the database properly. ... > CDs that assume that you know how to design forms, tables, etc, which I ... All the books that I have seen on ... I am even ready to preapre applications for people ...
    (microsoft.public.access.gettingstarted)