Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOOjY-0002Y3-FZ for pgadmin-hackers@arkaria.postgresql.org; Thu, 31 May 2018 14:39:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fOOjW-0005iO-VV for pgadmin-hackers@arkaria.postgresql.org; Thu, 31 May 2018 14:39:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOOjW-0005he-P5 for pgadmin-hackers@lists.postgresql.org; Thu, 31 May 2018 14:39:18 +0000 Received: from mx0a-00296801.pphosted.com ([148.163.150.38]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fOOjP-0000jj-M3 for pgadmin-hackers@postgresql.org; Thu, 31 May 2018 14:39:15 +0000 Received: from pps.filterd (m0114581.ppops.net [127.0.0.1]) by mx0a-00296801.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4VEaGbs015517 for ; Thu, 31 May 2018 14:39:08 GMT Received: from mail-ua0-f200.google.com (mail-ua0-f200.google.com [209.85.217.200]) by mx0a-00296801.pphosted.com with ESMTP id 2j9euusktp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 31 May 2018 14:39:07 +0000 Received: by mail-ua0-f200.google.com with SMTP id x8-v6so13068351uaj.2 for ; Thu, 31 May 2018 07:39:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Un1DVqs6iVF8CpKS1ME+UHqTBxUW2NKImvkS1LU1Jtc=; b=C/aJfudJJ1nczVokDbnIUksZYW6FLzVgJI+YbNudO68n31ouybPQ6/Yyz7RLkLw6c6 U5Csg8kLkdNGGwnlotIje2ZmTy5oTJg9GAf8+Kd7xv2WzIg+mk/Igo4ziG8oibEay1Dd NIhYcFINJvBwavzn0BxPz1Ho2y0TsihyG+eMtcpL63c+WP4K9UJ4zEyMVakgbo5dINBd odFqmJc8yPLSSY1VwsnL2Td5w00bWOasjmcfO2zv477g9wWCKIq2YRsx6eDxmxtfsVZs 8+qZYqqd4qj2uelglDPwYOJWLjKtp5OC2dXOpZrY7WBrOy4P3C+aVHflp5TmdzvVRPhl RFbA== X-Gm-Message-State: ALKqPwdw1SoDMJ9q2FrOQOavPkTSwTntCjpngMhyMqT5Aw5LCIK1Rtz4 eM24NSPBdkbzTKhkVkaHuZuMig1tbaLVSTv8PXoh30fATqgT4qKV7QnEUHKvftaDPLPbt/3h7zx KHNMf2rF4Lv5uYkk5P4Riq3a2UQgrPMTd/l/Y1RxwZs6CZd//O40lWRFXBKwN6tO66H6L X-Received: by 2002:a1f:c204:: with SMTP id s4-v6mr1754290vkf.86.1527777546013; Thu, 31 May 2018 07:39:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIvnuB7Y8nR+6DtNiGEt41icU7O7jTYIbHskSs9yHKD0IAD8JuWXIx0LYXX191hJzFzehn80jo7Gy5lHaiwClk= X-Received: by 2002:a1f:c204:: with SMTP id s4-v6mr1754274vkf.86.1527777545671; Thu, 31 May 2018 07:39:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:4f05:0:0:0:0:0 with HTTP; Thu, 31 May 2018 07:39:05 -0700 (PDT) In-Reply-To: References: From: Robert Eckhardt Date: Thu, 31 May 2018 10:39:05 -0400 Message-ID: Subject: Re: [pgadmin4][patch] Initial patch to decouple from ACI Tree To: Joao De Almeida Pereira Cc: Ashesh Vashi , Anthony Emengo , Dave Page , Akshay Joshi , Murtuza Zabuawala , pgadmin-hackers , Khushboo Vashi Content-Type: multipart/alternative; boundary="000000000000e7f1e5056d816df6" X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-31_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310165 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000e7f1e5056d816df6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable All, These patches were first proposed on April 2 and the meaningful changes have yet to be committed. ~8 weeks is long enough that my assumption now is that these aren't going to be committed. The goal of these patches is to begin to separate out the ACI tree in order to allow us to do feature work on that chunk of the code. Are there any alternate suggestions for this work? Are there any ideas as to how we can meaningfully move forward with the goal of allowing the tree view to support a very large number of tables? -- Rob On Thu, May 24, 2018 at 10:43 AM, Joao De Almeida Pereira < jdealmeidapereira@pivotal.io> wrote: > Hey, Thanks so much for the reply. > > We've noticed that you've made several modifications on top of our > original patch. Unfortunately, we've found it very hard to follow. Could = we > please get a brief synopsis of the changes you have made - just so we can > better understand the rationale behind them? Just like we've done for you > previously. > > Let's keep in mind that the original intent was simply to introduce this > abstraction into the code base, which is a big enough task. I'd hate for > the scope of the changes we're making to expand beyond that. > > Thanks > Joao && Anthony > > > On Thu, May 24, 2018 at 2:59 AM Ashesh Vashi < > ashesh.vashi@enterprisedb.com> wrote: > >> Sorry for the late reply. >> On Wed, May 16, 2018 at 8:55 PM, Anthony Emengo >> wrote: >> >>> export function canCreate(pgBrowser, childOfCatalogType) { >>> return canCreateObject.bind({ >>> browser: pgBrowser, >>> childOfCatalogType: childOfCatalogType, >>> }); >>> } >>> >>> With respect to the above code: this bind pattern looks good and seems >>> like the idiomatic way to handle this in JavaScript. On a lighter node,= I >>> don=E2=80=99t even see the need for an additional method to wrap it. Th= e invocation >>> could have easily been like canCreate: canCreateObject.bind({ browser: >>> pgBrowser, childOfCatalogType: childOfCatalogType }), I don=E2=80=99t f= eel too >>> strongly here. >>> >> I do agree - we can handle the same problem many ways. >> I prefer object oriented pardigm more in general. >> Any way - I have modified the code with some other changes. >> >>> I renamed it as isValidTreeNodeData, because - we were using it in for >>> testing the tree data. Please suggest me the right place, and name. >>> >>> We=E2=80=99re not sure; maybe after continued refactoring, we will come= across >>> more generic functions. At that point we can revisit this and create a >>> utils.js file. >>> >> Sure. >> >>> The original patch was separating them in different places, but - still >>> uses some of the functionalities directly from the tree, which was >>> happening because we have contextual menu. >>> To give a better solution, I can think of putting the menus related cod= e >>> understand =E2=80=98sources/tree/menu=E2=80=99 directory. >>> >>> We=E2=80=99re particularly worried because we=E2=80=99re trying to avoi= d the coupling >>> that we see in the code base today. We want to decouple *application >>> state* from *business domain* logic as much as we can - because this >>> makes the code much easier to understand. We achieve lower coupling by = have >>> more suitable interfaces to retrieve *application state* like: anyParen= t >>> (the menu doesn=E2=80=99t care how this happens). This is the direction= that we=E2=80=99re >>> trying to move towards, we just don=E2=80=99t want the package structur= e to >>> undermine that developer intent. >>> >> I realized after revisiting the code, menu/can_create.js was only >> applicable to the children of the schema/catalog nodes, same as >> 'can_drop_child'. >> We should have put both scripts in the same directory. >> >> Please find the updated patch for the same. >> >> Please review it, and let me know your concerns. >> >> -- Thanks, Ashesh >> >>> How about nodeMenu.isSupportedNode(=E2=80=A6)? >>> >>> Naming is one of the hardest problems in programming. I don=E2=80=99t f= eel too >>> strongly about this one. For now, let=E2=80=99s keep it as is >>> >>> Thanks >>> Anthony && Victoria >>> =E2=80=8B >>> >>> >>> >>> >> --000000000000e7f1e5056d816df6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
All,=C2=A0

These patches were first pro= posed on April 2 and the meaningful changes have yet to be committed. ~8 we= eks is long enough that my assumption now is that these aren't going to= be committed.=C2=A0

The goal of these patches is = to begin to separate out the ACI tree in order to allow us to do feature wo= rk on that chunk of the code. Are there any alternate suggestions for this = work?=C2=A0

Are there any ideas as to how we can meaningfully move f= orward with the goal of allowing the tree view to support a very large numb= er of tables?=C2=A0

-- Rob


<= div class=3D"gmail_quote">
Sorry for the late reply.
On Wed, May 16, 2018 at 8:55 PM, Anthony Emengo = <aemengo@pivotal= .io> wrote:
export function can=
Create(pgBrowser, childOfCatalogType) {
  return canCreateObject.bind({
    browser: pgBrowser,
    childOfCatalogType: childOfCatalogType,
  });
}

With respect to the above co= de: this bind pattern looks good and seems like the idiomatic way to handle= this in JavaScript. On a lighter node, I don=E2=80=99t even see the need f= or an additional method to wrap it. The invocation could have easily been l= ike canCreate: canCreateObject.bind({ browser: pgBrowser, = childOfCatalogType: childOfCatalogType }), I don=E2=80=99t feel too = strongly here.

I do agree - we can handle = the same problem many ways.
I prefer object oriented pardigm more= in general.
Any way - I have modified the code with some other c= hanges.

I renamed it as isValidTreeNodeData, beca= use - we were using it in for testing the tree data. Please suggest me the = right place, and name.

We=E2=80=99re not sure; maybe after conti= nued refactoring, we will come across more generic functions. At that poin= t we can revisit this and create a utils.js file.

Sure.=C2=A0

The original patch was separating them in= different places, but - still uses some of the functionalities directly fr= om the tree, which was happening because we have contextual menu.
To giv= e a better solution, I can think of putting the menus related code understa= nd =E2=80=98sources/tree/menu=E2=80=99 directory.

We=E2=80=99re particularly worried= because we=E2=80=99re trying to avoid the coupling that we see in the code= base today. We want to decouple application state from busine= ss domain logic as much as we can - because this makes the code much e= asier to understand. We achieve lower coupling by have more suitable interf= aces to retrieve application state like: anyParen= t (the menu doesn=E2=80=99t care how this happens). This is the dire= ction that we=E2=80=99re trying to move towards, we just don=E2=80=99t want= the package structure to undermine that developer intent.

<= /blockquote>
I realized after revisiting the code, menu/can_create.js w= as only applicable to the children of the schema/catalog nodes, same as = 9;can_drop_child'.
We should have put both scripts in the sam= e directory.

Please find the updated patch for the= same.

Please review it, and let me know your conc= erns.

-- Thanks, Ashesh

How about nodeMenu.isSupportedNode= (=E2=80=A6)?

Naming is one of the hardest problems in = programming. I don=E2=80=99t feel too strongly about this one. For now, let= =E2=80=99s keep it as is

Thanks
Anthony && Victoria

=E2=80=8B

=




--000000000000e7f1e5056d816df6--