So i'm fairly new to both SubSonic and RIA Services. I've done the RIA walkthrough for the HR app and it all looks good, but I'm not quite about creating a DomainService base class for Subsonic.
The samples here describe creating a custom base class for your DAL but I wondering if there was already anything out in the wild that did this for Subsonic 3 SimpleRepository?
Additionally how should one handle generating all the DomainService classes that correspond to each class in the DAL? T4 templates?
Well I have since solved this problem. I thought it was related to how I was implementing my domain service, but since the November beta release of RIA Services I've realised it was probably related to bugs in the previous July version.
Related
What is the correct approach to structure a ServiceStack project?
As of now I do it in the following way:
Under ServiceModel,
I have all the models (entities), and have defined the different routes ("/product") and so on.
Then should all the CRUD operations should be under ServiceInterface?
The purpose of the different projects are covered in the Create your first WebService docs (from Physical Project Structure docs).
Essentially all DTOs accepted and returned by your Services should be in your dep-free *.ServiceModel project. All your Service implementation and supporting classes should be in your *.ServiceInterface project. If your project gets too big you can move your supporting classes into different projects. You can also split your Service implementations across multiple assemblies although I'd only do that after moving supporting functionality into different projects first.
As you're new to ServiceStack I'd also recommend skimming through other docs for background reading on developing Services and structuring your solution:
Design RESTful Services
Design Message-based APIs
Complexity, Services and Role of DTOs
Is there a custom implementation for ASP.NET Identity 2.0 that does not use Entity Framework? I'm hoping for something that does not use a full blown ORM but something along the lines of Dapper. The reason I'm asking is because I am not using Entity Framework anywhere else in the project so I would like to stay away from it if possible.
I know I could work on my own implementation but I do not have the extra time to spend on that.
Frustration and lack of other options forced me to do it myself. Here is the project page on GitHub: https://github.com/ryanrodemoyer/AltProvidersForAspNetIdentity2. It's a ways off from a tested usable project but it's a starting point.
Long time lurker, first time questioner here :)
I have been looking into our company's next software system architecture. We have been using CSLA.net, to some extent, as our business object framework and are thinking of building our new architecture around it. CSLA.net has support for the platforms mentioned in the title and we are looking for mvvm framework that would work well with it.
At the moment we only support windows environments but are also looking to support at least Android and iOS (also mono in general is under consideration). We are looking to share as much of the code as possible between the platforms and MvvmCross seems like really nice piece of mvvm (+) framework, especially in that context. I have watched few n+1 videos and what I have seen so far has been very impressive. I also like the Stuart's style of introducing the framework and concepts around it.
Has anyone tried to build a cross platform application that uses both of these frameworks (CSLA.net and MvvmCross)? If yes, what have been your experiences like? Also if Stuart could comment on the issue of how to merg the viewmodels of the two frameworks. I remember Rocky (Rockford Lhotka) recommending, as a general tip when working with mvvm frameworks, to inherit CSLA.net viewmodelbase(not viewmodel) and implement also mvvm framework's requirements into that class. You can find source of the viewmodelbase from https://github.com/MarimerLLC/csla/blob/master/Source/Csla.Xaml/ViewModelBase.cs.
Any input would be much appreciated.
Regards,
Harri
ps. I think, that this would make a great n+ video. Wouldn't it ;)
I've personally never used CSLA, but I have talked with it's original author, Rocky, both by email and in person.
CSLA presents itself as a business model object layer and that it can very successfully interoperate with independent Mvvm frameworks - see Rocky's post on CSLA+Mvvm
MvvmCross provides the more application and UI level support - and leaves application authors free to choose how they write their business services and models.
Because of this, yes I think it should be possible and even straight-forward to use both of the frameworks together if you want to. To get started, it might be useful to write some prototypes - and perhaps to look at the way other integration has been done - e.g. CSLA+Caliburn integration
ps. I think, that this would make a great n+ video.
I'd much rather see this type of article from someone who understands and uses CSLA. I would encourage all members of the MvvmCross community to contribute their own blog posts, articles, videos and github samples.
One caveat to this advice: I don't know if CSLA support Portable Class Libraries - if it doesn't then you'll probably need to use file-linking rather than PCLs in your app
Yes, you can use a multitude of MVVM frameworks; I've used CaliburnMicro and our own custom MVVM with success. If you haven't checked out Rocky's eBook series, you should definitely do so. One of the big gotchas is the limitations on reflection in Silverlight, hence also in WP8 and WinRT, so some reading up on that is well-advised.
Regarding Portable Class Libraries, you can't those for CSLA business objects (they require more stuff than is available in PCLs), so you do have to do the project linking. Typically, write the complete class in the .NET libary w/ pre-compiler directives, such as
#if !SILVERLIGHT
around code that can't be complied for Silverlight/WP8. I do use PCLs for some basic stuff, like enums and constants, but not for the business classes.
Xamarin have just released some updates that mean the latest framework 4.5 with async features can shortly be implemented...
We have been looking closely at SPAs using Breezejs for providing the data context between the client and the server. The features look great on the client, but we want to use the Repository pattern on the server and get good separation of concerns without having to inherit from EFContextProvider which would cause problems with IoC and possibly unit testing/mocking. We have been following John Papa's Code Camper sample on Pluralsight which initially set out using a Respository/UoW pattern without Breeze which then led us to look at the Hot Towel template which does include Breeze.
Does anyone know how Breeze can be abstracted to a Repository which keeps the DbContext cleanly (if using Entity Framework) encapsulated. Also, what happens if you are not using Entity Framework and prefer to use another ORM such as nHibernate.
Thanks for posting here as I am sure others will ask this :)
If you don't use EF then you won;t get the automatic metadata creation that Breeze provides. You can certainly abstract the EF context into a Repo however, and still get the benefits.
The Breeze/Knockout ASP.NET SPA template shows the repository broken out. I believe there is a sample for the UoW somewhere - tho it escapes me where. I have asked the Breeze folks to point to an answer for that.
If you use nHibernate there is no automatic metadata - however that is a great feature request I could see for Breeze.
I'd like to use a mocking framework as well as an IOC framework with my latest project, based on subsonic 3 (ActiveRecord) and ASP.NET MVC.
I'd like to use Moq for mocking and Castle-Windsor for IOC.
Anyone got any advice or recommendations based on these choices? Any bumps in the road I should be aware of?
Chris
I would definitely look into the Castle Windsor controller factory in MVC Contrib if you're using Castle for IOC with a ASP.NET MVC app.
Since Moq is completely separated from the app itself in the testing part of the code, I can see no reason that there would be any bumps in the road. I've been using Moq with a couple ASP.NET MVC apps with Castle Windsor IoC and on a app where I used Subsonic (though not in an ASP.NET MVC app) and have no complaints.