|
While a COM or similar interface may result in a library which makes
porting easiest for new platforms, it sometimes can be harder to
develop and maintain. We've been there and I can say that in some cases
a COM-like interface really is nice to work with; and in other cases it
is perhaps too problematic to maintain. The Mozilla people initially
went a little overboard with this and decided it would be better to
scale it back somewhat. For me, while it would be nice if everything could fit into a plug-in interface, in the short run I would be happy if platform-specific functionality was sometimes handled less by ifdefs within the code and more via some kind of platform or environment abstraction. Here's an example; in _javascript_Core/kjs/Shell.cpp there is this: void StopWatch::start() { #if PLATFORM(QT) QDateTime t = QDateTime::currentDateTime(); m_startTime = t.toTime_t() * 1000 + t.time().msec(); #elif PLATFORM(WIN_OS) m_startTime = timeGetTime(); #else gettimeofday(&m_startTime, 0); #endif } For me to add a new platform I need to edit this file and do an integration whenever the devline WebKit version of it changes. It would be nice if the code instead looked like this: void StopWatch::start() { m_startTime = platformTimeMs(); // The back-end of this is specified per platform. } Yes you could call platformTimeMs() via a function table or COM interface, but for a lot of people it would suffice if it was simply implemented in a platform-specific source directory. Paul On Wed, Oct 15, 2008 at 12:04 PM, lkcl <[EMAIL PROTECTED]> wrote:what is there about, for example, the apache2 vector table system, where you fill in 28 or so functions in a vector table and hand it back to the apache runtime, that makes refactoring and redesign difficult? |
_______________________________________________ webkit-dev mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

