What are the layers and names of folders to organize projects?

2

I have an application that needs to be developed as follows:

  • Web Application (probably MVC)
  • Web Server Application (WCF - Will run on IIS)
  • Client Server Application (WCF Windows Services)
  • Client Application (WPF), there are also Delphi XE3 applications

The Web application will be hosted together with the WCF Application.

The Client Server application will be a Web Server Application (WCF Windows Service) that will be consumed by the Client application (WPF) and other Delphi programs already in existence.

This is to integrate the Matrix with the Branches.

Both the Client applications and the WCF Windows Service application can communicate with the Web Server Application (WCF in IIS).

What are the best practices for organizing the layers of these projects and the folders that separate the projects?

So far I've thought of creating a template layer, which will represent my database tables.

I will not use ORM, but DAO.

    
asked by anonymous 07.11.2014 / 01:38

1 answer

3

I think your question boils down to:

What are the best practices for organizing the layers of these projects and the folders that separate the projects?

Breaking your question into two parts:

What are the best practices for organizing the layers of these projects?

You need to understand why we use layers. Among the several reasons, I highlight some:

To lower the coupling between components (projects, dlls, etc) and increase cohesion. (If these words do not make sense to you, start with this link Patterns in Practice-Courage and Coupling

In addition, drawing layers between components helps keep responsibilities separate in the right way, that is, you keep things moving around for the same reason. (nothing to write sql inside the mvc controller, for example).

Lastly, and most importantly, by mentioning proper practices, the only thing I can tell you with certainty is that good design is always decoupled. That is, do not make your application totally dependent on WCF, or MVC, separate your business rule layer and protect it from those dependencies using abstractions.) A little article that shows you a bit about it Hexagonal Architecture (Ports and Adapters)

Finally:

and the folders that separate the projects?

This is a decision entirely from your team, in Visual Studio for example, when creating a folder in solution it does not even create it on disk, it's just a visual organization. Be meaningful, choose good names that demonstrate your intent.

I could argue about this for much longer, but I think this involves the risk that I confuse you even more, I think you need to segment your question better, this way it is easier to attack separate problems without being generic too.

If you want to better understand what layers are and how to give good names, follow two links:

Layers? Clean Code - Names

As for the discussion of ORM and DAO, you might think yes, that the data access object is the same as that used by ORM to do the interaction with the database, so they are not unique. Here's a more explanatory English OS link: DAO vs ORM (hibernate) pattern [closed]

    
07.11.2014 / 11:52