Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WorkShop Feedback - Business Process Logic
Message
From
28/01/2011 16:43:23
Richard Henning
Henning Software, Inc.
Ohio, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
WorkShop Feedback - Business Process Logic
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Database:
MS SQL Server
Miscellaneous
Thread ID:
01497714
Message ID:
01497714
Views:
101
Kevin,

Well done! Your mm workshop was a much better class for me, a 2 year mm user, because it focussed more on coding. I just needed to see more of the hands-on coding knowledge provided in this workshop rather than power point theory so I can hit the road knocking out mass quantities of code again.

I like the entity framework integration you have achieved, and your hands-on working examples of how to work with it in conjunction to mm business objects, updating the database structures and such. I am almost glad you ran into challenges that you needed to work through. This was also helpful to see how to resolve stuff, like the little tricks of generating the database to get the Entity relationships built after manually adding a new column to the SQL database and then to the Entity Diagram.

I wish we could have spent a little more time on the process class. I still am struggling with the best place to put my process code when working with a new entity that has not yet been persisted to the database. Your process examples in the help file show using a Getbyorderid method to get entities which is all good when processing things that have already been saved.

QUESTION:

But the question I still have is how do I properly process the entity that is memory not yet saved?

For example…

1) If I click the NEW button to create a new OrderDetail entity
2) And I want to dynamically calculate the order detail item that has not yet been persisted to the database
3) For example: I want to automatically calculate the extended price of the order line item anytime the order quantity or unit price is changed in the UI so I can immediately display the result to the end user in the UI… where do I put this code?
a. Logically, I would create a CalculateExtendedPrice method in the OrderDetail Controller to calculate the extended price
b. And because I may have other calculation methods related to the line item like, Calculate Discount Unit Price, Calculate Commissions and such…
c. I would want to create individual Methods for each one of those also… and then in my mind I would create a Order Details Process that calls each of the required methods to calculate all the things related to the order detail processing.
d. But if I want to perform this Order Detail calculation on Order Detail Entity that is still in memory before saving it to the database because they have not clicked the SAVE button, how do I do this?
e. Do I pass a reference to the current entity that I am working with to the process to allow its properties of the working entity to be updated via the process so they can be rendered to the UI, and before the user clicks the Save?
f. Or do I save the entity and then call it back up to calculate its calculated values and resave it? If I save it first, then how can the user use the Cancel?
g. I also want to know how to trigger the calculation process anytime quantity ordered or unit price property change event is raised. And now that we are using the Entity Framework where do I put the call out to the Order Detail process? It seems like I should be tied the SET methods of the Quantity and Unit Price properties to trigger it. Or do I put the call out In the Rules.Partial class, or a hook method?
4) I know these questions probably seems simple to you but I just want to make sure I am putting the code where you think it belongs to keep your model pure.
5) Any "best practices" recommendations you can provide on this would be most helpful.

But overall I would have to say that was a great workshop. We probably could have used another day to cover your ambitious agenda. But the core was covered and I really liked how 90% of the class was spent writing code.

I also really liked how you have evolved the Silverlight code generators for the RIA Service. Your generated code eliminates the need for us to have manually override Microsoft’s service. Great Job. I am assuming we will see a similar code template on the proxy side also in a future release. Your example did give us a good working idea of how a developer can make all the needed layers of programming work together. Very exciting stuff.

Also… I don’t agree with those that think that we should be using Visual Studio for editing WPF and Silverlight windows. It is just to quirky as witnessed... having to constantly fight the bugs in VS 2010 IDE. Maybe you can offer an alternative workshop that focuses just on using Expression Blend 4 for window editing, simple animations style creation at some point too.

Thank you.

Warm Regards,

Rich Henning
President
Henning Software, Inc.
Reply
Map
View

Click here to load this message in the networking platform