Click here to Skip to main content
15,910,121 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Nicholas Marty14-Jun-16 3:04
professionalNicholas Marty14-Jun-16 3:04 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Nagy Vilmos14-Jun-16 3:15
professionalNagy Vilmos14-Jun-16 3:15 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Kornfeld Eliyahu Peter14-Jun-16 3:21
professionalKornfeld Eliyahu Peter14-Jun-16 3:21 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Slacker00714-Jun-16 3:26
professionalSlacker00714-Jun-16 3:26 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
#realJSOP14-Jun-16 3:27
professional#realJSOP14-Jun-16 3:27 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Kornfeld Eliyahu Peter14-Jun-16 3:30
professionalKornfeld Eliyahu Peter14-Jun-16 3:30 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
#realJSOP14-Jun-16 3:38
professional#realJSOP14-Jun-16 3:38 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Marc Clifton14-Jun-16 3:36
mvaMarc Clifton14-Jun-16 3:36 
Long response. Short answer: re-usability, modularity, separation of concerns, work through interfaces and pub-sub calls as opposed to direct instance-method calls.

As you said, one reason I keep functionally distinct code in separate assemblies is because of re-use -- I have a library of code pieces that live in separate assemblies so that I can pull in what I need. This is how I've done things:

Core - all the stuff I almost always use:
assertions
extension methods
model-table management
module management
pub-sub
service management
state management
workflow

Then, because I use runtime loading of modules that an application needs, these are broken out into separate assemblies as services:

AppConfigService
ConsoleLoggerService
ConsoleCriticalExceptionService
DatabaseService
PubSubService
PaperTrailAppLoggerService
EmailExceptionLoggerService
EmailService
MessageBoxLoggerService

For web development, there's additional service assemblies:

FileResponseService
WebResponseService
WebRouterService
WebServerService
WebSessionService
WebSocketService
WebWorkflowService

and finally, for application specific stuff, I typically write various components as services (assemblies), so for example, for the ATM/Kiosk applications, I have assemblies that handle:

ATM specific API's
Card swipers
Pinpad API's
Drivers License scanners / PDF417 readers
Receipt printers
Voucher printing
etc.

The real power of having separate assemblies comes to play then, when, for example, I can replace a particular service with a different hardware implementation, or even an assembly that mocks the hardware. So, for example, when I write the ATM software, I don't have a 200lb ATM sitting in my office, I instead use the services for a small Magtek card reader and either an Ingenico or Verifone pinpad, depending on what I'm testing. The interfaces are consistent, so the core ATM software doesn't know or care what the underlying implementation is.

So basically, I find separate assemblies really useful, not just for code reuse, but also for creating a modular system. By asking the service manager what services are loaded, the "system" (either the back-end server or, in the case of a CefSharp hosted app, the Javascript, I can tell others what services are available. And speaking of the CefSharp hosted app, the cool thing there is that the services, as assemblies, are the same whether it's a hosted web app talking through the hardware abstraction layer or it's a WinForm app.

The other thing I do is use a pub-sub system (all that semantic stuff I was writing about a while back) so that, instead of needing to instantiate a class and talk to it, I just publish a message. How that message gets processed (or even if it gets processed) is determined by the services that are loaded at runtime, which of course are assemblies.

I always imagine that scene where HAL 9000 gets deactivated[^], as the architecture I use, whether writing WinForm or web apps, is a bit like that, I can plug in new functionality, or degrade the system, but it still keeps working as best it can.

Marc
Imperative to Functional Programming Succinctly

Contributors Wanted for Higher Order Programming Project!

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
PIEBALDconsult14-Jun-16 3:37
mvePIEBALDconsult14-Jun-16 3:37 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Simon_Whale14-Jun-16 3:49
Simon_Whale14-Jun-16 3:49 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Stephen Gonzalez14-Jun-16 4:19
Stephen Gonzalez14-Jun-16 4:19 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Pete O'Hanlon14-Jun-16 4:32
mvePete O'Hanlon14-Jun-16 4:32 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Stephen Gonzalez14-Jun-16 4:39
Stephen Gonzalez14-Jun-16 4:39 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
TheGreatAndPowerfulOz14-Jun-16 5:56
TheGreatAndPowerfulOz14-Jun-16 5:56 
PraiseRe: Folders and Namespaces vs Multiple Assemblies PinPopular
Wonde Tadesse14-Jun-16 6:19
professionalWonde Tadesse14-Jun-16 6:19 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Pete O'Hanlon14-Jun-16 6:20
mvePete O'Hanlon14-Jun-16 6:20 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Wonde Tadesse14-Jun-16 6:21
professionalWonde Tadesse14-Jun-16 6:21 
GeneralRe: Folders and Namespaces vs Multiple Assemblies PinPopular
Pete O'Hanlon14-Jun-16 6:20
mvePete O'Hanlon14-Jun-16 6:20 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Stephen Gonzalez14-Jun-16 9:20
Stephen Gonzalez14-Jun-16 9:20 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
OriginalGriff14-Jun-16 4:32
mveOriginalGriff14-Jun-16 4:32 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
R. Giskard Reventlov14-Jun-16 4:38
R. Giskard Reventlov14-Jun-16 4:38 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Ian Shlasko14-Jun-16 5:41
Ian Shlasko14-Jun-16 5:41 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Kevin Marois14-Jun-16 7:43
professionalKevin Marois14-Jun-16 7:43 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Super Lloyd14-Jun-16 12:20
Super Lloyd14-Jun-16 12:20 
GeneralRe: Folders and Namespaces vs Multiple Assemblies Pin
Gary Wheeler14-Jun-16 7:44
Gary Wheeler14-Jun-16 7:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.