Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 851F1D0E7 for ; Fri, 23 Nov 2012 00:00:32 +0000 (UTC) Received: (qmail 66288 invoked by uid 500); 23 Nov 2012 00:00:32 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 66253 invoked by uid 500); 23 Nov 2012 00:00:32 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 66244 invoked by uid 99); 23 Nov 2012 00:00:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Nov 2012 00:00:32 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.215.179 as permitted sender) Received: from [209.85.215.179] (HELO mail-ea0-f179.google.com) (209.85.215.179) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Nov 2012 00:00:25 +0000 Received: by mail-ea0-f179.google.com with SMTP id i12so1177547eaa.10 for ; Thu, 22 Nov 2012 16:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/Lloxjnpk6S3CtuqTB5BhS2km1+ffQdoFgNmVFS62a4=; b=zS+hbQSnVamBBanA+wzX5STnx1u80o/XLjjtxPxXNoYKfw+IUsmwI08RnSs7GW27Bu MnVhQPLjQ9PLMgXik8SHsVL5JWeziAKXCGjE88IuUixkvsMf3ee89PF+XFk8jWSnvdZm CoGcQEBGKMsaVQyat9vD6N0mvzhqf9Hzj/bqFKlDoUNg4gsS/55KMqwp3U132i9GVRQ9 zt2/qxvELHkN6VTzyEcEEA17e/bypf91Bs94m/esWkqoIqxRti60K8XE/tsgsMLAohql 9Itnn3lQBMBS10Gc1Nw080LMcR6gA+evBiyNxHTlfI8ykH9x1SVWlHFK6OZ9wwUEks6H EDpw== MIME-Version: 1.0 Received: by 10.14.199.134 with SMTP id x6mr6621485een.31.1353628803425; Thu, 22 Nov 2012 16:00:03 -0800 (PST) Received: by 10.223.143.2 with HTTP; Thu, 22 Nov 2012 16:00:03 -0800 (PST) In-Reply-To: <1353622598.2779.29.camel@ubuntu> References: <1353592000.27840.8.camel@ubuntu> <1353622598.2779.29.camel@ubuntu> Date: Fri, 23 Nov 2012 00:00:03 +0000 Message-ID: Subject: Re: [DISCUSS] Deprecated code policy From: sebb To: HttpComponents Project Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On 22 November 2012 22:16, Oleg Kalnichevski wrote: > On Thu, 2012-11-22 at 18:40 +0000, sebb wrote: >> On 22 November 2012 18:03, Gary Gregory wrote: >> > Hi all, >> > >> > >> > For US folks out there on the interwebs, Happy Thanksgving day to you >> > all. In this context, I am thankful for this community of like and >> > open-minded software gurus, tinkerers, and bit wranglers. >> > >> > >> > I find it helpful to think about this in two parts: process and labeling >> > (or what version to label code). This is my perfect version world: >> > >> > Process: >> > >> > I like to release one version N that includes @[D|d]eprecated code with a >> > comment that states the EOL policy, e.g. "This class/method will be removed >> > in version A.B" *AND* the doc MUST contain a pointer to what to do instead. >> > >> > The simplest process is to deprecate in version N and remove in the next >> > (major) version N+1, e.g. 4.2 and 5.0. >> > >> > Labeling: >> > >> > Strictly, speaking I like API breakage in "major" releases only: 4.0, 5.0, >> > 6.0 and so on. It's just simpler to think about even if it leads to >> > "version inflation". When I pick up a new major version, I know what I am >> > in for. In Commons-land, this is also an opportunity to offer co-location >> > as a feature by renaming the package from o.a.project to o.a.project2, >> > o.a.project3, and so on. This is what Commons Lang did for version 3. The >> > POM AID should also be renamed at this time. >> > >> > I would only deprecate in a minor release (4.3), not a maintenance release >> > (4.2.3). That's just because I don't expect surprises in maintenance >> > releases, I expect a maint. release to be used in a drop and go fashion >> > without deprecated warnings popping up. IOW, no new APIs in a maint release. >> > >> > HTTP Components >> > >> > How does this match up with this project? What's a good pragmatic approach? >> > >> > Well, now is a good time to talk about this since HttpClient will offer a >> > new API. >> > >> > Today I can co-locate (I'm not sure what to call this feature) HttpClient 3 >> > and 4 because, this project is now a TLP and has a different package name. >> >> HC4 is a completely different product from HC3, whereas what we are >> discussing now is a gradual evolution. >> >> > So my first question is: do we want to 'break' co-location for the new >> > version or keep it? Do we want HC Next to live next to HC 4.2? >> > >> > The other way to ask this is: why would you not want to co-locate v4 and >> > vNext. >> >> Co-location - i.e. allowing both to play nicely in the same >> classloader - is only necessary if there are systems that *need* both. >> >> For example, JMeter uses both HC3 and HC4, but there's no reason for >> it to use HC4 and HC4-new together. >> JMeter will be amended as necessary to be able to use the updated API. >> >> > All of this leads me to think that the new HC API should be in a version 5 >> > with a new package name. >> >> Changing package name (and AID) does guarantee that the different >> versions can co-exist. >> However it means a lot more changes to source code. >> >> With gradual introduction and removal of methods it's possible to phase updates. >> However, if HC5 were to both introduce useful new methods and remove >> deprecated ones this would make the update process slightly more >> involved. >> >> > From experience in a real world app server, I can testified that having >> > Commons Lang 2 and 3 co-located is a genius feature which has avoid us >> > countless headaches. >> >> As I already wrote, Commons Lang is a very different proposition. >> Headaches (jar hell) come from having multiple independent >> dependencies on Lang in the same classloader and not being able to >> update them all. >> If there is only one dependency on Lang, that could be updated without problems. >> >> If there are genuine use cases where multiple independent parts of a >> system all depend on HC4, then yes, it might be worth striving for >> strict binary compatibility. >> But otherwise I think it's probably unnecessary overhead for HC4. >> >> As to whether the next version should be 4.x or 5.0, I don't particularly mind. >> A major version bump may make sense at this point. >> > > Co-location is a very valid and relevant subject. It is great that Gary > brought it up. Luckily we do not have to make a decision about it as > yet. HC 4.3 can be and is planned to be fully backward compatible with > 4.2. One should be able to simply drop 4.3 release in place of 4.2 and > still have everything working without any modification. The price of > such backward compatibility is of course having to keep two or more > versions of essentially the same code with some variations and a > different class name. The benefit of this approach is that it enables > users to migrate more gradually. It's only possible for a new version to be a drop-in replacement if it is binary compatible. That implies that methods cannot be deleted. [Unless they are clearly not part of the public API] > I think HC4 is used widely enough to result in situations where multiple > sub-components of the same system depend on different versions of HC4. > Spring alone makes such situation very likely. In which case, HC is much more like Commons than I supposed, and option 2 is a non-starter.. > At the same time we have > to be realistic about our capacity to maintain deprecated functionality. > If we can't do it right (and we cant) we will serve our users better by > removing it. I personally think two year / two feature releases is a > reasonable time frame to expect people to migrate off deprecated code. > We no longer have to maintain strict binary compatibility forever just > to please some people at Google. As long as we clearly articulate our If we wish to support Spring we still have to maintain strict binary compatibility within a given package name and associated AID. > policy in this regard and stick to it we will be acting responsibly > enough given the existing project constraints. The policy also has to be workable within the likely usage scenarios. For example, for JMeter it would be fine to drop deprecated methods after a couple of releases, but AFAICT that is not the case for Spring. There's no guarantee that all the Spring components can be upgraded within a given release time-frame - or indeeed ever -so breaks in compatibilty must be accompanied by a change in package name/AID. > Oleg > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org > For additional commands, e-mail: dev-help@hc.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org