What should I name my module?

54 views
Skip to first unread message

Chris Malloy

unread,
Nov 15, 2014, 11:15:00 AM11/15/14
to google...@googlegroups.com
Hi, absolute beginner here.

What do you guys typically name your modules? MyModule just seems yucky to me. 

Also, can you explain the thought process you use to pick good names? Do you create modules for logical chunks and combine them later?

Brian Pontarelli

unread,
Nov 15, 2014, 12:16:36 PM11/15/14
to google...@googlegroups.com
I use a module per package or logical unit. My names are things like:

EmailModule
ConverterModule
ParameterModule
WorkflowModule
DomainModule
RequestModule
ModerationServicesModule

I also use aggregate modules that only install other modules:

MVCModule installs ConveterModule, ParameterModule, RequestModule, etc. 

-- Brian

Sent from my iPhone 
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice...@googlegroups.com.
To post to this group, send email to google...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/e983cc55-e492-489b-8c76-01448257773e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Malloy

unread,
Nov 15, 2014, 1:31:11 PM11/15/14
to google...@googlegroups.com
Ok, that makes sense. I've been thinking about this more. For each module you are essentially binding a set of interfaces to a set of implementations. So if you have an e-mail interface and an implementation that you rolled yourself you may call it EmailModule. But if there is something special about the implementation, like it uses imap instead of pop, you would name it ImapEmailModule.

David Sowerby

unread,
Nov 16, 2014, 9:10:52 AM11/16/14
to google...@googlegroups.com
I do much the same as Brian described, essentially I just try to keep everything clearly understandable - it is easy for things to get muddled with a lot of modules if it is not clear from their names what they do. 

Beyond that, I tend to think of it in terms of features, so that a single feature could be removed simply if so required.

In that context, your example of a separate ImapEmailModule is a good one - one day you may decide just not to support that any more.
Reply all
Reply to author
Forward
0 new messages