As an expansion from my previous question about using separate projects for seperate layers - Good practice on Visual Studio Solutions
I now wish to know if I am putting the right functionality in the correct layers.
I'm building a WPF application from scratch, that contains business logic and business objects. The database itself sits on another server on the web with access to it, restricted to web API calls using OAuth authentication.
I think the following content should be in these layers. The idea being, you go from layer 1 to layer 4, you are only depending on the layers below you. To prevent circular dependencies.
WPF View (what the user will see)
WPF ViewModel (how the program responds to user interaction)
No WPF Model, as it will just be the business object
Repository (class used by ViewModel to load/save business objects)
Utility classes to assist in saving objects, by selecting the correct API calls.
3. Business layer
Business objects/Entities/DTO (whichever name is preferred)
Factories (Used by the repositories in the creation of business objects)
Other misc business class (i.e. storage of currently logged in user)
4. Infrastructure/Data Access
OAuth client (makes authenticated calls against the web server, used by repository classes)