Re: Poly Couples



topmind wrote:
Fine. Oop is great for device drivers (like print drivers above),
animals, and shapes. But can we pleaaaaaase get something that reflects
what real people see in the real workplace? The vast majority of

Um, drivers are prety real life example, just as any other "non custom business software" example mentioned in this thread (sorry for nitpicking).


In my fairly limited experience, we had following stuff:

1) Paralel versions of essentially same application.
There were medium to large variations in look&feel (but not in the data being edited on the forms), the business part was the same, but some features were enabled in some versions.

2) Business validation and reporting the invalid data
Essentially we had 4 levels of business rules and 4 different situations of presenting them, where situations do not map to the levels. I.e. in every possible situation some subset of rules (based on levels combinations and the current context) would be executed over the current state of data.
BTW. it was required that data is not always persisted, that is - when user is on the form, the control contents is not suppose to be stored. However the rules had to be executed over this "in memory" data. The rules also had to be executed over the persisted data.

3) The data is highly hierarchical, as presented in the UI. Logically, some actions on the higher level can affect some or all parts of the subtree.

4) Some simple DSL exists to enable non programmers, domain specialists, to manage validation rules, dynamics of the hierachy (when should some elements appear/disappear depending on the user input).

5) There are ca. 700 input dialogs. Some of those appear more than once in different contexts (same form, for editing different data). Some are dynamic in the sense that they can appear zero, once or any number of times, depending on user input.

There is not OO model such as employees, orders, order items, ... Rather, there is a metamodel which describes the hierarchy. The leafs map to data either entered by user or computed. There is small engine which evaluates the metamodel and performs significant actions (transfering data to database, evaluating rules, showing/hiding UI elements depending on the user input). The "engine" is implemented in OO. It is not complex, but there were couple of occasions where polymorphism fit nicely.

6) Metamodel is stored in SQL, however, the data is stored in non relational database (essentially flat files).
It is the mid term goal that the database (for the data) gets changed. Admittedly, the original selection of database was poor, in addition the database dependent statements are all over the code (and not just the engine), and it will be fairly painful to replace it.

I'm definitely OO biased (influence of my education), and came to this system when it was already shaped. It is my belief that OO is good for managing such complex stuff, much more appropriate and useful than something procedural. It doesn't amount only to polymorphism, but rather to the whole process of creating small, independent, reusable modules which are easy to understand, maintain and improve. When good designed, the changes usually do not ripple accross the entire system, and I feel much less paranoic when editing the code. It is also easier for me to analyze the code. We worked in fairly high paralelised mode, due to strict interfaces and separation of concerns, we managed to work independently and integrate without significant problems.

I'm willing to give the benefit of the doubt that OO is not optimal, but I still fail to see the arguments coming from the hard OO critics.

Other than that the case for polymorphism (which to me means programming to interface and varying implementations) would be unit testing - you want to test a module and want the test to fail only if there is error in that module and not in any other on which it depends.

As for swapping databases, I already mentioned in some other thread the contrived example - imagine writing the application for one bank, now imagine you want to sell it to some other bank. The business process is essentially the same, the existing UI is perfectly fine. However, they insist that you use their existing database which is from a different vendor, and the structure is different than the one you use originally.

Well, this was somewhat unstructured (sorry), but I hope it does shed some light on my thinking process. Any feedback is appriciated.

Sasa
.



Relevant Pages

  • Re: Ms Access 2003
    ... employees to build a database application or use their department budget to ... I find that some businesses will pay, ... a small business which employs five consultants. ... when I was a corporate Access developer for a little more than a year. ...
    (comp.databases.ms-access)
  • Re: polymorphism (was: Poly Couples)
    ... but this is not really "business software"... ... Most of such applications are built as a combination of ... database with flat files or a different RDBMS vendor?" ... couldn't care less if I do it in using structured programming or OOP ...
    (comp.object)
  • Re: How should I generate a primary key?
    ... Obviously the designer did not get all of the business rules from the ... Should the database ... A Work Order records the transaction of a truck service at a given ... This has got nothing to do with bad design, it is about the developer trying ...
    (comp.databases)
  • RE: BCM for Outlook 2K3 vs Dynamics CRM SB edition (v.3) on SBS2K3
    ... with other users who are on different computers in BCM version 1.0. ... To share BCM database, you can refer to the following steps. ... you may refer to Business Contact Manager Help. ... Verify the connection between the Microsoft Firewall and the BCM ...
    (microsoft.public.windows.server.sbs)
  • Re: Data Layer architecture
    ... > the first week of>> any serious database course). ... rules were described to be inside the RDBMS, ... is not a theory which states anything about business ... > The Relational Model is nothing but a direct application of set theory ...
    (microsoft.public.dotnet.languages.csharp)