Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to put the interfaces in a component based architecture?

In a component based architecture where a large number of decoupled components communicate through a set of standardized interfaces - are there any guidelines for where-to-store / how-to-group the interfaces?

Extreme solutions would be:

  • All in the same assembly (and off you go)
  • One assembly for each interface

Both of these option seems wrong to me - the first being not flexible enough (for example if you want to change only one interface) the second being the other extreme, which could escalate to maintenance nightmare very quickly.

In particular, I am looking for KILLER arguments not to adopt the two extremes above and obviously alternative approchaes.

Any opinions appreciated.

like image 732
JohnIdol Avatar asked Nov 12 '09 16:11

JohnIdol


People also ask

What is component based architecture in software engineering?

Component-Based Architecture. Component-based architecture focuses on the decomposition of the design into individual functional or logical components that represent well-defined communication interfaces containing methods, events, and properties.

What are the different types of component interface?

Component Interface 1 Scripting. Component Object Model (COM) is a binary interface standard that allows objects to interact with each other via interprocess communication. 2 Component-Based Service Development. James McGovern, ... ... 3 Software Application. ... 4 Securing Windows 7

What is a complete interface mapping?

An interface mapping is complete if for every required action of one component, there corresponds a provided action from the other component. It is nonambiguous if for every required action of one component, there corresponds at most one provided action from the other component.

What are the three components of the pure component architecture?

Pure Components, Interfaces and Logic Hooks. This architecture is divisible into three components, Pure Components, Interfaces and Logic Hooks. It is a variant on the Presentational and Container Components pattern described by Dan Abramov, now considering the existence of Hooks.


2 Answers

In a nutshell If the interfaces are shared then they have to be grouped in a common assembly, otherwise they have to be in the component interfaces assembly.

In a bit more detail If one of the standardized (i.e. shared) interface changes no matter where you put it you will have to change all the components which are implementing it, whether that interface is in a common assembly or in a component one. So there's no drawback specific to option 1, even if, as you say, you might have to change only one interface. On the other hand you would have a drawback by replicating common interfaces in every component, see standard redundancy issues.

This is not a special suggestion but a natural choice from the moment you chosen (wisely) to have standardized interfaces. You made the effort to identify them, you found they were standard, and now you group them.

If the components that implement these common interfaces have in addition some other ad hoc interfaces those will have to be in the component assembly as they shouldn't be exposed to the other components who have access to the common assembly.

like image 175
Tarelli Avatar answered Oct 07 '22 01:10

Tarelli


IMO The interface(s) for the component should reside with the component - possibly in a component specific interfaces assembly.

Any "common" datatypes should live separately from the components (possibly in a "common" or "shared" component).

like image 33
dice Avatar answered Oct 07 '22 00:10

dice