<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>Microsoft Spain - Domain Oriented N-Layered .NET 4.0 Sample App</title><link>http://microsoftnlayerapp.codeplex.com/project/feeds/rss</link><description>Local initiative driven by Microsoft - Spain</description><item><title>New Post: Development of Microsoft Spain</title><link>http://microsoftnlayerapp.codeplex.com/discussions/436183</link><description>&lt;div style="line-height: normal;"&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;Could be! &lt;/span&gt;&lt;span style="font-size:11.0pt; font-family:Wingdings; color:#1F497D"&gt;J&lt;/span&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;Send me an email (to cesardl at microsoft.com) so we plan offline, ok?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;There are quite a few things we could do..
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;Cheers,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;Cesar.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a name="_MailEndCompose"&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in"&gt;
&lt;p&gt;&lt;b&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>cesardl</author><pubDate>Tue, 21 May 2013 23:50:06 GMT</pubDate><guid isPermaLink="false">New Post: Development of Microsoft Spain 20130521115006P</guid></item><item><title>New Post: Development of Microsoft Spain</title><link>http://microsoftnlayerapp.codeplex.com/discussions/436183</link><description>&lt;div style="line-height: normal;"&gt;Cesar,&lt;br /&gt;
&lt;br /&gt;
Would you like any help on getting this Project going forward? I really would like to help so submit patches or anything else I can do to keep this Project going...&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Tue, 21 May 2013 22:33:43 GMT</pubDate><guid isPermaLink="false">New Post: Development of Microsoft Spain 20130521103343P</guid></item><item><title>New Post: Is it wise to abstract the entities?</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443956</link><description>&lt;div style="line-height: normal;"&gt;Nice to hear that :)&lt;br /&gt;
&lt;br /&gt;
Cesar, if you could have a look at these thread, I will appreciate:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://microsoftnlayerapp.codeplex.com/discussions/444470" rel="nofollow"&gt;Infrastructure.Logging - EventSource&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://microsoftnlayerapp.codeplex.com/discussions/264445#post1044113" rel="nofollow"&gt;WCF Error Handler&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Tue, 21 May 2013 21:08:19 GMT</pubDate><guid isPermaLink="false">New Post: Is it wise to abstract the entities? 20130521090819P</guid></item><item><title>New Post: WCF &amp; Exception Handling Improvements for V2.0</title><link>http://microsoftnlayerapp.codeplex.com/discussions/264445</link><description>&lt;div style="line-height: normal;"&gt;I figured out by myself:&lt;br /&gt;
&lt;br /&gt;
I have changed the code from :&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ApplicationErrorHandler.ProvideFault&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;//create service error
ApplicationServiceError defaultError = new ApplicationServiceError()
{
   ErrorMessage = Messages.message_DefaultErrorMessage,
};&lt;/code&gt;&lt;/pre&gt;

&lt;strong&gt;To:&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;//create service error
ApplicationServiceError defaultError = new ApplicationServiceError()
{
   ErrorMessage = error.Message // Modified to include the exception raised
};&lt;/code&gt;&lt;/pre&gt;

I have changed this so my custom exception type (DomainException) get forwarded to the client. (Of course I am forwarding only known exception - my custom type)&lt;br /&gt;
&lt;br /&gt;
At the client:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;try
{
     // Call proxy.Action
}
catch (FaultException&amp;lt;ServiceError&amp;gt; ex)
{
   properties.Status = SPEventReceiverStatus.CancelWithError;
   properties.ErrorMessage = ex.Detail.ErrorMessage;
}&lt;/code&gt;&lt;/pre&gt;

