Re: OOP slow -- am I an idiot?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Stut" <stuttle@xxxxxxxxx> wrote in message 
news:452F5447.1060205@xxxxxxxxxxxx
> Tony Marston wrote:
>> "Stut" <stuttle@xxxxxxxxx> wrote in message 
>> news:452ED193.8080707@xxxxxxxxxxxx
>>
>>> My general approach to designing a system is data-centric. I tend to 
>>> start by defining the database schema since getting that clear in my 
>>> head tends to lead me to a decent design.
>>>
>>
>> What a coincidence! That's exactly my approach, but I've taken it one 
>> step further. I always start with a properly normalised database which I 
>> can then import into my daa dictionary application. From there I can 
>> press a button and create a class file for each database table, and I am 
>> ptting the finishing touhes to a procedure whereby I can press another 
>> button to generate the scripts which will maintain each table. This means 
>> I can get basic transactions up and running without writing a single line 
>> of code. All I have to do is edit these files to include business logic 
>> and any customisations.
>>
>> This level of automation is not possible with some people's OO 
>> implementations, so I can only conclude that their approach is not the 
>> optimal one.
>>
>
> Youch!! Your implementation seems to be focused on development efficiency 
> rather than runtime efficience.

Precisely. That is why I said it was adminstrative web applications which 
typically have far fewer users than web sites.

> In all but rare research projects this is backwards for a web-based 
> system.

Wrong again. This is for administrative web applications, the type that were 
previously built as desktop applications. Their function is to get data into 
and out of a database i.e. CRUD applications), not to serve thousands of 
casual vuisitors.

> This is exactly the practice I am trying to discourage. It's a well-known 
> fact that code generators are a poor substitute for real developers.

It depends how you go about it. My code generators fulfil the basics, then 
the programmer's job is to customise it.

>>> For most projects I don't start out with OOP in mind, but my brain is 
>>> used to building OOP-style systems so nearly everything I do ends up 
>>> with a few classes.
>>>
>>
>> The difference with me is that I don't waste my time with trivial 
>> websites, I concentrate on administrative web applications. But even when 
>> I wrote the code for my own website at http://www.radicore.org I still 
>> used all my database classes as it was far easier than doing it the 
>> traditional old-fashioned way
>
> Trivial websites are where you can get away with using code generators. 
> For anything non-trivial I would not feel comfortable with a 
> jack-of-all-trades-master-of-none-style of code. Now that I think of it 
> I'm quite anal about the quality of my code, so I don't think I'd ever use 
> a code generator - never have before.

I have never liked any of the code generators I have seen created by others, 
but with my general-purpose framework I noticed that a lot of the code that 
I was generating by hand followed a familiar pattern. It was then a simple 
exercise to write a program to generate this same code on command.

Be aware that I am not attempting to generate *all* the code that an 
application will need, just the basics to  get it functioning. This takes 
all the drudgery out of the job and leaves the programmer to do the 
interesting bits.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux