Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Architecture(structure)-oriented vs. feature-oriented project structure

The project, I have involved, has an architecture-oriented project's file/folder structure:

Root
|____ Node1
    |____ Event Handlers
    |         |___ <all event handlers of project>
    |____ Events
    |         |___ <all events of project>
    |____ Request Handlers  
    |         |___ <all request handlers of project>
    |____ Requests
    |         |___ <all requests of project>
    |____ ...

It is a clear from the architectural point of view of system (has been proposed by development team).

It is a feature-oriented structure has been proposed by designer team:

Root
|____ Feature #1
    |____ Event Handlers
    |         |___ <all event handlers of Feature #1>
    |____ Events
    |         |___ <all events of Feature #1>
    |____ Request Handlers  
    |         |___ <all request handlers of Feature #1>
    |____ Requests
    |         |___ <all requests of Feature #1>
    |____ ...

This variant is closer to designers and it describes clearly a feature to be implemented.

Our teams have started a holy war: what is the best approach. Could somebody help us and explain cons and pros of the first and second ones. Maybe there is a third one that is more useful and beneficial for both of us.

Thank you.

like image 495
garik Avatar asked Nov 10 '10 17:11

garik


1 Answers

I would choose the second option, in order to the mantainability of a long life application.

Let me explain it with an example:

One day, a year after the application release, and months after the team who worte the original code has left, a user detects and report a bug at a certain process. The ticket will surely look something like "This stuff does not work" which, after some email ping-pong it will end up being "I can't save a multi-product order for an australian customer".

Well, on the first project structure, you have to search among all your project Request and Event Handlers where the buggy code is. On the second one, you can narrow your search at the order saving module (or depending your structure granularity , the "overseas/multiproduct order saving" module).

It can save a lot of time, and ease mantainability IMO.

like image 78
Tomas Narros Avatar answered Oct 12 '22 02:10

Tomas Narros