Toad World® Forums

Default values problem


#1

I managed how to set default values, for example table type for MySQL.
Default value is ‘Default’. This is wrong staring point but I will talk about it later.

Let’s do scenario:

  1. open new MySQL 5.1 model
  2. Make sure that default entity type is ‘Default’
  3. Create first entity
  4. Check entity type of created entity - should be ‘Default’
  5. Change Default value of entity type to InnoDB
  6. Create second entity
  7. Check entity type of created entity - will be ‘Default’ again

Question is: why ?

I’ve checked scenario in which def. type of entity is changed before creating the first entity. In that case, after creating entity the table type is set correct to InnoDB.

Using default values set to ‘default’ may be helpful in some cases. But:

  1. starting with these values you will never sure how DB will react on it. For example, on developer server, InnoDB is set as default and all relations and transactions will work as expected. But on production server there will be MyIsam set as default which will cause serious damage in data.

  2. Letting values to be default causes generating alter scripts feature simply useless. For example, ‘Default’ setting in model will be compared to real table type in database raising notification about differences.

Best regards

Message was edited by: Michal.K


#2

Hi Michal,

Once you define/change default values, you need to save the changes in My Package.txg file.
To load the changed package again and apply the new default values, you need to restart TDM.

So, restart TDM, open your MySQL model and create a new entity. See the new table type now.

Flash movie:
http://modeling.inside.quest.com/entry.jspa?externalID=3966&categoryID=158


Thanks for your opinion - 1 and 2. We will comment on them later.

Regards,

Vladka


#3

Sorry, I have to say it makes no sense for me.
If I need to create 20 InnoDB tables and 20 MyISAM tables, I have to restart application to get job easier?

Is it realy hard to apply default values without TDM restart (I don’t care how it is realized)? Come on! Even CS2 did that.
I’m really disapointed :frowning:

Message was edited by: Michal.K


#4

Hi Michal,

re default values usage: I don’t know what’s the reason for using InnoDB on dev server and MyIsam on production server (I think it makes sense to have both servers configured equally), but if you want to specify table type to e.g. InnoDB for tables in your model, you can do it.

The “Default” value is for customers who know how they servers are configured and don’t need to specify it in their models. When the default table type is changed for some reason in DB, it will not be necessary to change the values for entities in a model - and that seems to be a timesaver.

Re application restart: TDM offers you different ways how to do things. There are plenty of new features (incl. generation of alter scripts, naming conventions, templates, import from SQL script…) and because this is a new product (written from scratch) it works differently than CS2.

Please find attached package that will add another functionality to TDM. Instructions:

  1. Close TDM.
  2. Copy the package to folder with your custom packages (Click settings | Options, see node Paths and click tab Advanced. There is item “Path to Packages” - this is exactly the path where the package nees to be copied.)
  3. Run TDM and open any model for MySQL 5.0 or MySQL 5.1.
  4. Select any entity (or more entities) on your workspace, right click on it and choose the newly added item “Macros | Change Table Type”. New form will open. Specify your table type and click Execute. This way you can easily select 20 entities and set the table type to InnoDB for them and another 20 entities and set the table type to MyISAM. Etc. In case you realize that it would be better to use different table type than InnoDB or MyISAM, you can easily change the settings at once - for all selected entities. This is something what Default values - regardless of application restart requirements - won’t offer you.

TDM is highly customizable product, much more powerful than CS2 was and I hope you see that you can easily add features and additional functionality to it. In CS2, scripting and customization was limited.

Regards,

Vaclav

Message was edited by: modelingadmin
ChangeTableType.txg (3.33 KB)


#5

Hi Michal,

re default values usage: I don’t know what’s the reason for using InnoDB on dev server and MyIsam on production server (I think it makes sense to have both servers configured equally), but if you want to specify table type to e.g. InnoDB for tables in your model, you can do it.

The “Default” value is for customers who know how they servers are configured and don’t need to specify it in their models. When the default table type is changed for some reason in DB, it will not be necessary to change the values for entities in a model - and that seems to be a timesaver.

Re application restart: TDM offers you different ways how to do things. There are plenty of new features (incl. generation of alter scripts, naming conventions, templates, import from SQL script…) and because this is a new product (written from scratch) it works differently than CS2.

Please find attached package that will add another functionality to TDM. Instructions:

  1. Close TDM.
  2. Copy the package to folder with your custom packages (Click settings | Options, see node Paths and click tab Advanced. There is item “Path to Packages” - this is exactly the path where the package nees to be copied.)
  3. Run TDM and open any model for MySQL 5.0 or MySQL 5.1.
  4. Select any entity (or more entities) on your workspace, right click on it and choose the newly added item “Macros | Change Table Type”. New form will open. Specify your table type and click Execute. This way you can easily select 20 entities and set the table type to InnoDB for them and another 20 entities and set the table type to MyISAM. Etc. In case you realize that it would be better to use different table type than InnoDB or MyISAM, you can easily change the settings at once - for all selected entities. This is something what Default values - regardless of application restart requirements - won’t offer you.

TDM is highly customizable product, much more powerful than CS2 was and I hope you see that you can easily add features and additional functionality to it. In CS2, scripting and customization was limited.

Regards,

Vaclav

Message was edited by: modelingadmin


#6

Hi Michal,

re default values usage: I don’t know what’s the reason for using InnoDB on dev server and MyIsam on production server (I think it makes sense to have both servers configured equally), but if you want to specify table type to e.g. InnoDB for tables in your model, you can do it.

