R
Rhino
I'd like to ask the experts on the newsgroup what the "best practices" view
is of a question regarding common code.
Let's say that we have a bunch of independent projects, among them Foo and
Bar. Each of the projects has little to do with one another but they do
share some common code, things like certain standard GUI panels and some
frequently executed utility code. For example, all of the projects generate
an About panel via the same class and all of the projects use the same class
to do various date manipulations. As a result, all of this common code has
been organized into a Common project. Common is a rather large project with
many classes.
When packaging project Foo, we know that it only needs a few of the classes
in Common, not all of the many classes found there. When packaging project
Bar, we know it only needs a few of the classes in Common, and that some of
them will be same as the Common classes needed by Foo and some will be
different.
When it comes to packaging the Foo project for distribution/installation,
which is the "best practice" in this case:
A. Distribute only the parts of Common that are needed by Foo?
B. Distribute all of Common with Foo, even though most of it won't be
needed?
My strong inclination it to only do A for a variety of reasons:
a. less code to distribute: less space needed on CD -or- fewer files to
download and less bandwidth used
b. slightly better performance of the application, assuming Jars are being
used, since the classloaders won't need to inspect and ignore so many files
that aren't being used
c. less code that can be reverse-engineered by competitors
d. etc.
On the other hand, if I am selective about which parts of Common get
packaged, there is a fairly tedious process of figuring out precisely which
classes in Common are needed by Foo. At least, it is fairly tedious to *me*
since I only know how to do this mechanically: look at each 'import' and
'implements' in each Foo class to determine which Common classes are needed,
then look at each Common class to see what their dependencies are. If anyone
knows a tool that will help me figure this out by simply clicking a button
or filling out a dialog, I'd love to hear about it!
What experiences do the rest of you have with the question of common code?
Would you distribute all of Common or just the parts needed by Foo?
--
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare
is of a question regarding common code.
Let's say that we have a bunch of independent projects, among them Foo and
Bar. Each of the projects has little to do with one another but they do
share some common code, things like certain standard GUI panels and some
frequently executed utility code. For example, all of the projects generate
an About panel via the same class and all of the projects use the same class
to do various date manipulations. As a result, all of this common code has
been organized into a Common project. Common is a rather large project with
many classes.
When packaging project Foo, we know that it only needs a few of the classes
in Common, not all of the many classes found there. When packaging project
Bar, we know it only needs a few of the classes in Common, and that some of
them will be same as the Common classes needed by Foo and some will be
different.
When it comes to packaging the Foo project for distribution/installation,
which is the "best practice" in this case:
A. Distribute only the parts of Common that are needed by Foo?
B. Distribute all of Common with Foo, even though most of it won't be
needed?
My strong inclination it to only do A for a variety of reasons:
a. less code to distribute: less space needed on CD -or- fewer files to
download and less bandwidth used
b. slightly better performance of the application, assuming Jars are being
used, since the classloaders won't need to inspect and ignore so many files
that aren't being used
c. less code that can be reverse-engineered by competitors
d. etc.
On the other hand, if I am selective about which parts of Common get
packaged, there is a fairly tedious process of figuring out precisely which
classes in Common are needed by Foo. At least, it is fairly tedious to *me*
since I only know how to do this mechanically: look at each 'import' and
'implements' in each Foo class to determine which Common classes are needed,
then look at each Common class to see what their dependencies are. If anyone
knows a tool that will help me figure this out by simply clicking a button
or filling out a dialog, I'd love to hear about it!
What experiences do the rest of you have with the question of common code?
Would you distribute all of Common or just the parts needed by Foo?
--
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare