Wang Tong Yin
|
|
Group: Forum Members
Posts: 25,
Visits: 46
|
Hi,
I have some doubts about using StrataFrame for web application.
1. Can StrataFrame automatically check for duplicate record if a user trying to add new record into a table? Do I need to add my own sql to check it?
2. Can StrataFrame autimatically check whether the record is referenced in child table before update/delete? Do I need to add my own sql to check it?
3. How can I retrieve the foreign key description from another table? Does StrataFrame provide any special function to do that?
Thanks.
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
Howdy, 1. Can StrataFrame automatically check for duplicate record if a user trying to add new record into a table? Do I need to add my own sql to check it? No, StrataFrame will not automatically check for a duplicate record within SQL Server when a new record is created. You can easily create a method that retrieves the count of the records from the server that conflict with the current record and test the count within the CheckRulesOnCurrentRow event handler. 2. Can StrataFrame autimatically check whether the record is referenced in child table before update/delete? Do I need to add my own sql to check it? StrataFrame will check the child table to a degree: when a child business object saves and it's parent business object is dirty, the child will force the parent to save first. Business objects will not, however, cascade DELETEs or UPDATEs and it is recommended to do that through the Foreign Key on SQL Server. 3. How can I retrieve the foreign key description from another table? Does StrataFrame provide any special function to do that? StrataFrame does not detect the foreign keys within SQL Server and create the relationships between the business objects. The relationship must be manually created through the component designer for the business object. There is a type editor that handles the relationship definition which reduces the time needed to define it to less than 30 seconds. Once the relationship has been defined on the business object, however, you can easliy retrive the description for it at runtime and/or through code.
|
|
|
Wang Tong Yin
|
|
Group: Forum Members
Posts: 25,
Visits: 46
|
Hi Ben, Thank you for your answer. I got some ideas on how to do the above. StrataFrame will check the child table to a degree: when a child business object saves and it's parent business object is dirty, the child will force the parent to save first. Business objects will not, however, cascade DELETEs or UPDATEs and it is recommended to do that through the Foreign Key on SQL Server. Is that all types of databases have cascade DELETEs or UPDATEs functionality? What I need to do if the database not supports this functionality?
|
|
|
StrataFrame Team
|
|
Group: StrataFrame Developers
Posts: 3K,
Visits: 2.5K
|
If the database does not support the functionality to cascade DELETE callls (I know that VFP, Access, MSSQL, Oracle, VistaDB, MySQL, PostgreSQL, etc. all do), then you can add a handler within the business object to the AfterDelete event and delete the child records within that event.
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
StrataFrame does not detect the foreign keys within SQL Server and create the relationships between the business objects. The relationship must be manually created through the component designer for the business object. There is a type editor that handles the relationship definition which reduces the time needed to define it to less than 30 seconds. Once the relationship has been defined on the business object, however, you can easliy retrive the description for it at runtime and/or through code. Hi, Usually, we have more than 100 tables. To create each of them, it would take 3000 secs = 50 hours to do it. Also, I would think auto-create BO, default value, required fields would also save us alot of time. Thank you
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
I appreciate your point, Chan. First, we are all for as much automation and speed as possible and this is something that has already been discussed for future SF releases (possiblly next major release 2.0). However, StrataFrame allows you to setup relationships between BOs that does not exist within the SQL structures. There needs to be a very integrated and customizable BO creation tool that ties into VS and gives the developer the most control as possible. Automation generally takes more control away from the developer, so before we implement something like this, there is a lot of foundational work that needs to be done to allow developers the same type of flexibilty that currently exists which still achieving the benefits of automation. So rest assured that there will continue to be more automation features implemented into SF, but this particular feature will not be feasible until the next major release of SF.
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi, Thank you for your clarification. May I know when would SF 2.0 live, quarter 4th or next year? :p Thank you
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
We do not have a firm release date for 2.0. It will be after Orcas has been released. As always, we will keep our users informed of things to come. Just as a side note, I do not understand why it takes so long for you to create your business objects. I understand that logic and Fill methods may grow over time, but our most complex BO within our medical software did not take 50 minutes (3000 seconds) to create. In fact, the average BO only takes 5 minutes or less to create, setup custom Fill or Scalar methods, and add the business checking logic.
|
|
|
Chan
|
|
Group: Forum Members
Posts: 533,
Visits: 2K
|
Hi, I usually take 30-50 secs to setup one BO. However, there are at least 120 BOs to be created for now.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
I understand, but generally speaking you don't use all 120 at once. We have more than that in our medical system, but we don't use them all at once. It would be a rare circumstance that all 120+ BOs are used within the same forms or dialogs. So this should be one of those things that is drawn out over the duration of your application development.
|
|
|