Author Topic: Request: Undo/Redo enhance!  (Read 16076 times)

angel-o-sphere

  • EA User
  • **
  • Posts: 112
  • Karma: +0/-0
    • View Profile
Re: Request: Undo/Redo enhance!
« Reply #15 on: March 12, 2004, 03:48:10 am »
I respectfull dissagree,

all other changes are in my experiance easy.  (I have written a complex CAD System and a CASE system my own)

You have only 4 kinds of commands:

* creation
* deletion
* attribute change
* linking -- a special case of attribute change

Linking is more complex as it can fall into three subgroupes:
* create new and link (drawing a new connector causes about 4 new links)
* unlink and create new and link (typing a new stereotype over an existing one or relink an end of a connection to a different classifier)
* unlink old and link existing (replacing a type for an attribute or return type of an method with a different one or moving a classifier into a different package)

The more complex ones only change two or more attributes, while the simpler ones change just one, or create/delete something.

The problem you see might come from redoing commands in a unknown or free order. But thats not needed(and likely not wanted).
As long as commands are executed sequencialy by the user, they get stored in a kind of double linked queue, so you can move with a curser forward and backward. Undoing is only possible sequencialy as well, while the cursor is moved backward towards the beginning of the queue. Redoing is only possible forwards by moving the cursor in direction of the end of the queue. There exist no unforseeable side effects between undoing/redoing as they are executed in their order of dependency.

If a command causes cascading effects, usually only happening if you move a class from one package to the other or you delete a classifier and all links need to get deleted as well, affecting other classifiers, you create a composite command and group all commands together.

Now we have only one problem: interaction of several users working simultaniously, maintaning one shared comand queue or seperated queues? That means the DB should probably be cleaned up after the last one loggs off?

A database problem I see: DB generated IDs. Deleting a classifier and removing it from the DB and later redoing its creation might cause it to get a different key/ID. Thats why I mark deleted objects only as deleted and keep them as long as I think they might get revived.

Anyway: if you had the command pattern implemented and the commands persistant, long time persistant not only per session, stuff like versioning and historization would become trivial as well.

Imagine to roll a view of a diagramm one week back.

In our days a complete command log is no memory issue anymore ... and if you fear the memory usage indeed, then start throwing away commands older than a week, or two, or 6 monthes.

A complete command log would be a uique selling point for EA ... as far as I know. (As my CASE system never made it to the market as my company went bancrupt :-/ in 1999 and I never saw another system supporting it)

Oh, yes, in case you consider to go for that: I seperated commands wich only had view effects, like alligning all classes vertically, from commands changing the model. The view history was thrown away after the user switched to an other diagram, only the model changes where kept.

Regards,
  angel'o'sphere

thomaskilian

  • Guest
Re: Request: Undo/Redo enhance!
« Reply #16 on: March 12, 2004, 06:32:37 am »
angel-o-sphere
This really looks like reading from the tea leaves. Probably someone from SPARX could write a comment on how difficult it is to implement a better undo/redo (I guess it IS difficult, since if not they would have implemented it a long time ago  ;D).

Thomas

wmac

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Request: Undo/Redo enhance!
« Reply #17 on: March 12, 2004, 06:45:47 am »
angel-o-sphere,

Learned a lot from your post :)

I was thinking about these yeasterday so your post was very interesting. Thank you.

But again it seems we will need to have redesign of some parts. As program is being developed using MFC and VC++ I think it will not be very easy. But as I told later I think Sparx will need to do it at a time.

I wish they can manage to do so in next few versions.

Thank you again.

Mac

angel-o-sphere

  • EA User
  • **
  • Posts: 112
  • Karma: +0/-0
    • View Profile
Re: Request: Undo/Redo enhance!
« Reply #18 on: March 15, 2004, 01:46:22 am »
Thanx for the compliments  ::)

I'm sure it is not easy, as the general structure of the tool allready exists since some time.

However the "skin" of the appliation shows that it has an excellent internal quality, the incredible high release frequency support that asumption.

There is a rule of thumb: external quality follows internal quality :D So I would say the obvious high external quality implies high internal quality :D which makes the asumption that Sparx has allready a plan where to put such an improvement in the back hand.

Ooops, do you say "in the back hand" in english?

Regards,
    angel'o'sphere

thomaskilian

  • Guest
Re: Request: Undo/Redo enhance!
« Reply #19 on: March 15, 2004, 02:30:04 am »
Hi angel,
at least in german it is the same  :)

I guess you are right with most of your assumptions. But as there is still no response from Sparx here, I'm still some kind of disbeliever. However, I hope you are right in that last assumption too  :D

Cheers,

Thomas

thomaskilian

  • Guest
Re: Request: Undo/Redo enhance!
« Reply #20 on: March 15, 2004, 02:34:20 am »
Oh sh.. you are from Germany too  :o
I suspected you to be located in Italy (why?)

angel-o-sphere

  • EA User
  • **
  • Posts: 112
  • Karma: +0/-0
    • View Profile
Re: Request: Undo/Redo enhance!
« Reply #21 on: March 17, 2004, 01:59:49 am »
Yeah,

I'm from Karlsruhe, germany. Visit my web site if you like: www.oomnetor.de :D

Angelo

wmac

  • EA User
  • **
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: Request: Undo/Redo enhance!
« Reply #22 on: March 17, 2004, 08:44:22 am »
I had visited all pages of your website last week. As I  am planning to go for my MSc and perhaps PHD in Germany and I am learning Deutsch very seriously it was very interesting to me.

I will contact you later for advice on chosing the university later if I am not bothering.

Regards,
Mac


Sean Kearon

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Request: Undo/Redo enhance!
« Reply #23 on: March 24, 2004, 04:36:06 am »
Hrrrrrump........gently enters the scence.  All the above said, and interesting as it is, couldn't we just turn off the auto-saving in EA.  I'd like to control when I save.

:)

thomaskilian

  • Guest
Re: Request: Undo/Redo enhance!
« Reply #24 on: March 24, 2004, 06:04:16 am »
Hi Sean,
I guess there is no difference between the SAVE and UNDO problem since (almost) every operation is executed directly on the database. I'd also like to have both (control save and have undo/redo) but most likely it is simply too difficult for Sparx to implement that (no response so far - guess what I mean).  Bruce is most likely right in his assumption above :'(

Cheers,

Thomas

Sean Kearon

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Request: Undo/Redo enhance!
« Reply #25 on: March 25, 2004, 01:16:50 am »
Fair comment Thomas.  Howwever, given the sort of software Sparx produce, I would have thought it likely that it is tiered and loosely coupled under the hood, making the cacheing of middle-tier changes fairly simple.  We'll see!

Cheers

Sean