• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Bulky Objects !

 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

When can I say a object to be heavy / bulky ?

I feel a particular type of objects in my application are bulky and it would be useful to make a object pool for those objects.But what would be the criteria of a heavy object ? Or ,When can I say a object to be bulky ?

I am saying those objects to be bulky as those are close to 2k lines of code.Is there is any formal defination of heavy objects apart from lines of source code , like number of variables , depth of inheritence etc.
 
Sheriff
Posts: 27451
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not back up and consider your original question: What types of objects should you use a pool for?

In my opinion you should use a pool for a type of object when that type of object uses a lot of some kind of resource, so that creating large numbers of it would stress the system.

So in real life you have thread pools, because a thread consumes system resources and you don't want to create too many of them. Similarly with database connections.

I don't see any of those source code metrics you suggested as being of any use in answering this question.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul , its a great deal of information.
So I think there is no need to implement a object pool for these object.These classes might be large in size but do not consume much of resources.

Thanks once again.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

These classes might be large in size but do not consume much of resources.



Perhaps you can flyweight it then ?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Meyers:


Perhaps you can flyweight it then ?



Thanks John.I have already evaluated flyweight , but will not be suitable for my application.

I just need to make an object pool provided I can find out as how much time does it take to instantiate the object of the class that is under consideration.Doing some timer testes to find out as how much time does it take to instantiate the object and how much time will I gain by using a object pool.

Any web pointers on Heavy objects would be appreciated.
Thanks,
 
Beauty is in the eye of the tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic