473,729 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How many modules is too many?

At running the risk of asking how big is too big...

Is there a rule of thumb or a best practice that says I may have too
many modules? I currently have a Access2K app with about 30 code
modules, plus of course the modules associated with the forms
themselves.

My practice has been to create a seperate module to handle specific
groupings of code, for example, a seperate module to handle clipboard
actions, window sizing actions, etc.

Any guidence is appreciated.

lq

Nov 13 '05 #1
7 4301
"Lauren Quantrell" <la************ *@hotmail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
At running the risk of asking how big is too big...

Is there a rule of thumb or a best practice that says I may have too
many modules? I currently have a Access2K app with about 30 code
modules, plus of course the modules associated with the forms
themselves.

My practice has been to create a seperate module to handle specific
groupings of code, for example, a seperate module to handle clipboard
actions, window sizing actions, etc.

Any guidence is appreciated.

lq


If you asked yourself the question "What advantage would I get by merging
some of these modules together to give fewer modules with more code in
them?" Then I guess the answer would be "None".
Grouping bits of code into modules is the way most sensible developers do
it, although I usually have a module where the code chunks are only linked
by the fact that you need them all the time, e.g. IsFormLoaded, TableExists,
etc.
Of course I haven't seen the code, but 30 modules doesn't seem unreasonable.
Nov 13 '05 #2
"Lauren Quantrell" <la************ *@hotmail.com> wrote in
news:11******** **************@ f14g2000cwb.goo glegroups.com:
At running the risk of asking how big is too big...

Is there a rule of thumb or a best practice that says I may have
too many modules? I currently have a Access2K app with about 30
code modules, plus of course the modules associated with the forms
themselves.

My practice has been to create a seperate module to handle
specific groupings of code, for example, a seperate module to
handle clipboard actions, window sizing actions, etc.


I tend to make class modules very focused, but not segregate
funcitonality in modules too much, unless there's a group of
functions that are interdependent and are always used together.

For instnace, in one app, I have a module that's entirely dedicated
to supporting the upload of data to the client's website. The
functions are called in two forms, and they are interdependent on
each other.

But standalone functions I put in a general module for the
application.

I do have two main modules that I start from, one called mdlDWF, for
code that I've pulled into an applcation from my personal code
library, and the other called mdlApplicationN ame, where I put code
specifically written for that application.

Those two modules are the starting point in any of my apps.

I then add other modules when I need to write a segragated group of
fuctions/subs as in the example above, or when I'm importing someone
else's code, say a dawnload from the Access Web. And class modules,
of necessity, stay segregated by purpose.

Just looking at a moderately complex app of mine, I have 11 modules
and 12 class modules. In another somewhat less complicated app, I
have 14 modules and 7 class modules. In another relatively more
complicated app I have 13 modules and 16 class modules.

So, I wouldn't say that 30 class modules is out of hand at all,
especially if some of those are class modules. It all depends on the
level of complexity of your application.

In contrast, an app I took over from a client (it was done by a
non-Access programmer, but his work would put many professional
Access developers to shame, with excellent coding practices). The
one thing about the app that is annoying is that there was a
tendency for the developer to create one module per
function/subroutine. I have never bothered to consolidate, though,
as I don't see that it makes much difference.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #3
Bri
Lauren Quantrell wrote:
At running the risk of asking how big is too big...

Is there a rule of thumb or a best practice that says I may have too
many modules? I currently have a Access2K app with about 30 code
modules, plus of course the modules associated with the forms
themselves.

My practice has been to create a seperate module to handle specific
groupings of code, for example, a seperate module to handle clipboard
actions, window sizing actions, etc.

Any guidence is appreciated.

lq


I seem to recall reading somewhere that modules are loaded into memory
on an as needed basis (this assumption is subject to some else out there
knowing more about it than I do). So, if the function/subs that are
likely to run together are grouped into modules, then if a user is only
working in one part of your app he/she doesn't have to have all of the
code loaded into memory. With today's PCs having so much RAM this may
not be the big deal it was in the past.

I also create separate modules for API related functions. These have so
many declarations and constants related to them that it would be
confusing to mix them in with other code and/or other API functions.

--
Bri

Nov 13 '05 #4
Thank you everyone for your input on this. Hopefully this informnation
will be helpful for others having the same questions. I pretty much
stick to the same practices outlined by Bri and Don - I have a module
that is used for startup functions associated with the application's
loading, one for frequently used or common functions, and seperate ones
for anything involving API calls because of all the constants and
declarations.
So I guess 30 or so modules for an application having 50-75 forms is
not unreasonable not wasteful in terms of resources.
Thanks one and all.
lq

Nov 13 '05 #5
Bri <no*@here.com > wrote in news:9vB0f.8415 0$oW2.17414@pd7 tw1no:
I seem to recall reading somewhere that modules are loaded into
memory on an as needed basis (this assumption is subject to some
else out there knowing more about it than I do). So, if the
function/subs that are likely to run together are grouped into
modules, then if a user is only working in one part of your app
he/she doesn't have to have all of the code loaded into memory.
With today's PCs having so much RAM this may not be the big deal
it was in the past


