M
Mochi Mochigome
Hi guys,
I have a program design question regarding mix-ins.
I currently have 5 modules:
module Authentication
end
module User
end
module Issue
end
module Network
end
module Object
end
and a single class which includes all those modules:
class Client
include Authentication, User, Issue, Network, Object
end
But while i've done this and it works fine I'm thinking it is poorly
designed because I've not see so many modules mixed in to a single class
for this size of program before.
The modules represent different aspects of an API i'm implementing, so I
decided to separate them into modules to be neater. The client class has
all those aspects so that's why I put them in modules and mixed them in.
So, is there a more elegant way of doing this?
m
I have a program design question regarding mix-ins.
I currently have 5 modules:
module Authentication
end
module User
end
module Issue
end
module Network
end
module Object
end
and a single class which includes all those modules:
class Client
include Authentication, User, Issue, Network, Object
end
But while i've done this and it works fine I'm thinking it is poorly
designed because I've not see so many modules mixed in to a single class
for this size of program before.
The modules represent different aspects of an API i'm implementing, so I
decided to separate them into modules to be neater. The client class has
all those aspects so that's why I put them in modules and mixed them in.
So, is there a more elegant way of doing this?
m