Recent

Author Topic: Changes in VisualPlanit?  (Read 6399 times)

wp

  • Hero Member
  • *****
  • Posts: 13645
Changes in VisualPlanit?
« on: September 05, 2016, 11:30:58 am »
It has been requested to overlay several resources in the same visual component (DayView, WeekView etc). I think this is possible by introducing something like "TVpResourceGroup", a descendant of TVpResource, which contains a list of the individual resource groups. Events/tasks/contacts of the member resources will be collected in a list of the resource group, the combined list then can easily be displayed in the same DayView with minimum changes in the painting code.

Trying to implement this I noticed that the data fields of Visual PlanIt must be extended: The TVpResource must get a field "Grouped", and there should be a new table "GroupedResources" which lists all the resources belonging to a group.

Since this change must be accompanied by changes in the databases there is a chance that it may break existing applications. If an application uses only the desktop datastores then, I think, everything can be fixed on the fly, but if the datastore accesses a large, remote database then more effort will be needed for the user.

What is the opinion on this?

Possibly it is a good idea to add other new fields along with this change. I am thinking of

Contacts
  • Email2
  • EMail3
  • EMailType  (home or business)
  • EmailType2
  • EMailType3
  • WebSite
  • PathToPhoto
  • Photo (as blob) ?
Tasks
  • Priority (low, normal, high)
  • Category (like in Events)
  • PercentageCompleted
  • Status (not started, in progress, waiting for something, completed, deferred)
  • Reminder: AlarmSet, AlarmAdvance, AlarmAdvanceType, DingPath (like in Events)
Events
  • (no changes)
Resources
  • Grouped (Flag indicating to collect events, tasks, contacts from member resources)
ResourceGroups
  • ResourceID of group
  • ResourceID of group member resource
Anything missing?

And I think this would be a good chance to remove those "UserDefined" fields. Is anybody using them?

Feedback would be welcome.
« Last Edit: September 05, 2016, 11:45:45 am by wp »

JanRoza

  • Hero Member
  • *****
  • Posts: 754
    • http://www.silentwings.nl
Re: Changes in VisualPlanit?
« Reply #1 on: September 05, 2016, 11:46:38 am »
Would keeping those user defined fields not be handy should a user need more than is offered now? If they don't hurt the component why not leave them in for future use?
OS: Windows 11 / Linux Mint 22.3
       Lazarus 4.6 RC FPC 3.2.2
       CodeTyphon 8.90 FPC 3.3.1

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1901
Re: Changes in VisualPlanit?
« Reply #2 on: September 05, 2016, 12:26:03 pm »
If you want to do real many clients / single server stuff, then we need to have a kind of blocking feature !

E.g. when starting dragging (editing) an event, it should be signalled as blocked.
So it can be blocked on the server !
And nobody else can update at that moment.
I am missing this feature already at this moment.

hrayon

  • Full Member
  • ***
  • Posts: 123
Re: Changes in VisualPlanit?
« Reply #3 on: September 05, 2016, 01:55:44 pm »
Hi wp!
Over the years, the interoperability between calendars elements has become a necessity. If you want to maintain interoperability should follow certain standards. There is a consortium that handles this. I am not associated, but should take a look at what they have, can save rework.
See more here:
https://www.calconnect.org/

wp

  • Hero Member
  • *****
  • Posts: 13645
Re: Changes in VisualPlanit?
« Reply #4 on: September 05, 2016, 02:09:49 pm »
Thank you, it's good to know that. But certainly I will not consider it a lot. Once a committee is involved, fun is lost. And fun is the only motivation for me to adapt VisualPlanIt to Lazarus.

hrayon

  • Full Member
  • ***
  • Posts: 123
Re: Changes in VisualPlanit?
« Reply #5 on: September 05, 2016, 02:43:50 pm »
You're right. Unfortunately, there is a lot of docs to read, but I missed something more objective, such as: If you want to maintain compatibility of your calendar application with Mozilla, Boeing, Apple, Google, Microsoft, Oracle, Universities, OSAF, etc(there are many big "players" associated) then use this data model preferably. :(

