How do you keep application logic separate from UI when UI components have built-in functionality?

Posted by Al C on Stack Overflow See other posts from Stack Overflow or by Al C
Published on 2010-04-20T20:39:17Z Indexed on 2010/04/20 20:43 UTC
Read the original article Hit count: 222

I know it's important to keep user interface code separated from domain code--the application is easier to understand, maintain, change, and (sometimes) isolate bugs. But here's my mental block ...

Delphi comes with components with methods that do what I want, e.g., a RichText Memo component lets me work with rich text. Other components, like TMS's string grid not only do what I want, but I paid extra for the functionality. These features put the R in RAD.

It seems illogical to write my own classes to do things somebody else has already done for me. It's reinventing the wheel [ever tried working directly with rich text? :-) ] But if I use the functionality built into components like these, then I will end up with lots of intermingled UI and domain code--I'll have a form with most of my code built into its event handlers.

How do you deal with this issue? ... Or, if I want to continue using the code others have already written for me, how would you suggest I deal with the issue?

© Stack Overflow or respective owner

Related posts about oop

Related posts about beginner