Thank you very much!&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Tue, 21 May 2013 21:07:15 GMT</pubDate><guid isPermaLink="false">New Post: WCF &amp; Exception Handling Improvements for V2.0 20130521090715P</guid></item><item><title>New Post: Is it wise to abstract the entities?</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443956</link><description>&lt;div style="line-height: normal;"&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;Thanks a lot for the feedback Bruno!
&lt;/span&gt;&lt;span style="font-size:11.0pt; font-family:Wingdings; color:#1F497D"&gt;J&lt;/span&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;I agree with your comments, of course.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="ES" style="font-size:11.0pt; font-family:"&gt;Cesar de la Torre.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="ES" style="font-size:11.0pt; font-family:"&gt;Microsoft Corp&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a name="_MailEndCompose"&gt;&lt;span lang="ES" style="font-size:11.0pt; font-family:"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in"&gt;
&lt;p&gt;&lt;b&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>cesardl</author><pubDate>Tue, 21 May 2013 19:42:16 GMT</pubDate><guid isPermaLink="false">New Post: Is it wise to abstract the entities? 20130521074216P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;Well,&lt;br /&gt;
&lt;br /&gt;
I have to tell you the &amp;quot;inconvenient&amp;quot; is a word that leads me to &amp;quot;maintenance problems in the feature&amp;quot; in your case.&lt;br /&gt;
&lt;br /&gt;
I mean, every time you need something different on your View, you have to change your domain behavior. Is that correct?&lt;br /&gt;
&lt;br /&gt;
Every time you need diferente business logic that may change properties of na existing entity, you would have to change every view that uses it.&lt;br /&gt;
&lt;br /&gt;
Again: DTOs are not &amp;quot;for convenience&amp;quot; only. If you use them correctly and also create a Service Layer Approach you would benefit of separation of concerns.&lt;br /&gt;
&lt;br /&gt;
I know its hard to build things &amp;quot;right&amp;quot;. But thats the price to pay for a good system.&lt;br /&gt;
&lt;br /&gt;
You can do it step-by-step. A very good approach is: REfactor your code as you have new features. Like: Every time you &amp;quot;touch&amp;quot; one class, refactor it to use DTOs. And when you realize, everything would be using it. So you can start phase 2 and create na intermediate layer like na AppService (from DDD).&lt;br /&gt;
&lt;br /&gt;
I think you are not doing DDD right on App Layer. The App layer should be a mediation between Presentation (user) and the domain layer. You have the domain layer right on presentation.&lt;br /&gt;
&lt;br /&gt;
If you want to have the benefits of DDD, my advice is to refactor your code slowly...but create a goal and work for it :)&lt;br /&gt;
&lt;br /&gt;
Any help you need let me know&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Tue, 21 May 2013 19:10:25 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130521071025P</guid></item><item><title>New Post: Is it wise to abstract the entities?</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443956</link><description>&lt;div style="line-height: normal;"&gt;Hi Alex,&lt;br /&gt;
&lt;br /&gt;
Sorry for the delay, but I am on a busy month (as Always) :)&lt;br /&gt;
&lt;br /&gt;
My suggestion for you is: &lt;strong&gt;Embrace DDD and NLayerAppV2 as much as you can&lt;/strong&gt;. &lt;br /&gt;
It will help you a lot if your system is intended to have a very long lifecycle and will stay there for a while.&lt;br /&gt;
&lt;br /&gt;
I am working on a system I can call it medium/big and the advantages are so huge I cant think how I could work without these Technologies and approaches.&lt;br /&gt;
&lt;br /&gt;
I am still on a learning courve, but I think I have solid practical implementations of NLayerAppv2-like Project by now. I am not using CQRS yet (still to come in next months). I am using Sharepoint 2013 to behave as my &amp;quot;Message Bus&amp;quot; and also for Presentation and sometimes App layer.&lt;br /&gt;
&lt;br /&gt;
The thread you mentioned above was initiated by me a while ago. I was discussing with Cesar regarding basic methodology to get the hands on Bounded Contexts, Modules and others DDD terms in practical.&lt;br /&gt;
&lt;br /&gt;
I will be very gratefull if I can help you guys in anything you need to design or code your app. I can do my best to provide you my suggestions and experiences :)&lt;br /&gt;
&lt;br /&gt;
Again: I would definitely go for DDD and services-aware approach for a big solution as you are intended to build.&lt;br /&gt;
Regardless if current products do it or not. They may have tons of reasons to build the way they do: time, legacy versions, compatibility, lack of DDD maturity at the time of development, and many others.&lt;br /&gt;
&lt;br /&gt;
So my final word is : Go for DDD, period. Talk to your business, define your entities/modules/bounded contexto and use NLayerAppV2 as a tech guide. Im sure you'll be happy in the future.&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;br /&gt;
P.S.: Feel free to share anything else or popup any other doubts/questions.&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Tue, 21 May 2013 19:02:45 GMT</pubDate><guid isPermaLink="false">New Post: Is it wise to abstract the entities? 20130521070245P</guid></item><item><title>New Post: Infrastructure.Logging - Event Source</title><link>http://microsoftnlayerapp.codeplex.com/discussions/444470</link><description>&lt;div style="line-height: normal;"&gt;Hi Cesar,&lt;br /&gt;
&lt;br /&gt;
By now, I have almost 95% of my Project implemented according to NLayerAppV2.&lt;br /&gt;
&lt;br /&gt;
Have to say: Its wonderfull. It really helps. Thanks a lot. And congratulations for the good work so far.&lt;br /&gt;
&lt;br /&gt;
I have one question regarding ILogger:&lt;br /&gt;
&lt;br /&gt;
Would you think its a good idea to create a method at ILogger interface to set the source string for a event log ? That would help a lot.&lt;br /&gt;
&lt;br /&gt;
Like SetSource(string sourceName) so  we can use it for eventlogs (Windows) , filenames (Text) and so on.&lt;br /&gt;
&lt;br /&gt;
Would like to know your thoughts about it.&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Tue, 21 May 2013 18:50:23 GMT</pubDate><guid isPermaLink="false">New Post: Infrastructure.Logging - Event Source 20130521065023P</guid></item><item><title>New Post: Is it wise to abstract the entities?</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443956</link><description>&lt;div style="line-height: normal;"&gt;Hi Bruno,&lt;br /&gt;
&lt;br /&gt;
No. We are not going to build on top of any CRM. I wanted to give an example to clarify the type of our application. So, it would be a completely separated application with almost the same functionalities as most CRM applications.&lt;br /&gt;
&lt;br /&gt;
Alex&lt;br /&gt;
&lt;/div&gt;</description><author>Cyberdude3</author><pubDate>Fri, 17 May 2013 09:14:38 GMT</pubDate><guid isPermaLink="false">New Post: Is it wise to abstract the entities? 20130517091438A</guid></item><item><title>New Post: Is it wise to abstract the entities?</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443956</link><description>&lt;div style="line-height: normal;"&gt;Hi Alex,&lt;br /&gt;
&lt;br /&gt;
Are you going to build your App on top of Microsoft CRM or would it be a completely separated app?&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Fri, 17 May 2013 00:59:46 GMT</pubDate><guid isPermaLink="false">New Post: Is it wise to abstract the entities? 20130517125946A</guid></item><item><title>New Post: Is it wise to abstract the entities?</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443956</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
We want to build an enterprise application which does have many CRM functionalities. And we are stuck with a very important architectural decision. When we look at Microsoft CRM 2011 we see that all entities are in the database. It looks like that there is a huge abstraction layer similar to CMS has been build and used to build the application. As the result without using SDK, a programmer should write code like dynamic[&amp;quot;Account&amp;quot;] to get the customer instead of just write Account acc = new Account().&lt;br /&gt;
Well, we don't want to rebuild the MS CRM, we just want to know is it wise to build an application which &lt;br /&gt;
1- has multiple different UI and services (mobile app, windows service, asp.net mvc web)&lt;br /&gt;
2- has accounts, products, orders, bills, discount and that kind of entities&lt;br /&gt;
3- and the products has many different attributes and dependencies on each other&lt;br /&gt;
&lt;br /&gt;
with an CMS?&lt;br /&gt;
Because to me, a CMS makes entities abstract by defining each as a as content. So you could see all entities in the some database table of the CMS. Just like most CRM's have.&lt;br /&gt;
&lt;br /&gt;
Or we could use an architecture like this great example of Domain Oriented N-Layered sample application. When we do that, we will use entlib 6.0 and Unity 3.0 as well and build WebApi's for all type of client app's.&lt;br /&gt;
&lt;br /&gt;
I know that without the knowlegde over the domain nobody can make such decision or advice. But see it as a CRM application.&lt;br /&gt;
By the way this post &lt;a href="https://microsoftnlayerapp.codeplex.com/discussions/431320" rel="nofollow"&gt;https://microsoftnlayerapp.codeplex.com/discussions/431320&lt;/a&gt; was also help for us. But didn't make the decision any easier :-)&lt;br /&gt;
&lt;br /&gt;
Any help would be greatly appreciated.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Alex&lt;br /&gt;
&lt;/div&gt;</description><author>Cyberdude3</author><pubDate>Thu, 16 May 2013 19:08:25 GMT</pubDate><guid isPermaLink="false">New Post: Is it wise to abstract the entities? 20130516070825P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;Hello!&lt;br /&gt;
I understand you now! :)&lt;br /&gt;
Yes, this is a inconvenient but this is not compensable work involved in creating DTO project where there are many entities (97 in this and 192 on the other we have with DDD). Is there any way of linking OFF, automatically create them, etc. ..?&lt;br /&gt;
&lt;br /&gt;
Thanks for all!! :) it's a great conversation with u :)&lt;br /&gt;
&lt;/div&gt;</description><author>fjaumot</author><pubDate>Thu, 16 May 2013 18:41:41 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130516064141P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;&lt;strong&gt;fjaumot wrote:&lt;/strong&gt;&lt;br /&gt;
&lt;blockquote&gt;
Hello Bruno, !&lt;br /&gt;
Beacuse I need the DTO? I dosen't understand this.&lt;br /&gt;
I have,&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;
UX (mvc)&lt;br /&gt;
Project.BackOffice (ViewModel, Controller, Js, View...)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
Application&lt;br /&gt;
Project.Application (use repositories and entities)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
Domain&lt;br /&gt;
Project.Domani.Entities (Created by t4 and used in Application and UX)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
Data&lt;br /&gt;
Project.Data (EDMX, Context (t4) with UnitOfWork and Repositories)&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;
I dosen't understand because I need to use DTO... Because I dosen't use POCO Entities??&lt;br /&gt;
&lt;br /&gt;
Thank you!!&lt;br /&gt;
&lt;/blockquote&gt;
Because, in my opinion, you should never use Domain Entities outside the domain and Application Layers.&lt;br /&gt;
&lt;br /&gt;
Simple example: If you have &amp;quot;full rich entities&amp;quot;  right at the controller, why do you have Application layer? &lt;br /&gt;
&lt;br /&gt;
For example, lets say the Invoice entity has a &amp;quot;Process&amp;quot; method. And youre suppose to handle it using na AppService right? like you did InvoiceManagementService.&lt;br /&gt;
&lt;br /&gt;
Regardless the existence of this InvoiceManagementService, right on controller you can do something like:&lt;br /&gt;
&lt;br /&gt;
invoice.Process() --&amp;gt; And this would break something in your domain since youre not using your Application logic from InvoiceManagementService.&lt;br /&gt;
&lt;br /&gt;
Business logic should never leave domain boundaries.&lt;br /&gt;
&lt;br /&gt;
I try to use a mix of DDD and Union Architecture for better maintenance:&lt;br /&gt;
&lt;a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/" rel="nofollow"&gt;http://jeffreypalermo.com/blog/the-onion-architecture-part-1/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Thu, 16 May 2013 17:01:29 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130516050129P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;Hello Bruno, !&lt;br /&gt;
Beacuse I need the DTO? I dosen't understand this.&lt;br /&gt;
I have,&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;
UX (mvc)&lt;br /&gt;
Project.BackOffice (ViewModel, Controller, Js, View...)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
Application&lt;br /&gt;
Project.Application (use repositories and entities)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
Domain&lt;br /&gt;
Project.Domani.Entities (Created by t4 and used in Application and UX)&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;
Data&lt;br /&gt;
Project.Data (EDMX, Context (t4) with UnitOfWork and Repositories)&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;
I dosen't understand because I need to use DTO... Because I dosen't use POCO Entities??&lt;br /&gt;
&lt;br /&gt;
Thank you!!&lt;br /&gt;
&lt;/div&gt;</description><author>fjaumot</author><pubDate>Thu, 16 May 2013 16:47:53 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130516044753P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;&lt;strong&gt;fjaumot wrote:&lt;/strong&gt;&lt;br /&gt;
&lt;blockquote&gt;
Yes, I call two ManagementServices (Application) from Controller.&lt;br /&gt;
&lt;/blockquote&gt;
And what is your question? If it is correct to call 02 application services from controller? If so, YES it is.&lt;br /&gt;
&lt;br /&gt;
Try to build your Presentation layer using Composition.&lt;br /&gt;
&lt;br /&gt;
You can have  even different bounded contexts in your view/presentation layer.&lt;br /&gt;
&lt;br /&gt;
Check this out &lt;a href="http://skillsmatter.com/podcast/design-architecture/talk-from-udi-dahan" rel="nofollow"&gt;http://skillsmatter.com/podcast/design-architecture/talk-from-udi-dahan&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Thu, 16 May 2013 16:43:33 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130516044333P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;Yes, I call two ManagementServices (Application) from Controller.&lt;br /&gt;
&lt;/div&gt;</description><author>fjaumot</author><pubDate>Thu, 16 May 2013 16:40:51 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130516044051P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;Please refactor your code and create Application services mediating between presentation and domain layer.&lt;br /&gt;
&lt;br /&gt;
They will accept/return only DTOs and inside those methods they will do &amp;quot;in memory&amp;quot; operations over your POCO classes and perform repositor operations if needed.&lt;br /&gt;
&lt;br /&gt;
Can you post your Application Services so we can see how are you doing this?&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Thu, 16 May 2013 16:34:55 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130516043455P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;&lt;strong&gt;fjaumot wrote:&lt;/strong&gt;&lt;br /&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
No I agree. Why reason I need to use WCF if I have a distributed application? My POCO classes are serializable, all I do is save the original serialization in the MVC (compressed JSON) and then not have to recover the original entity and add directly to context. Is not that right approach?&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
What do you mean by &amp;quot;distributed application&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
This is not the recommended approach. Don't use your POCO (Domain) classes over the wire. They must be &amp;quot;Statefull&amp;quot; and perform business operations.&lt;br /&gt;
&lt;br /&gt;
That's why you have DTO (Data Transfer Objects) to &amp;quot;transfer&amp;quot; objects over the wire. These DTOs would have only data needing by your controller.&lt;br /&gt;
&lt;br /&gt;
I think you are missing the whole concept of Application layer from Evans book...&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Thu, 16 May 2013 16:33:02 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130516043302P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;&lt;strong&gt;fjaumot wrote:&lt;/strong&gt;&lt;br /&gt;
&lt;blockquote&gt;
An other question,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;In one controller, I have use a differents ManagementService?&lt;br /&gt;
Like this,&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;   public BankAccountController(IBankingManagementService bankingService, ITransferManagementService transferService)
        {
            _BankingService = bankingService;
            _TransferService = transferService;
          
        }&lt;/code&gt;&lt;/pre&gt;