The “Default” value is for customers who know how they servers are configured and don’t need to specify it in their models. When the default table type is changed for some reason in DB, it will not be necessary to change the values for entities in a model - and that seems to be a timesaver.

Re application restart: TDM offers you different ways how to do things. There are plenty of new features (incl. generation of alter scripts, naming conventions, templates, import from SQL script…) and because this is a new product (written from scratch) it works differently than CS2.

Please find attached package that will add another functionality to TDM. Instructions:

  1. Close TDM.
  2. Copy the package to folder with your custom packages (Click settings | Options, see node Paths and click tab Advanced. There is item “Path to Packages” - this is exactly the path where the package nees to be copied.)
  3. Run TDM and open any model for MySQL 5.0 or MySQL 5.1.
  4. Select any entity (or more entities) on your workspace, right click on it and choose the newly added item “Macros | Change Table Type”. New form will open. Specify your table type and click Execute. This way you can easily select 20 entities and set the table type to InnoDB for them and another 20 entities and set the table type to MyISAM. Etc. In case you realize that it would be better to use different table type than InnoDB or MyISAM, you can easily change the settings at once - for all selected entities. This is something what Default values - regardless of application restart requirements - won’t offer you.

TDM is highly customizable product, much more powerful than CS2 was and I hope you see that you can easily add features and additional functionality to it. In CS2, scripting and customization was limited.

Regards,

Vaclav

Message was edited by: modelingadmin


#7

Hi Michal,

I guess you might be interested in this blog post that introduces quick method how to add new Table Type to TDM GUI.

http://blogs.inside.quest.com/modeling/2009/09/21/customization-how-to-add-new-table-type-option-to-mysql-models/

BTW: Similar customizations of forms and GUI were not possible in CS2.

Have a nice day,

Vaclav


#8

Thanx for reponse.

To be honest I dont want to be tools developer. And don’t want to care about customization of milion hidden features. If there are present ready to help - superb. But should be defaulted to values which makes sense for most cases.
I want application to be ready to help me as much as it is able. CS2 did that for 10 years.

Now I fight with issues. So quick answers:

  1. if you are developing software for wide range od destination servers, you can’t expect that all ones will be configured in the same way. That’s why leaving table type as ‘default’ is wrong

  2. Using default values like table types is wrong from design theory point of view

  3. As I illustrate it in the first post of this thread, using default values makes problems while comparing model to the database. Basicaly this feature is useless in this case. If I’m wrong - I’ll be happy to know how to do that with success

These are reasons why using default values by default is a wrong way in overal. If some one think it may help - I can agree but only in specific cases and developer should select it implicitly.

You show me I can change table type for selected group of entities. Yes, I can do that. As I can do that in a lot of other ways. But why makes things more complicated if it should be strightforward and intuitive and require no additional action (without serious reason).

I know TDM (CS3) is quite new. I know that it may be a reason of some bugs. I’m developer/programmer also so I know that bug-free software doesn’t exist.
But why to change ways to achieve things which was perfected for years making them more complicated for end-user.

Again: forcing user to restart whole application after some parameter changes is realy crazy. There is even no any message about it. User hits Apply button which gives him idea that it will be work immediately and he expects it.

BTW: event if entity properties provide combobox with choice of table types, Default value provides text box only. Why not combo box?

best regards

Message was edited by: Michal.K


#9

Hi Michal,

I only wanted to show you that we have a solution for some “missing” features or specific user scenarios. If you used competitive tools you would have to wait for months or years to get what you want - just because your requirement might get low priority or was in conflict with requirements from other users. With TDM this is not the case. Do you need something specific? Do you wish to get new functionality quickly? Use our scripting, write new macros. (We will be glad to help.)

As a developer you know that you cannot do everything for everyone… TDM allows you to get what you need relatively quickly - at least you have the possibility.

Back to topic: There are users who think the “Default” item is useful. If you don’t like it, don’t use it - you are right, there are situations where it doesn’t make sense to use it, e.g. comparison - but this is not the only possible scenario.

Re CS2. The tool did a great job, however, there were limitations and if we continued with CS development we wouldn’t be able to offer some important and frequently required features. I believe TDM can help much more than CS2, e.g. in area of Generation of Alter Scripts, Model Update, Model Merge, Import form SQL Script, writing stored procedures, triggers… etc.

Re your questions:

  1. If you have no control over the servers, don’t use the “Default” item. That’s probably all I can recommend now. But I believe there is no reason to remove it from GUI because it is useful in other scenarios.
  2. Our ToDo list is pretty long. Some features are not perfectly tuned. I hope they will be, once. But it’s a matter of product evolution :slight_smile:
  3. Don’t use the “Default” item. Define your table type for every table manually - or via our macro, if you find it useful.

Sometimes you simply cannot use newer technology the same way old technology was used. For many reasons. Our aim is to make the product as useful as possible. But also our aims are affected by other factors.

Re combo box: The Default Values dialog is new in version 3.5. There are things that will be improved. Some features will be improved by us. Some features can be added via customization and macros, including customization of forms. I bet there is no other modeling tool in similar price range that allows you to do so much as TDM :slight_smile: And I also bet you will find “useless” features in products that cost thousands of USD.
Regards,

Vaclav

Message was edited by: modelingadmin Message was edited by: modelingadmin

Message was edited by: modelingadmin