X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.25a (ClamAV 0.103.11/27155) X-Junk-Score: 0 [] X-KAS-Score: 0 [] Return-Path: Received: from [40.107.244.44] (HELO NAM12-MW2-obe.outbound.protection.outlook.com) by selbstdenker.ag (CommuniGate Pro SMTP 6.3.18) with ESMTPS id 31893252 for webobjects-dev@wocommunity.org; Tue, 16 Jan 2024 00:31:56 +0100 Received-SPF: pass receiver=post.selbstdenker.com; client-ip=40.107.244.44; envelope-from=Ramsey.Gurley@practicemojo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HcVZEJp8xNld2Slqg9+NJNPIcX8KmJ2uO7y0+j5MDlqwSz5ew7EC7zM9PYKeSWc2zTZo5BMl8uUPHaDQXMm/PasRFC2xtDVddUsLqqxMO2PCun8imnV4ahcbk3I7RJHY7kKix7HUicY9KeP03yosqeJoN3WAssEGxT0Sc9tfUyfG5hMqqONQ5k7KCneEaDtbvQdK/v+HqG5guAJPQO5fBcMVV8DZ7VVn8EfnOUcQygeG6UQcMnuV+oEFcuIi5Hf4Buws7lRbJrnS9vxYnTIs6kfxL/Oi5cFHYuO9LUg9bIkJUDJIQwM8snJ4dRBIlBlkvqeFHGoaaHJTUNdegYLtxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o17kOFYzFPDgzC2qNrnR9BPvGNfAAhfNG6zjzo3wSiM=; b=SpZoo8W/FjcVyLSmNYUseP3YnBkecTBTWKD7Z4meL9gk8Aaxh2MhHmx0aqhFTPQOBuGV4j1JOi5bu+S9th+OP5wCjpphIwxcB4W3a7pebss9PHpSCFC6pCywcbi31ghg+kJsxlPjH6D3a0uSQXc0fp2h/UQtW4sZpeu1C9/L0wrzTQtc5SUJ2Ak1S7w2OlLV7nC8frIHbTgxzDufCKWFaR3MEvhs0vqnkV+G6QmvaDdadeSyhCHzmBarEhGeZwViaey7Gte0M72rXGodox+POhB3N4JzvNlw98gu43CqbbzHULhJbMGkCXUUNgYZnUj35JpLMErh2y22nJlB1KUM1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=practicemojo.com; dmarc=pass action=none header.from=practicemojo.com; dkim=pass header.d=practicemojo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=practicemojo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o17kOFYzFPDgzC2qNrnR9BPvGNfAAhfNG6zjzo3wSiM=; b=gfVDvKElUDRP7MCXXFa1Xunt2rXULkvGLW1XHtuZHcdHjybp/z5xAFn8sr9XZOnuwoMw2Ctgr4Pgt2u5YdFQdthLBc9X1LiaBCQgGZI3xg1ifuHzUF/ipCdcEhH1EZ+0g914jvAbs6YXfAraOQdvqvrbNLnKZapXRjU5W+5hOEE= Received: from PH7PR18MB5551.namprd18.prod.outlook.com (2603:10b6:510:2f5::9) by DM4PR18MB4143.namprd18.prod.outlook.com (2603:10b6:5:38a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17; Mon, 15 Jan 2024 23:31:40 +0000 Received: from PH7PR18MB5551.namprd18.prod.outlook.com ([fe80::e80:4f7e:4acf:88f8]) by PH7PR18MB5551.namprd18.prod.outlook.com ([fe80::e80:4f7e:4acf:88f8%4]) with mapi id 15.20.7181.015; Mon, 15 Jan 2024 23:31:40 +0000 From: Ramsey Gurley To: WebObjects & WOnder Development Subject: Re: [WO-DEV] Ideas for arbitrary to-one associations Thread-Topic: [WO-DEV] Ideas for arbitrary to-one associations Thread-Index: AQHaR7DTWuqhD61Gp0Om9zb8E6/s5LDbf+29 Date: Mon, 15 Jan 2024 23:31:39 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=practicemojo.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR18MB5551:EE_|DM4PR18MB4143:EE_ x-ms-office365-filtering-correlation-id: 775aa8fb-d4ba-4873-5aab-08dc16221feb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: f78nqYtEx5J7FTVVhHiZgXVk4ph+gUmm5hww8sdIq9Ibu2q/KmJbf8kIwbjvgsSvSBeg0wRFPWGhBnQAY0XQekdBvOxnubnDMS6bIgAicNM0OepScanqUXxUWWzg6mmhx+OweIC/NDsPKJohCHcEp+uxxZum8K+7YkMXaXaV96yEID53Ffp5ZZASkgU+kpXc1bF1oB7ADDwltJpTRF26GhseJwGAmGP1mYZth4VaV/Kk2y/nZUHEXAtaCRn8hLAgA0R1QCzsDTUxexS3t80D9LSfNr9SGprg3L+FrrChMD8uC6wzFF0MqLAPxVvUVUF/sYM3sG+o3qvXzdv1kCCOsXrLMoe2R18zxIkTOYki7bo7bSMIQQxNnZUKvtuk2nNRugGca9QUbsIbPYjQZ8DQQfSn4bKtIQq7CmSdBWRuDh4ZlqNlJgNnrTIgWsFVPHnq4QbbYDb2RAHLefkQNmlV+ryWk2Omd7RBb/ltiQ4x5uWTs+xNYV9UMi7G+sNhcpcgwhzw0jYso5K9oxYNgtT9PjKDQYhRDFI9lU9tTYPGVtxQaGJaN3cJPSztPLZtacyk+czADCmBP37YjdA//IiDbwUJ3BoKPhDMAqFYquesmyH4zkmbbpZ6GtPxD/WpSn4LS9IRHOH+j8Fqeoev6mcyDlHyCeEChrcR56nA9Mp4BxU= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR18MB5551.namprd18.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39850400004)(346002)(136003)(366004)(396003)(376002)(230922051799003)(230473577357003)(230373577357003)(1800799012)(451199024)(64100799003)(186009)(66556008)(66946007)(66476007)(64756008)(76116006)(5660300002)(66899024)(8936002)(8676002)(316002)(52536014)(86362001)(6916009)(66446008)(91956017)(2906002)(41300700001)(38100700002)(71200400001)(33656002)(122000001)(7696005)(38070700009)(83380400001)(9686003)(478600001)(26005)(53546011)(6506007)(19627405001)(55016003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?0dJLDqBPCEMMuRAlUgq+umAMlj8HVbdue7pWOvwnxMozV7F1n3Et/zh2?= =?Windows-1252?Q?I6/AYSp1SQYh/vf3oMUxqnU+nr5NvgpAobEjzzhxeCkp27n+eg92gd3g?= =?Windows-1252?Q?zglzee1gjTnQwxDY7adZ8LNDLv8nAb/9WVKHJ3cUtDTmDeRTG4PQEBHp?= =?Windows-1252?Q?QgFabOEeFjKSIe2dtbqSyaiTxxDodmEdsVauB4jdeZRIjh7mjzXC2Onw?= =?Windows-1252?Q?Ln6NlkLXCPa5dGeJX4qEnOJsEc/84qlTGqLBDv2h1Bev7UyE/BXctYrV?= =?Windows-1252?Q?mgD+PnMsddkHbEvZa+KAPeChNLs6NWS0l+TkqvTXUt5Q4zwRzmo4v/4C?= =?Windows-1252?Q?O0majEq3BMQsfLpLEG4IiywcptuObWzv6kXzpTsCad/FkbYEjZBtrZJR?= =?Windows-1252?Q?cfJF2c2CE2P/i52jyzC6KGOsEMc+VhxHodTIppu/wD9X6YJnt5FH9npw?= =?Windows-1252?Q?dpWZx3hO3FwxzVO0I1jl9q3rdzyQJcgI0HgVdfjpOc3ZWjasi2A6Mdaz?= =?Windows-1252?Q?zm6BANb/L0geQU1bjNV/WKRHwwsDs7k3qFy2/oCoo/i1REt9TN14Vzy4?= =?Windows-1252?Q?Bny3JPdQcaoCICQaiD8nBkISl+SvD/xC7blDerBsB3WmgQMtMTk+zScH?= =?Windows-1252?Q?7Z/rLGLYaYctsnw0L/EmFQoBf8VJ9dwOJDyR34TXPNvnTQbEI5XUSd8V?= =?Windows-1252?Q?aZEjQsbDzRuMhb7amImBjObzyeAvlNqDaMWYnE1Z7D5UOSm2vP1+ESQH?= =?Windows-1252?Q?HuJEb3HTKlx9gaKGUzCAeKTwjjveyfVy3OTKMecrn9WpM4v14nW83qaD?= =?Windows-1252?Q?f9YCxwoc1uYx1juNo9OXO7YwXQVS7GhGbZJBFDJvYqh7dN4R0D0kVXoo?= =?Windows-1252?Q?nwmxev4N9wtfHxjaAVqFrYZBu0rpTryTwTHrY53gSCdv/Z1p1NXMsm5y?= =?Windows-1252?Q?2nP52nHd515SI1qa1lQ25yw8S+DSdmoV1fWEQAnn2qfrX1Q3GYQFtch8?= =?Windows-1252?Q?KlJivXCtXc50w9AJigNrRU/LBXT66YLVInuP5zqg3GFoG+hYBDS2iIwO?= =?Windows-1252?Q?GAOg9iVXa3CVr8yr4JFe3E5Fqx/REvYssDUHgKSbLAKCSVriDYxBUdbk?= =?Windows-1252?Q?7FYndAVGn14AtreW8cLy+CO7AxU7emHIpTou9ayPYGUi4SCwCfAI8gVG?= =?Windows-1252?Q?GTJMZGj94FkTJoDbCKtfoCqbZK9knCiUlonCk8tM4TgNIfLqwOTkGZdn?= =?Windows-1252?Q?uXnK7H6OPuA1dQ/g9iXQd7nzW66seq4d7huBBbfVKd9xgYVyDs5BHeVG?= =?Windows-1252?Q?qyti0wus2XIv9J7MyRxV806rJZqRLNOMrWXr6TQ8nGe9N4RKYYok0GoK?= =?Windows-1252?Q?MhPutQpy+1iXIJuOUEqE1ijPRe5VVB7BlIfhECna0CEtFEqRhY07KiEx?= =?Windows-1252?Q?Tl5/rfvJ9VTakNxVfN5zz7CE6pqg1XG2AiDRxh9t1hD1oOCU8+wteqI5?= =?Windows-1252?Q?G7NLDESOGMlTjpWnPfBQaCYeg8BVcG1ePlqn5dMIFxGoGEM6jRn+Ww9P?= =?Windows-1252?Q?TJCSgzWlbhkW/NnuXsveFwW4qtC+zUd3ipbpN5XAEc+xtLLxRNPCEYl8?= =?Windows-1252?Q?jA8uJSVm6fQm40U4trucrEElD8WgOWzO9nxxWpnK+NteAApc8F60btxN?= =?Windows-1252?Q?cVNHI+hkYO4bd387SKO3XKM5zkgKzWuhN3IuoCEAeeLv2oRgE/w8Qg?= =?Windows-1252?Q?=3D=3D?= Content-Type: multipart/alternative; boundary="_000_PH7PR18MB5551DD12F10B33064C0E5CE6866C2PH7PR18MB5551namp_" MIME-Version: 1.0 X-OriginatorOrg: practicemojo.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR18MB5551.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 775aa8fb-d4ba-4873-5aab-08dc16221feb X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2024 23:31:39.9851 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: de0a5129-99d3-4d35-a928-09047a134775 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: QX8hBqZOhJyGUs5JzwtfcAH41mAcim931l4hiBcCZFlqfj6PPoVkxwCSJsPb6hDJFdpu/Xdesdi0lU5PEydqo+FngmD0X/QcqZgOomTc4UU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR18MB4143 --_000_PH7PR18MB5551DD12F10B33064C0E5CE6866C2PH7PR18MB5551namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable If you're starting from scratch, you could do this using vertical inheritan= ce. You're sorta inventing your own vertical inheritance doing what you des= cribe, but the entity name is on the note table instead of on the entity ta= ble. What you would do is have one super class 'Notable' EO with a 'notes' = to-many, and all the things you want to have related notes would subclass i= t. However, that's not going to work if you already have existing EOs with PK = collisions in different tables. Vertical inheritance is also the lowest per= formance inheritance, because it needs to do the extra joins. But on the up= side, you could benefit from EOF knowing how to do shallow vs deep fetches = against such an entity. It sounds like you want graph database features in a relational database. I= f you think you will need more tables like this note table, you could creat= e a join table to hold all the messiness. Similar to an EOF many-to-many, y= ou would have compound PK made of FKs to two tables, but you would add two = more entity identifier columns, one for each FK. This would allow you to ap= ply the same sort of anything to anything relations to all tables. ________________________________ From: WebObjects & WOnder Development on behalf of Markus Ruggiero (rucotec= ) Sent: Monday, January 15, 2024 9:45 PM To: WebObjects & WOnder Development Subject: [WO-DEV] Ideas for arbitrary to-one associations I am looking for ideas / strategies to implement the following requirement: I want to implement something I call GeneralNote. It should be possible to = create such a note anywhere in the application and associate it with the cu= rrent EO, whatever this may be. Thus any EO can potentially have 0 to many = GeneralNote objects hanging off it. One GeneralNote however is not shared, = thus it is a real to-one relationship from GeneralNote to an EO. It is obviously not possible (well, more like totally impractical) to model= a to-one relationship from GeneralNote to any/all possible destination ent= ities in my EOModel. Any ideas on how to do this? I want to leverage as much as possible the pow= er of EOF. I was experimenting with code that puts the destination entity a= nd the destination object=92s primary key value in attributes of GeneralNot= e. I also have code that can find GlobalNote objects for an EO by using its= entity name and primary key for fetching. All our EOs share a common base = class that can easily accommodate such code generically. But what if the EO= and a note is created at the same time? There is no primary key value yet!= And how can I prevent an EO from being deleted and leaving orphaned notes = behind? Would overriding willDelete() be a good place to also delete the no= tes? What about not allowing EO deletion when there still are notes? Thanks for any ideas! ---markus--- ________________________________ Confidentiality Notice: This email, including all attachments and replies t= hereto, are covered by the Electronic Communications Privacy Act, 18 U.S.C.= Sections 2510-2521 and are legally privileged. This information is confide= ntial, and intended only for the use of the individuals or entities named a= bove. If you are not the intended recipient, you are hereby notified that a= ny disclosure, copying, distribution or the taking of any action in relianc= e on the contents of this transmitted information is strictly prohibited. P= lease notify us if you have received this transmission in error. Thank you. --_000_PH7PR18MB5551DD12F10B33064C0E5CE6866C2PH7PR18MB5551namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
If you're starting from scratch, you could do this using vertical inheritan= ce. You're sorta inventing your own vertical inheritance doing what you des= cribe, but the entity name is on the note table instead of on the entity ta= ble. What you would do is have one super class 'Notable' EO with a 'notes' to-many, and all the things you wa= nt to have related notes would subclass it.

However, that's not going to work if you already= have existing EOs with PK collisions in different tables. Vertical inheritance is also the lowest performance i= nheritance, because it needs to do the extra joins. But on the upside, you = could benefit from EOF knowing how to do shallow vs deep fetches against su= ch an entity.

It sounds like you want graph database features = in a relational database. If you think you will need more tables like this note table, you could create a join ta= ble to hold all the messiness. Similar to an EOF many-to-many, you would ha= ve compound PK made of FKs to two tables, but you would add two more entity= identifier columns, one for each FK. This would allow you to apply the same sort of anything to anything re= lations to all tables.


From: WebObjects & WOnder De= velopment on behalf of Markus Ruggiero (rucotec)
Sent: Monday, January 15, 2024 9:45 PM
To: WebObjects & WOnder Development
Subject: [WO-DEV] Ideas for arbitrary to-one associations

I am looking for ideas / strategies t= o implement the following requirement:

I want to implement something I call GeneralNote. It should be possible to = create such a note anywhere in the application and associate it with the cu= rrent EO, whatever this may be. Thus any EO can potentially have 0 to many = GeneralNote objects hanging off it. One GeneralNote however is not shared, thus it is a real to-one relati= onship from GeneralNote to an EO.
It is obviously not possible (well, more like totally impractical) to model= a to-one relationship from GeneralNote to any/all possible destination ent= ities in my EOModel.

Any ideas on how to do this? I want to leverage as much as possible the pow= er of EOF. I was experimenting with code that puts the destination entity a= nd the destination object=92s primary key value in attributes of GeneralNot= e. I also have code that can find GlobalNote objects for an EO by using its entity name and primary key for = fetching. All our EOs share a common base class that can easily accommodate= such code generically. But what if the EO and a note is created at the sam= e time? There is no primary key value yet! And how can I prevent an EO from being deleted and leaving orph= aned notes behind? Would overriding willDelete() be a good place to also de= lete the notes? What about not allowing EO deletion when there still are no= tes?

Thanks for any ideas!
---markus---


Confidentiality Notice: This email, including all attachments and= replies thereto, are covered by the Electronic Communications Privacy Act,= 18 U.S.C. Sections 2510-2521 and are legally privileged. This information = is confidential, and intended only for the use of the individuals or entities named above. If you are not the= intended recipient, you are hereby notified that any disclosure, copying, = distribution or the taking of any action in reliance on the contents of thi= s transmitted information is strictly prohibited. Please notify us if you have received this transmission in err= or. Thank you.
--_000_PH7PR18MB5551DD12F10B33064C0E5CE6866C2PH7PR18MB5551namp_--