Event Handlers


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Actually Daniel, the Business Object Mapper will remember the state you leave it in the next update.  Also, the Business Object Mapper window position is remembered as well.  This way you can set the display to your liking and it will be remebered for your next session.  The best of all worlds! Smile
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
Thank you. Being able to make a global change will be helpful. I now also see why I was so confused before. On the individual table properties in the mapper, the namespace appears in a field that is not editable. I just discovered that if you expand the advanced options, the namespace appears again in a field that is editable.



That property dialog is not so large. Would it be useful to just show the whole thing all the time rather than to deal with the show and hide function?
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
A change has been made to the Business Object Mapper that gives you (the developer) three options when changing the default namespace of a Business Object Mapper project.  First, the new namespace can be updated on all business objects within the project.  Second, only business objects that have the same namespace as the old namespace can be updated.  And last, the individual business objects namespace can be left alone.

This will be available in the next update.

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Daniel,



Change the namespace on the individual business object itself and the changes will take effect. The Default namespace for the BO Mapper project is used when a new business object is associated with a table. But we allow the developer to overwrite individual business objects namespace to allow business objects within the same project to exist in different namespaces. We might look at adding a "Change All" function that changes the individual business objects namespace when changing the default namespace. But as of right now, the BO Mapper works as designed. The reason we do not make a blanket change to all business objects when the default namespace is changed is to allow the developer to have control over the namespace of each individual business object and it could cause far more problems if we arbitrarily changed the individual items. However, we may add an option that allows the developer to "Change All" existing business objects since I can see how this could be helpful.
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
This is a helpful summary.



The problem I am describing occurs after you do all of that.



IF you change your mind about the namespace and

a) edit the vs2005 default namespace AND

b) edit the project namespace in the BO Mapper AND

c) "rebuild all"

THEN

the changed namespace in the BO Mapper does NOT get pushed down into the definitions of the existing BO's in the database.



The result is that "rebuild all" regenerates xx.designer.cs files that each have the original namespace, not the current one. The projects then fail to compile because one part of the partial class (xx.cs) is in a different namespace from the other partial class (xx.designer.cs). The definitions of the event handlers and the code that uses them end up in different namespaces making the definitions invisible to the code that references the event handlers.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Since C# automatically uses a namespace when an object is created the Business Object Mapper project should be setup with a default namespace to help avoid this issue.  There are several ways to achieve this, the default namespace for the Business Object Mapper project or by overriding the namespace for each business object individually.

Let's assume the namespace of the project (and the business object's .cs file) is MyNameSpace.  To set the default namespace for all business objects when they are mapped, do the following:

1.) Open the Business Object Mapper
2.) Click on the project that needs to be modified
3.) On the configuration panel on the right, click Modify Project Properties
4.) Set the default namespace to match the namespace of the C# project.
5.) Rebuild the partial classes.

This will create the partial class with the namespace you just specified in the "default namespace" property.  To make sure the partial was generated properly open the business objects .designer.cs file and look for the namespace tag.  This will be set to the specified setting from above.  Open the business objects .cs file and make sure the same namespace is specified. 

Phantom Business Object

The phantom business object only appears within the Business Object Mapper when the namespace in the business object's .cs class does not match the namespace in the business object's .designer.cs.  This is usually due to an invalid namespace specified in the Business Object Mapper as mentioned earlier.

Bottom Line
The bottom line is that the namespace MUST match in both class files that comprise the business object.  Verify that the namespaces match and this will remove the "Phantom" business object.

Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
More...



The problem is that when the BO Mapper first processes a new BO it puts the current default namespace into each record in DTEPreferences in the StrataFrame database. If you subsequently edit the namespace property of the project, the edit does not propagate to DTEPreferences.
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
What I meant to say is that after changing the default namespace for the project and the default namespace in the BO mapper, the mapper is still generating namespaces that reference the name that I initially supplied to the mapper but subsequently altered.



It seems to have a memory for the phantom, obsolete name in preference to the name that now shows in the property form when generating code.
Daniel Essin
Daniel Essin
StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)StrataFrame User (339 reputation)
Group: Forum Members
Posts: 235, Visits: 309
More additional info:



I got it backwards. the bo.cs is either generated correctly or not touched, the bo.designer.cs is generated incorrectly.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You're using C#, and the Namespace defined within the configuration for each business object within the Business Object Mapper does not match the namespace of the business object's main code file. So, when the designer file is created, it's created in a different namespace...



We're working on removing the namespace requirement from the Business Object Mapper so that it will just use the namespace of the main code file, but in the mean time, you will have to configure your business objects with their proper namespace in the Business Object Mapper.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search