I don't think this is the case any longer with the monolithic save
model introduced in A2K. I can't see how it could be.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #6
Bri
David W. Fenton wrote:
Bri <no*@here.com > wrote in news:9vB0f.8415 0$oW2.17414@pd7 tw1no:

I seem to recall reading somewhere that modules are loaded into
memory on an as needed basis (this assumption is subject to some
else out there knowing more about it than I do). So, if the
function/subs that are likely to run together are grouped into
modules, then if a user is only working in one part of your app
he/she doesn't have to have all of the code loaded into memory.
With today's PCs having so much RAM this may not be the big deal
it was in the past

I don't think this is the case any longer with the monolithic save
model introduced in A2K. I can't see how it could be.


You could very well be right as I'm sure I read this long enough ago
that it probably was referring to AC97. It could also explain some more
of why AC2K is so slow.

--
Bri

Nov 13 '05 #7
There is a number which is "too many", and you
might eventually find it, but I can remember from
the previous discussion that "30 + forms" is way
smaller.

The person who reported hitting the limit had a
separate module for each procedure, and a lot of
procedures.

Each module is loaded was loaded as an object, so
if you have hundreds or thousands of modules each
would be loaded separately, so the loading and
finding of procedures would take longer.

Of course that was in a previous version of Access,
and the limit might have changed.

Doubtless there is also a limit on the number of
lines in an individual module.

Whatever the limits are, they don't interfere
with normal coding practice. 30 code modules is
with the limits of normal coding practice. 1 module
is not, and 1000 modules is not.

(david)

"Lauren Quantrell" <la************ *@hotmail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
At running the risk of asking how big is too big...

Is there a rule of thumb or a best practice that says I may have too
many modules? I currently have a Access2K app with about 30 code
modules, plus of course the modules associated with the forms
themselves.

My practice has been to create a seperate module to handle specific
groupings of code, for example, a seperate module to handle clipboard
actions, window sizing actions, etc.

Any guidence is appreciated.

lq

Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
2431
by: Mike | last post by:
I'm fairly new to PHP, but a long time Perl coder. This is probably answered somewhere, but I haven't been able to find it. The "strength" behind Perl is in its modules; are there modules available like that for PHP? TIA, Mike
36
2630
by: Tim Churches | last post by:
If a compiled Python extension module B includes code from some other software A which is licensed only under the GPL, do other Python programmes, C, which import module B also need to be licensed under a GPL-compatible license (assuming C is/are to be distributed to third parties)? I think the answer is yes, both from a lay (IANAL) legal and moral point-of-view, but I am interested in hearing any arguments to the contrary. Note that I...
0
1090
by: Bruce D. Ray | last post by:
The python README states: On SGI IRIX, there are modules that interface to many SGI specific system libraries, e.g. the GL library and the audio hardware. These modules will not be built by the setup.py script. I have an SGI running Irix 6.5.17 with MIPSpro 7.3 compiler and would like to build these modules. I have used the
7
2073
by: Jorgen Grahn | last post by:
I have a set of tests in different modules: test_foo.py, test_bar.py and so on. All of these use the simplest possible internal layout: a number of classes containing test*() methods, and the good old lines at the end: if __name__ == "__main__": unittest.main() This is great, because each of the modules are runnable, and I can select classes or tests to run on the commandline if I want to. However, running all the tests from e.g. a...
9
2735
by: Emmanuel Charruau | last post by:
Hi, I am looking for a class or any information which would allow me to make communicate mini-module in c++. I have been looking on the net for some examples of such implementation, but I did not find any good one. This is why I am asking here if some of you know where to find some information on the internet about such implementation.
5
3335
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example I'm adding a customer. The Customer fields are mostly foreign keys that refer to primary keys in other tables, left join instead of junction tables at this point. So, when I want to add a customer record, I also need to add records to the other...
12
1856
by: carrionk | last post by:
Hi Is it possible to save Modules in Access the way they are saved in Excel? Excel uses Personal.xls for using macros on every Worksheet. Is there a Personal space in MS Access where to store Modules the same way? So you can use them on every DB. Thx
0
1244
by: venkatbo | last post by:
Hi folks, On i686 Linux, I would like to place my python modules as: <base_dir>/src/py-modules/*.py and use the cmd from <base_dire>: ...base_dir]$ python src/py-modules/setup.py install --prefix=<base_dir>/usr so the .py files and the corresponding compiled .pyc files are at: <base_dir>/usr/lib/python2.4/site-packacges/*.py
3
1827
by: Mohamed Yousef | last post by:
Hello , The problem I'm asking about is how can imported modules be aware of other imported modules so they don't have to re-import them (avoiding importing problems and Consicing code and imports ) Take Example :- in A.py :- import B print dir() # no problems we can see B which contain re module and C module
0
8766
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9291
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9158
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6026
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3244
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2171
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.