[Kde-bindings] PerlQt constructor syntax

Gary Greene greeneg at tolharadys.net
Tue Jun 2 15:14:38 UTC 2009


On Tuesday 02 June 2009 06:11:56 am Jonathan Yu wrote:
> Hi:
>
> Unfortunately, maintaining the existing API isn't something we can do,
> because the current API wasn't considered for forward compatibility.
> If we keep the existing API as-is, we will be breaking Perl best
> practices. (For example, see the discussion about the whole Blah->new
> versus Blah(...) constructors)
>
> The existing API is seriously broken and should be considered deprecated.
>
> What we might be able to do is provide a separate compatability API
> that will emulate the old style. However, maintaining the earlier API
> is bad for CPAN in general and will confuse people familiar with Perl
> coding.
>
> Definitely, we are trying to work with Ashley Winters to get the
> namespace transferred to us; however until such a time as we hear back
> from him, we cannot release anything under the Qt namespace on CPAN
> (the PAUSE Indexer will simply mark the release as UNAUTHORIZED and
> people will be unable to install it without typing the full path to
> the file, ie, F/FR/FREQUENCY/Qt-4.tar.gz)
>
> The Qt4 API is still awhile away from completion. Consider this
> advance notice that there are significant changes afoot, and while we
> understand that some people may have applications that use the Qt3
> API, it's not a reason to freeze the API as-is. Consider what would
> happen if HTML was frozen at the version 1.0 style to maintain
> compatibility with older parsers. At some point, change needs to
> happen, no matter how painful it is (we'll try to make this as
> painless as possible; but given the amount of time that has elapsed
> between Ashley's Qt modules and the current version, it's unlikely
> even Qt itself has a similar enough API for us to maintain
> compatibility that far back. Qt3, however, might be okay)
>
> Definitely, though, users of previous versions of software are always
> a consideration. We will try our best to provide a clean upgrade path
> and I would encourage you to proffer your input there. I'm happy to
> try to accommodate your needs, but I feel we have to balance that with
> the current generally accepted best practices of CPAN/Perl modules,
> not to mention the progress we have made in computer science itself
> over the past decade or so.
>
> Here is what I am thinking about as of right now, which should give
> you a decent upgrade path. The previous code being something like:
>
> use Qt;
> my $button = Qt::PushButton();
> .. etc
>
> You would get something like:
> Use Qt4::Compat;
> my $button = Qt::PushButton();
> .. etc
>
> Thus, the only line of code you'd need to change, is to load the Qt4
> Compatibility API rather than the Qt3 stuff. It will try to provide as
> close an emulation of the old style, without breaking too many things
> (there are some limitations like what the CPAN indexer will put up
> with; and we cannot override the modules previously uploaded by Ashley
> et al. unless they delete them from CPAN, or at least transfer
> namespace ownership over to us). So far the latter is pending.
>
> I'd like to hear what you expect the API to be like, or perhaps to
> give us a snippet of code you use, so that we can create a
> compatibility API around that. Does that sound fair?
>
> Cheers,
>
> Jonathan

Take a look at the SVN repository for AI (AltimatOS Installer) at 
http://svn.tabris.net/repos/ai/branches/perl/ with attention to ai.pl and 
AltimatOS/Installer/*.pm and AltimatOS/CuteDisk/*.pm. It'll give you an idea 
of what I mean. Note that it uses the KDE module too for KDE3, but the idea 
is the same since both are interrelated in the PerlQt3 package and share the 
same syntax.

-- 
Gary L. Greene, Jr.
Sent from: peorth.tolharadys.net
 08:01:58 up 29 days, 28 min,  4 users,  load average: 0.63, 0.60, 0.54
==========================================================================
Developer and Project Lead for the AltimatOS open source project
Volunteer Developer for the KDE open source project
See http://www.altimatos.com/ and http://www.kde.org/ for more information
==========================================================================

Please avoid sending me Word or PowerPoint attachments.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20090602/8933c714/attachment.sig>


More information about the Kde-bindings mailing list