Thanks for you help!&lt;br /&gt;
&lt;/blockquote&gt;
Are these AppServices being called from within the controller? Didnt understand your question.&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Thu, 16 May 2013 16:30:16 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130516043016P</guid></item><item><title>New Post: Buenas prácticas</title><link>http://microsoftnlayerapp.codeplex.com/discussions/443899</link><description>&lt;div style="line-height: normal;"&gt;This InvoiceManagementService.cs is running in which layer? I mean, Is it a ApplicationService or Domain service? It looks like a AppService, since it is using repositories and transaction... Try to name it InvoiceManagementAppService to be more clear though.&lt;br /&gt;
&lt;br /&gt;
Without knowing your domain better (Invoice/Contract) I cant tell you what's the right approach in my opinion.&lt;br /&gt;
&lt;br /&gt;
As per my understanding, Invoice and Contract are both Aggregate Roots of diferente Aggregates. Am I right ?&lt;br /&gt;
&lt;br /&gt;
If so, why are you deleting and old contract just because a new invoice is coming up ?&lt;br /&gt;
&lt;br /&gt;
Have you read about Udi Dahan &amp;quot;never delete&amp;quot; approach ? I strongly recommend it. In summary: Never delete! -&amp;gt; Do some &amp;quot;logical&amp;quot; delete like disabling the entity&lt;br /&gt;
&lt;a href="http://www.udidahan.com/2009/09/01/dont-delete-just-dont/" rel="nofollow"&gt;http://www.udidahan.com/2009/09/01/dont-delete-just-dont/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Also, check this link &lt;a href="http://stackoverflow.com/questions/14696568/avoid-unit-of-work-pattern-in-domain-driven-design" rel="nofollow"&gt;http://stackoverflow.com/questions/14696568/avoid-unit-of-work-pattern-in-domain-driven-design&lt;/a&gt;&lt;br /&gt;
&lt;em&gt;&amp;quot;In a properly designed system one command changes one aggregate at a time, every aggregate has boundaries which defined by invariants in aggregate root. So when you do any changes on aggregate, invariants are checked and changes are applied (or not) in one transaction. It's transaction consistency. Do you need to use Unit of Work here? Don't think so.&lt;br /&gt;
But quite often we are in situation when more then one aggregate need to be changed at one time. Transactions become larger, they touch more then one part of a system and we talk about eventual consistency. UoW is a good helper in this case.&lt;br /&gt;
&amp;quot;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Please make sure your UnitOfWork pattern is working as expected. You should have One UnitOfWork for both repositories. Commit would save them both in one transaction.&lt;br /&gt;
&lt;br /&gt;
Bruno&lt;br /&gt;
&lt;/div&gt;</description><author>brunobertechini</author><pubDate>Thu, 16 May 2013 16:27:13 GMT</pubDate><guid isPermaLink="false">New Post: Buenas prácticas 20130516042713P</guid></item></channel></rss>