Determining the best way to split your code into different folders and namespaces

I have the following directories:

-ui
-BusinessLogic
-DataAccess
-BusinessObjects

if I have a class that is a stub client for a server side service that changes state on the server system where would that be ..

+1


source to share


4 answers


this code belongs to the shopping cart; -)

seriously, if you wrote it and don't know where it goes, then either the code is questionable or your partition is questionable; how are we supposed to have more information about your system than you?

now, if you just want to get some ignorant opinions, we have a petabyte:



  • it goes in the UI because you said it was a client stub
  • it goes in business logic because it implements the effect of the business rule.
  • it goes to the data access layer because it accesses the state change service
  • it goes in the business object layer because it causes a state change on the server.

it would be more helpful if you could tell us what the stub actually does; without specifics, it is difficult to know where it belongs and / or it is easy to argue in a vacuum about where it "should" belong

+2


source


I would consider this form of data access, although it's not clear to me that you need to put it in the same project as the rest of your data access classes. Remember, layers are mostly conceptual - to help you keep your design clean. Dividing them into different projects helps organizationally, but not necessarily. If it is an actual stub class, then the data access project is probably a natural home for it, but if it is only used in the UI layer then storing it there is probably okay.



+1


source


I don't think it belongs to any of them. You either need a new directory or a new project. But from that data, I would have to say BusinessObjects, because it certainly doesn't have data access as you describe, but rather just acts like a local object (stub).

+1


source


In the web services repository.

0


source







All Articles