Discuss anything related to web development but no technical support questions


Post by Jay »

Hi

I can see incorrect relationship in your gantt models.

Gnt.model.Project extends from Gnt.model.Task so that if you see the entity relationship both having inheritance relationship. Project inherits from Task. This is completely wrong in actual project management scenarios.

The project should be the unique entity and Project Has Tasks. In your case Project Is-a Task. Project has lot of unique properties than task. basically in the json data should be comes like
[
  {
     "calenders" : ...,
      "dependecies": ..,
      "assignments": ..,
      "resources": ..,
      "tasks": ..,
      "projects": ..,
  }
]
Also in the current version 3.0.6,
I cann see only hrd flag you used to differentiate project is

"TaskType" - inside task property and this value always takes "Gnt.examples.advanced.model.Project"
then this task considered as project in styles

However the logic fails to mapping project and Task as objects.

Post by arcady »

Jay wrote:Gnt.model.Project extends from Gnt.model.Task so that if you see the entity relationship both having inheritance relationship. Project inherits from Task. This is completely wrong in actual project management scenarios.
General speaking every project is just a complex task consisting of a multiple child tasks. So a project is a task.
Jay wrote:The project should be the unique entity and Project Has Tasks.
1) You don't have to use multiple projects nor use new project model. Though this is supported by the gantt.
2) Yes a project has tasks and Ext.data.NodeInterface works fine for this:
array of project tasks:
project.childNodes
first project task:
project.firstChild
last project task:
project.lastChild
etc...
Jay wrote:Project has lot of unique properties than task.
Sure, and any developer is free to extend standard Gnt.model.Project class as he wants.
Jay wrote: basically in the json data should be comes like
[
{
"calenders" : ...,
"dependecies": ..,
"assignments": ..,
"resources": ..,
"tasks": ..,
"projects": ..,
}
]
It can look in a multiple ways depending on specification of a particular subject domain.
What you describe here is just one particular use case.
Jay wrote:Also in the current version 3.0.6,
I cann see only hrd flag you used to differentiate project is

"TaskType" - inside task property and this value always takes "Gnt.examples.advanced.model.Project"
then this task considered as project in styles

However the logic fails to mapping project and Task as objects.
Not sure what you mean. If you mean that you have to name your field "TaskType" then there is a config: Gnt.data.TaskStore.typeProperty
And the property can contain name of any class extending Gnt.model.Task.

Post by Jay »

hello arcady

Not agreeing completely, your approach more or less satisfying the front end models any how more difficult in server side.

Project has Tasks. A Task is part of one Project, and one Project alone. The Task can’t be created independently of the Project, it can’t exist outside of it, and when the Project is deleted, its Tasks are deleted. Tasks have a ‘completed’ boolean flag. Clearly a Task has a lifecycle: it gets created, at a certain point it is completed, and it can be removed. This lifecycle only exists in the context of Project.

In your way of doing, task can be exist alone. meantime, if i want to return a list of task of one project, As your way i need to run through all the childrens and its tightly coupled.

Post by mats »

Can you maybe explain a bit more clearly how our client side modelling makes your life harder in the server side language?

Post by Jay »

Of course, I have listed down

1. I have created two different entities Project and Task, Task having Foreign key of Project. I need to prepare json data for the front end like how your model express. Here I need to map GanttTask model (-> task element in json) which contains projects and tasks. because json doesn't contain separate project and task elements. Here I need to do an unnecessary mapping to create GantTask model (-> task element in json) from Server side Project and Tasks. This mapping causes time performance issue

2. All the entities in the server side GUID as a primary key value. In the Sync method I can get only updated int Id values. I have to another mapping regarding to Id to GUID and GUID to Id. This mapping is not easy because I need to update Ids, Foreign Keys & Parent Id s into proper GUID. Even though I’m using auto mapper but it consumes much time and it also leads to performance issue.


These two are the actual issue currently we are facing in our product.

Post by Maxim Gorkovsky »

1) Not sure what performance issues are you talking about. But considering there're any and you're using CRUD manager, you can extend it to understand any data structure. E.g. you can override json encoder used by CRUD manager, and move 'projects' to 'tasks', creating correct tree structure on client side.
2) You can use GUID as an id's for our (and any extjs) models

Post Reply