JD

  • Hero Member
  • *****
  • Posts: 1915
Re: Changes in VisualPlanit?
« Reply #6 on: September 05, 2016, 03:58:47 pm »
If you want to do real many clients / single server stuff, then we need to have a kind of blocking feature !

E.g. when starting dragging (editing) an event, it should be signalled as blocked.
So it can be blocked on the server !
And nobody else can update at that moment.
I am missing this feature already at this moment.

I agree with you. I only do multiuser stuff nowadays but I usually let the database server decide what to do with race conditions. PostgreSQL has SELECT .... FOR UPDATE NOWAIT amongst other SQL commands that locks a row that is being updated and reports an error to anyone else trying to access the row. The row remains available for querying BUT not for editing. So it is first come, first served.

For those databases that don't have this functionality, it would have to be implemented in the application server or in the database itself. For a simple database solution, an extra boolean column called InUse should be enough to track it. The first user to lock the row sets it to TRUE and when the transaction is committed, it is reset to FALSE (which would be its default value). First come, first served.

@wp I agree with you too. You seem to have the extra functionality covered. But leave the user defined fields. One never knows when they may come in handy.
« Last Edit: September 05, 2016, 04:06:10 pm by JD »
Linux Mint - Lazarus 4.8/FPC 3.2.2,
Windows - Lazarus 4.8/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

wp

  • Hero Member
  • *****
  • Posts: 13645
Re: Changes in VisualPlanit?
« Reply #7 on: September 05, 2016, 04:05:51 pm »
If you want to do real many clients / single server stuff, then we need to have a kind of blocking feature !

E.g. when starting dragging (editing) an event, it should be signalled as blocked.
So it can be blocked on the server !
And nobody else can update at that moment.
I am missing this feature already at this moment.
At first - I'm not a specialist with big databases, so please be patient with my ignorance. But: To me the planner controls are something like a DBGrid, just a visual control to display some database content. But does the DBGrid have some locking mechanism? I don't think so. It there is a conflict the database must take care of it, or the architecture of the application must take care of it, but in my eyes this is not a task of the visual control.

OK - you may say: TvPlanit is more than the visual controls, there's the datastore as well. But I consider this to be part of the local application. The database knows when a record is being written and should take care of locking.
« Last Edit: September 05, 2016, 04:18:24 pm by wp »

JD

  • Hero Member
  • *****
  • Posts: 1915
Re: Changes in VisualPlanit?
« Reply #8 on: September 05, 2016, 04:12:43 pm »
If you want to do real many clients / single server stuff, then we need to have a kind of blocking feature !

E.g. when starting dragging (editing) an event, it should be signalled as blocked.
So it can be blocked on the server !
And nobody else can update at that moment.
I am missing this feature already at this moment.
At first - I'm not a specialist with big databases, so please be patient with my ignorance. But: To me the planner controls are something like a DBGrid, just a visual control to display some database content. But does the DBGrid have some locking mechanism? I don't think so. It there is a conflict the database must take care of it, or the architecture of the application must take care of it, but in my eyes this is not a task of the visual control.

You are right. The architecture of the application OR the database should take care of it. Such logic is rarely (if at all) done on the client side. It also makes it easy to change the logic without redeploying hundreds of client installations.

It is part of business rules/logic!

https://en.wikipedia.org/wiki/Business_logic
« Last Edit: September 05, 2016, 04:26:41 pm by JD »
Linux Mint - Lazarus 4.8/FPC 3.2.2,
Windows - Lazarus 4.8/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1901
Re: Changes in VisualPlanit?
« Reply #9 on: September 05, 2016, 05:18:45 pm »
https://en.wikipedia.org/wiki/Concurrency_control

I am also fine with collision detection (generated by the database). With a subsequent error and rollback.

I just wanted to ask for a feature that can handle multiple clients updating at once.
Any method that takes care of that will be acceptable !

Thanks.

 

TinyPortal © 2005-2018