publisher/subscriber pattern


Author
Message
Larry Caylor
Larry Caylor
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K
Have you considered implementing a publisher/subscriber pattern in the framework? For example, in your sample application I would like the Order Entry form to be able to subscribe to a customer change on the Customer Maintenance form that would allow the Order Entry form to update itself to reflect that change.
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
The framework doesn't have that pre-plumbed, but we engineered all of the hooks to be event-based rather than method overloads, so you can attach to them from anywhere rather than only within the business objects. So, your OrderEntry business object could attach to an event on the CustomerMaintenance form or to a business object on the CustomerMaintenance form and should be able to achieve exactly what you're after.
Larry Caylor
Larry Caylor
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

I’m missing something when it comes to the handling of objects within the framework.  I’m using VB .Net and the sample Windows application that came with the framework.

 

As suggested in the previous post for simulating a publisher/subscriber pattern, I attached the Order Entry form to the After Save event in the CustomerMaintenance form. When I start the application I open the Order Entry form and start to add a new order, stopping after I select a customer. At that point the OrderEntry.Customers is set to the selected customer. Next I open the Customer Maintenance form and select the customer record that was selected in the Order Entry form, edit it and save it. At that point the After Save event on the Customer Maintenance form transfers control to the event handler sub that I added to the Order Entry form. So far so good. But when I set a break in the event handler OrderEntry,Customers is not set to a reference of an object. This is where I’m getting lost.

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Sorry for the delay in response, Larry, I was at a wedding in New Mexico, and just got back in. Are you using an AddHandler call, or are you using the implicit call to AddHandler using the Handles keyword after the sub? I'm trying to figure out where the event handler is getting attached, and what instances of the forms and business objects are being used. You might also post any relevant code snippets from what you added...
Larry Caylor
Larry Caylor
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

Ben,

 

Hope you had a great time New Mexico. It’s been raining cats and dogs here in Santa Cruz, CA so I’ve had a lot of time to work with StrataFrame over the weekend. I’m using an AddHandler call and when I first tried to link up the events I had a “brain dead” moment and ended up adding an event handler that created a new instance of the OrderEntry form instead of handling the event on the existing object. Once I got that sorted I was able to accomplish what I wanted.

 

I also like applications that validate business rules on a character-by-character basis rather than waiting until you tab off a field. I was very happy to find out how easy that was to do by having the ObjectMapper generate events that I could trap in the form and call RulesCheck.

 

The more I work with SF the better I like it. However more detailed doc would be welcomed. A tutorial that builds a sample app would probably help people get their minds around this product. I’m used to working more in code and it’s taking me awhile to get used to working with properties windows. When trying to figure out how something works I have to remember to look at the properties rather than reading through the code, there just isn’t that much of it! Of course that’s the beauty of this framework.

 

-Larry

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Larry,



I'm glad you figured out your event handler problem. As for tutorials, we're adding a section to the "Getting Started" in the documentation that is titled "Tutorials," so, they're on the way. As for the changed events, we put them in there for that exact purpose. Also, if you want complete bi-directional binding, you have to use the "Changed" events so that when you set the field property in code, the changed event gets raised and the data is pushed out to the control.
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