Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Most classes and member functions in one app!

Most classes and member functions in one app!

Scheduled Pinned Locked Moved The Lounge
salesquestion
22 Posts 14 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Sam C

    I have mostly been developing in my professional life small applications that are in house for the companies I have worked for, just last night I have finished generating some object classes I needed for my application and WOW I was amazed that their was 15 classes and one of the classes had over 50 member functions... What are the most amount of classes you have worked on in one applications? And did it become rather ungainly?!?! It was a pain to look at the classview control and when I clicked on one class it expanded the node beyond the limits of my class view had to actually scroll! Just curious and would like to know how you guys work around "BIG" projects with these many classes? Do you have developers work on smaller amount of classes and link to .LIB file? Or they just work on the Class with a link to the main object and when the builds are ran they hook into those? Like to know....Very curious :-) Sam C ---- Systems Manager Hospitality Marketing Associates

    C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #6

    G'day Sam. Just let me go count them..... About 370 classes and 210 global functions ( no, I did not put *one* global function in, nor did anyone here now, because they know I would kill them ). Yes, navigating that lot was a pain, especially as I put them into folders and every time sourcesafe replaced the dsp I lost them all again.... Christian Secrets of a happy marriage #27: Never go to bed if you are mad at each other. It's more fun to stay up and fight.

    U 1 Reply Last reply
    0
    • S Sam C

      I have mostly been developing in my professional life small applications that are in house for the companies I have worked for, just last night I have finished generating some object classes I needed for my application and WOW I was amazed that their was 15 classes and one of the classes had over 50 member functions... What are the most amount of classes you have worked on in one applications? And did it become rather ungainly?!?! It was a pain to look at the classview control and when I clicked on one class it expanded the node beyond the limits of my class view had to actually scroll! Just curious and would like to know how you guys work around "BIG" projects with these many classes? Do you have developers work on smaller amount of classes and link to .LIB file? Or they just work on the Class with a link to the main object and when the builds are ran they hook into those? Like to know....Very curious :-) Sam C ---- Systems Manager Hospitality Marketing Associates

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #7

      In my previous life (which ended Friday), I worked on a Java app (both client and server pieces) that had about 1800 classes, with roughly < 10 methods per class. Linked into about 10 jars (that's DLLs in JavaSpeak). Before that, I built a cross platform (Win/Mac) imaging SDK that had about 40 classes spread over 3 DLLs. The DLLs/libs ended up being used by about 4-5 different apps. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

      1 Reply Last reply
      0
      • S Sam C

        I have mostly been developing in my professional life small applications that are in house for the companies I have worked for, just last night I have finished generating some object classes I needed for my application and WOW I was amazed that their was 15 classes and one of the classes had over 50 member functions... What are the most amount of classes you have worked on in one applications? And did it become rather ungainly?!?! It was a pain to look at the classview control and when I clicked on one class it expanded the node beyond the limits of my class view had to actually scroll! Just curious and would like to know how you guys work around "BIG" projects with these many classes? Do you have developers work on smaller amount of classes and link to .LIB file? Or they just work on the Class with a link to the main object and when the builds are ran they hook into those? Like to know....Very curious :-) Sam C ---- Systems Manager Hospitality Marketing Associates

        M Offline
        M Offline
        Mr Morden
        wrote on last edited by
        #8

        A good rule of thumb that I (try to) follow (most of the time) is that each class should be exactly one simple thing, and each method should do exactly one thing. If my classes start to get ungainly, I look for where there is more than one logical object and refactor those objects into separate classes. MFC does tend to make this difficult since it tends towards inheritance rather than aggregation but it is possible. This does mean that you may have a legitimate class with 50 methods, but more often than not lots of methods indicate a code smell. Methods follow the same principal. If a method does more than one thing, it is a candidate for splitting into multiple methods. (I also look for duplicate code here, and remove that into a single method if possible.) I am currently working on a largeish project with a team of six. We have separated subsystems into libs (currently around 35 I think). This allows us in conjuction with our tests to work on a lib without it affecting the main build too much. It follows the rule of thumb mentioned above because it organises the sourcebase into libs that do a thing. It also allows an element of reuse of code between the various executables in the project. If you only have one exe, this isnt as much of an issue. I still find separate libs break the project up into slightly easier to digest chunks though. And I like that.

        1 Reply Last reply
        0
        • C Christian Graus

          G'day Sam. Just let me go count them..... About 370 classes and 210 global functions ( no, I did not put *one* global function in, nor did anyone here now, because they know I would kill them ). Yes, navigating that lot was a pain, especially as I put them into folders and every time sourcesafe replaced the dsp I lost them all again.... Christian Secrets of a happy marriage #27: Never go to bed if you are mad at each other. It's more fun to stay up and fight.

          U Offline
          U Offline
          Uwe Keim
          wrote on last edited by
          #9

          Hey Christian I'm still impatiently waiting to hear more "Secrets of a happy marriage" from you. (Since I'm now 28 and I wanna be prepared if one day... :-)) -- See me: www.magerquark.de Want a job? www.zeta-software.de/jobs

          1 Reply Last reply
          0
          • S Sam C

            I have mostly been developing in my professional life small applications that are in house for the companies I have worked for, just last night I have finished generating some object classes I needed for my application and WOW I was amazed that their was 15 classes and one of the classes had over 50 member functions... What are the most amount of classes you have worked on in one applications? And did it become rather ungainly?!?! It was a pain to look at the classview control and when I clicked on one class it expanded the node beyond the limits of my class view had to actually scroll! Just curious and would like to know how you guys work around "BIG" projects with these many classes? Do you have developers work on smaller amount of classes and link to .LIB file? Or they just work on the Class with a link to the main object and when the builds are ran they hook into those? Like to know....Very curious :-) Sam C ---- Systems Manager Hospitality Marketing Associates

            T Offline
            T Offline
            Thomas H
            wrote on last edited by
            #10

            Hm I'ld love to once write a small app... I am one of those guys that always worked on bigger projects. The last project I did was a big middleware for memory managment, transaction handling etc. It had approximately 540 classes written in C++. I like to use lib files to organize it as I then for sure not going into the DLL hell in production. Another project I worked on was a C++ project in a big team. We had a proximately 2000 classes organized in 7 sub systems. The biggest was the kernel. Many classes have been used for the memory managment and business object handling. They never changed so we've written a code generater for it. There we used also static libraries for most of the things... I know work often with COM and just started with .NET. I think there you don't get in real problems as you mainly having components reflecting subsystems.... So every component is in itself a project....

            1 Reply Last reply
            0
            • S Sam C

              I have mostly been developing in my professional life small applications that are in house for the companies I have worked for, just last night I have finished generating some object classes I needed for my application and WOW I was amazed that their was 15 classes and one of the classes had over 50 member functions... What are the most amount of classes you have worked on in one applications? And did it become rather ungainly?!?! It was a pain to look at the classview control and when I clicked on one class it expanded the node beyond the limits of my class view had to actually scroll! Just curious and would like to know how you guys work around "BIG" projects with these many classes? Do you have developers work on smaller amount of classes and link to .LIB file? Or they just work on the Class with a link to the main object and when the builds are ran they hook into those? Like to know....Very curious :-) Sam C ---- Systems Manager Hospitality Marketing Associates

              M Offline
              M Offline
              Martin Bohring
              wrote on last edited by
              #11

              Since applications are getting more and more complex and "feature rich" the projects to build them are growing of course also bigger. My actual "masterpice" shows the following stats 10 subprojects (libs to avoid DLL hell where possible) with the following number of classes: 144, 9, 34, 9, 117, 10, 44, 23, 2, 127 And thats's without the COM stuff (which is generated via #import) or external libs. LOC 156000+ And remember this is still a 1 person project Some multiperson projects are much bigger

              U 1 Reply Last reply
              0
              • W William E Kempf

                If you've got a class with 50 member functions you're probably in desperate need of refactoring! I've worked on several large projects, and usually you break things up into smaller chunks. For instance, you can code each view in an MDI in seperate MFC extension DLLs. Or any other way to split things up into more managable "chunks". William E. Kempf

                realJSOPR Offline
                realJSOPR Offline
                realJSOP
                wrote on last edited by
                #12

                "More managable" doesn't necessarily mean "put the code in DLL's". There's nothing wrong with a class that has 50 member functions. He never mentioned whether the ratio of public/non-public functions, so who are we to say? :-) I worked on an app that had a base view class that had almost 150 member functions (a handful of public and most or the others were protected). The base view class was comprised of EIGHT CPP files each of at most 1500 lines in length. There was also a series of core calculation classes that involved over 20 files, 300 member functions (all totalled), and about 40,000 lines of code.

                D 1 Reply Last reply
                0
                • S Sam C

                  I have mostly been developing in my professional life small applications that are in house for the companies I have worked for, just last night I have finished generating some object classes I needed for my application and WOW I was amazed that their was 15 classes and one of the classes had over 50 member functions... What are the most amount of classes you have worked on in one applications? And did it become rather ungainly?!?! It was a pain to look at the classview control and when I clicked on one class it expanded the node beyond the limits of my class view had to actually scroll! Just curious and would like to know how you guys work around "BIG" projects with these many classes? Do you have developers work on smaller amount of classes and link to .LIB file? Or they just work on the Class with a link to the main object and when the builds are ran they hook into those? Like to know....Very curious :-) Sam C ---- Systems Manager Hospitality Marketing Associates

                  S Offline
                  S Offline
                  Stan Shannon
                  wrote on last edited by
                  #13

                  Well, I guess I might as well chime in here. Lets see... 45 projects, probably about half and half between exe's and dll/static libs, looks like about 70 or so classes per project, each class probably averages about 20 or so members functions. Lots of client/server/multithreaded stuff, but no COM. Thats far from the biggest project I've ever worked on, but since I'm the only full time developer here, its a bit of a challange.

                  1 Reply Last reply
                  0
                  • M Martin Bohring

                    Since applications are getting more and more complex and "feature rich" the projects to build them are growing of course also bigger. My actual "masterpice" shows the following stats 10 subprojects (libs to avoid DLL hell where possible) with the following number of classes: 144, 9, 34, 9, 117, 10, 44, 23, 2, 127 And thats's without the COM stuff (which is generated via #import) or external libs. LOC 156000+ And remember this is still a 1 person project Some multiperson projects are much bigger

                    U Offline
                    U Offline
                    Uwe Keim
                    wrote on last edited by
                    #14

                    A one-person project? Cool :cool:! What's the project about? -- See me: www.magerquark.de Want a job? www.zeta-software.de/jobs

                    M 1 Reply Last reply
                    0
                    • W William E Kempf

                      If you've got a class with 50 member functions you're probably in desperate need of refactoring! I've worked on several large projects, and usually you break things up into smaller chunks. For instance, you can code each view in an MDI in seperate MFC extension DLLs. Or any other way to split things up into more managable "chunks". William E. Kempf

                      realJSOPR Offline
                      realJSOPR Offline
                      realJSOP
                      wrote on last edited by
                      #15

                      If it's of any interest, that project has almost 500 classes in it, and that's not counting the two or three DLL's that it uses.

                      1 Reply Last reply
                      0
                      • realJSOPR realJSOP

                        "More managable" doesn't necessarily mean "put the code in DLL's". There's nothing wrong with a class that has 50 member functions. He never mentioned whether the ratio of public/non-public functions, so who are we to say? :-) I worked on an app that had a base view class that had almost 150 member functions (a handful of public and most or the others were protected). The base view class was comprised of EIGHT CPP files each of at most 1500 lines in length. There was also a series of core calculation classes that involved over 20 files, 300 member functions (all totalled), and about 40,000 lines of code.

                        D Offline
                        D Offline
                        dswigger
                        wrote on last edited by
                        #16

                        >> "More managable" doesn't necessarily mean "put the code in DLL's". << I agree to an extent. Lately I have liked having ALL the code in a single project. I manage huge amounts of code by sticking them in folders in the IDE...Ill create folders with useful names like: Views (Contains all view code) Misc (contains things which dont fall into any category)

                        realJSOPR 1 Reply Last reply
                        0
                        • D dswigger

                          >> "More managable" doesn't necessarily mean "put the code in DLL's". << I agree to an extent. Lately I have liked having ALL the code in a single project. I manage huge amounts of code by sticking them in folders in the IDE...Ill create folders with useful names like: Views (Contains all view code) Misc (contains things which dont fall into any category)

                          realJSOPR Offline
                          realJSOPR Offline
                          realJSOP
                          wrote on last edited by
                          #17

                          I'd much rather use embedded code than DLL's. There's only a couple of instances where I can think of that using a DLL is justified: a) The DLL serves as a sort of plug-in (features that the user can purchase and/or optionally install, but whose adsence does not prevent the program from running. b) Code that is shared between applications I've also found that generally speaking, static libs are a pain in the butt (and generally more of a pain than they are often worth. As for sub-projects, they can be useful if you have a LOT of components that have dependancies on each other (early-stage developement of COM objects where the interface could change on a day to day basis), or if you simply want to compile ALL modules/components of a program at the same time. Generally, the more sub-projects you have, the slower the IDE gets. Most of the programs I work on have no more than a single "project", but lately I've been in multi-project hell.

                          D 1 Reply Last reply
                          0
                          • realJSOPR realJSOP

                            I'd much rather use embedded code than DLL's. There's only a couple of instances where I can think of that using a DLL is justified: a) The DLL serves as a sort of plug-in (features that the user can purchase and/or optionally install, but whose adsence does not prevent the program from running. b) Code that is shared between applications I've also found that generally speaking, static libs are a pain in the butt (and generally more of a pain than they are often worth. As for sub-projects, they can be useful if you have a LOT of components that have dependancies on each other (early-stage developement of COM objects where the interface could change on a day to day basis), or if you simply want to compile ALL modules/components of a program at the same time. Generally, the more sub-projects you have, the slower the IDE gets. Most of the programs I work on have no more than a single "project", but lately I've been in multi-project hell.

                            D Offline
                            D Offline
                            dswigger
                            wrote on last edited by
                            #18

                            Agreed >>b) Code that is shared between applications<< I am really bad about not doing this...Since I usually am working on one project at a time I copy the classes I need into the appropriate project folder... Later if I fix/update I copy the updated code the the other projects that use it (if applicable)... I think I started doing this so that when I archived a project onto CD - I knew that all I had to do was load it up and build..Even if it was a couple years old...I reasoned that if a set of classes was shared, the interfaces may have changed to such a degree that other projects based on them would not build correctly....

                            realJSOPR 1 Reply Last reply
                            0
                            • U Uwe Keim

                              A one-person project? Cool :cool:! What's the project about? -- See me: www.magerquark.de Want a job? www.zeta-software.de/jobs

                              M Offline
                              M Offline
                              Martin Bohring
                              wrote on last edited by
                              #19

                              A building management and alarming system based on LON Networks and LNS (A COM network management component for LON Networks (www.echelon.com)). There is also code on the devices in the LON network (embedded stuff on Neuron Chips). This is maintained and created by another 2 persons. The PC is basically a configuration and display station. There are multiple PCs possible, connected via LON or TCPIP. One PC is working as Server, the others are using its data and events. Connection is possible via Internet, but does not scale to hundreds of client PCs. But this has not been a requirement until now. :)

                              1 Reply Last reply
                              0
                              • D dswigger

                                Agreed >>b) Code that is shared between applications<< I am really bad about not doing this...Since I usually am working on one project at a time I copy the classes I need into the appropriate project folder... Later if I fix/update I copy the updated code the the other projects that use it (if applicable)... I think I started doing this so that when I archived a project onto CD - I knew that all I had to do was load it up and build..Even if it was a couple years old...I reasoned that if a set of classes was shared, the interfaces may have changed to such a degree that other projects based on them would not build correctly....

                                realJSOPR Offline
                                realJSOPR Offline
                                realJSOP
                                wrote on last edited by
                                #20

                                I approach it from a different standpoint. If the class is needed somewhere else but it needs to be a tad bit different, I try to abstract out a base class and derive new classes for the desired functionality. I used to initially consider DLL's, but the VB punks can't/won't learn how to use a DLL correctly, and they insist on getting Active Xcrement or COMplicated DLL's to make *their* lives easier. Well, screw them. If I had to suffer through writing the damn DLL (so that it can be used by programs written in other languages), they can suffer through making it work with a VB app. They wanted to be programmers, so if they can't stand the heat, they can get the hell outa my kitchen. :)

                                T 1 Reply Last reply
                                0
                                • realJSOPR realJSOP

                                  I approach it from a different standpoint. If the class is needed somewhere else but it needs to be a tad bit different, I try to abstract out a base class and derive new classes for the desired functionality. I used to initially consider DLL's, but the VB punks can't/won't learn how to use a DLL correctly, and they insist on getting Active Xcrement or COMplicated DLL's to make *their* lives easier. Well, screw them. If I had to suffer through writing the damn DLL (so that it can be used by programs written in other languages), they can suffer through making it work with a VB app. They wanted to be programmers, so if they can't stand the heat, they can get the hell outa my kitchen. :)

                                  T Offline
                                  T Offline
                                  Tim Smith
                                  wrote on last edited by
                                  #21

                                  LOL, that statement has 'Old Fart' written ALL over it. Tim Smith Descartes Systems Sciences, Inc.

                                  realJSOPR 1 Reply Last reply
                                  0
                                  • T Tim Smith

                                    LOL, that statement has 'Old Fart' written ALL over it. Tim Smith Descartes Systems Sciences, Inc.

                                    realJSOPR Offline
                                    realJSOPR Offline
                                    realJSOP
                                    wrote on last edited by
                                    #22

                                    I am, in fact, old. I'm so old, that I yelled "Everybody duck!" just before a big-ass meteorite hit the earth. Unfortunately, the dinosaurs weren't listening.

                                    1 Reply Last reply
                                    0
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • World
                                    • Users
                                    • Groups