posted 14 years ago
Hi, this is Tom and this is my first post on here so be gentle!!
I am trying to learn Object-Oriented Programming - the *right* way - and am struggling to take boring textbook examples and actually apply OOP to the real-world!
It seems to me that a lot of tutorials and people online just dump a whole bunch of procedural code inside of of few Classes and call that OOP?! But that doesn't seem like much of an improvement over, say, 1980's BASIC?!
So my first question deals with what is the best way to model "business processes" in OOP?
Most examples online just create a gigantic Class with dozens of Methods, but that seems like an over simplification of how the real-world works.
For example, here are some "business processes" in real-life...
- File an Insurance Claim
- Book an Airline Reservation
- Register with Online Forum
- Transfer Funds between Accounts
- Change Deductible Amount
- File Initial Unemployment Claim
Each of those random examples would likely involve many steps and even deal with other Objects, so I don't think making any of them a single Method in a single Class would be a good idea unless you want spaghetti code?!
I have seen a few people turn "business process" into what they called a SERVICE, but I would be curious to hear other people's opinions on this.
And after some people respond, maybe I can talk more about the website I'm building and my thoughts on what Classes to create?
Sincerely,
TomTees