Confused: WCF vs MSMQ with CSLA

Confused: WCF vs MSMQ with CSLA

Old forum URL: forums.lhotka.net/forums/t/6152.aspx


gidzone posted on Wednesday, January 14, 2009

Hello,

In order for external users to register to use our application they need to be approved by an internal resource.  Submitting the registration and approving the registration are performed in two seperate applications.

I want to use windows workflow to manage this registration process.  I wanted to create a service on top of our registration workflow to abstract from it both applications.  My idea was to create a command object which would place an object on MSMQ.  On the other end have a windows service read the queue and perform the function associated.  I got this concept from this post: http://forums.lhotka.net/forums/post/15944.aspx

I am not sure whether I should drop a message on an MSMQ directly or have a WCF service perform this function as well as all other functions a part of this process?  I have never used WCF before and I am confused how it can fit in our application architecture (if at all).

thanks!

-sanjay

RockfordLhotka replied on Wednesday, January 14, 2009

Using queued messaging to enable async processing for parts of an application can be very useful.

Also, if you have 2+ applications that work together to provide some overall solution, the concepts of SOA can be very useful, especially the idea of message-based communication.

Finally, if you want to use workflow to build a service, Microsoft will like you a lot :)  Microsoft is putting a lot of energy into making WCF and WF work well together, with the idea that the preferred way to build a WCF service is by using WF. You can see their effort in VS 2008 with the increased integration between WCF and WF, and in some of the things they've been discussing around VS 2010 and .NET 4.0 in that regard.

So while you can use MSMQ directly through the System.Messaging namespace, your life will probably be easier (in the long run at least) if you take the time to learn how to build a WCF service using WF, because Microsoft will do more of the plumbing work for you in that case.

I'd recommend reading Juval Lowy's WCF book, and Michelle Bustamante's WCF book to get started.

gidzone replied on Wednesday, January 14, 2009

Thanks Rocky.  I'll start down the WCF+WF path and keep you guys updated of my progress.

-sanjay

gidzone replied on Friday, January 16, 2009

I ended up creating a state machine workflow exposed as a WCF service.  If you know windows workflow, it was pretty easy to do once you get the basics of WCF down.

Whats the best practice to call the WCF service that interacts with the workflow?  Should I create a wrapper class around the svcutil generated class or call the generated class directly?

thanks!

-sanjay

RockfordLhotka replied on Friday, January 16, 2009

In my view, calling a service is no different from calling a stored procedure. In other words, services should be called from within DataPortal_XYZ methods of business objects.

 

In some cases a service isn’t really a CRUD operation, but that’s what the CommandBase is for – creating objects that represent the concept of performing an action.

 

That’s the real key I think – is to remember that your presentation/UI layers should always and only interact with an abstract set of business object that represent the concept required by your application. Any sort of complex behaviors should be abstracted behind those objects.

 

Rocky

 

 

From: gidzone [mailto:cslanet@lhotka.net]
Sent: Friday, January 16, 2009 10:41 AM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Confused: WCF vs MSMQ with CSLA

 

I ended up creating a state machine workflow exposed as a WCF service.  If you know windows workflow, it was pretty easy to do once you get the basics of WCF down.

Whats the best practice to call the WCF service that interacts with the workflow?  Should I create a wrapper class around the svcutil generated class or call the generated class directly?

thanks!

-sanjay


gidzone replied on Friday, January 16, 2009

Thanks Rocky!

After I posted my question I realized thats why CommandBase exists.

If anyone needs help with creating WFs exposed as a WCF service, I'd be more than happy to help.

-sanjay

Copyright (c) Marimer LLC