From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: tasks as part of record Date: Mon, 6 Oct 2014 10:00:14 +0200 Organization: cbb software GmbH Message-ID: <1ek4634mtnybu.2yqt65o532me$.dlg@40tude.net> References: <294a973f-5222-4aa3-8971-777cd2eb9174@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: kY8ce/EaDhBBDBrOS7FbFg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.giganews.com comp.lang.ada:189432 Date: 2014-10-06T10:00:14+02:00 List-Id: On Mon, 06 Oct 2014 10:18:07 +0300, Niklas Holsti wrote: > On 14-10-06 06:47 , Stribor40 wrote: >> I though it would be easier if task is componenet of record. > > *What* would be easier? > > Tasks are intended for a specific purpose, which is useful in *some* > applications: to execute separate threads of control concurrently, and > possibly in parallel if the computer has several processors. > > As I said before, it is unusual for an application to require a separate > task for each data object (= student record), and such designs are > usually complex and inefficient. Well, actually it is not so unusual. The software pattern is called "active object". You are right it is not easy. However, concerning easier or not, what is the alternative? Two separate yet coupled objects (task and record)? That is not necessarily easier. Actually there are three variants all already mentioned in the thread: 1. Separate record and task one referencing another; 2. Task in a limited record with an access discriminant to; 3. Data hidden in the task, exposed via task's entry. #1 is a mess; #2 is active object and has issues with initialization/finalization and most likely will break under inheritance; #3 is heavy-weight and coarse because all interfacing go though entries, entries may have no results, tasks are non-tagged. But the question is *what*, as you said. >> i would like to operate on components of student record. >> For example for each student there will be one tasks. > > Why? Why do you need concurrent / parallel execution of student operations? A simulation? > I suspect strongly that using tasks at all in your application is > unnecessary, and only complicates the design, which is why I would like > to understand why your application needs concurrency. Exactly. Before discussing a solution there must be the problem stated. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de