Two Laptop Bag
The moose likes Design and the fly likes Software Architecture for developers question : border components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Design
Bookmark "Software Architecture for developers question : border components" Watch "Software Architecture for developers question : border components" New topic

Software Architecture for developers question : border components

Andrea Taini

Joined: Dec 10, 2010
Posts: 5
Sometime it is hard to understand on which side put components when they are the connection between two layers.
For example the Controller: functionally it is more connected to the business layer as it interacts with it to expose its data to the presentation layer.
Conceptually it is connected to the presentation layer, as it is finalized to it.
In a such situation, where must be decided a component on wich layer should be, what prevales? Functional or conceptual design?
Thank you!
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
Without seeing your code, this is a tricky question to answer. It also raises the interesting question of whether a layered architecture helps or hinders many software development efforts. I've struggled with similar debates in the past too, and there are always pieces of code that don't cleanly fit into one layer or another. Here's an article I wrote a while back (a longer version is in the book) that talks about the mapping between software architecture and code, which I think will be an interesting read for you ->

It doesn't offer many answers (sorry!), but it should get you thinking about how it's potentially worth challenging the way that we structure a codebase.
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

One way of thinking about this would be in the context of a Hexagonal Architecture or "Ports and Adaptors": a Controller class is really just another type of adapter that converts some kind of stimulus or event into a usable procedure call or message that activates some functionality in the core application. I've seen an increasing number of references to HA in recent years and I find it's a very useful way to envision the overall structure of a software system.

Junilu - [How to Ask Questions] [How to Answer Questions]
I agree. Here's the link:
subject: Software Architecture for developers question : border components
It's not a secret anymore!