www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - better code organization?

reply "Suliman" <evermind live.ru> writes:
I am writing in D server and client apps. Server is base on 
vibed. Server and client have some common code (example working 
with config class). How I can prevent code duplication? I can 
move config code to separate module, but how to link on it?

server
client
modules --??

it it's good? or there is better ways?
May 17 2015
parent Rikki Cattermole <alphaglosined gmail.com> writes:
On 17/05/2015 9:26 p.m., Suliman wrote:
 I am writing in D server and client apps. Server is base on vibed.
 Server and client have some common code (example working with config
 class). How I can prevent code duplication? I can move config code to
 separate module, but how to link on it?

 server
 client
 modules --??

 it it's good? or there is better ways?
Normally it would be server, client, common. But all in all you've got the idea nailed down.
May 17 2015