473,772 Members | 2,510 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 4306
"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
2436
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
2641
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
1092
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
2736
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
3344
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
1857
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
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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
10106
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...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
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
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4009
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
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.