Large Classes

Author Message

Camilo Cienfuegos

Monday 27 November 2006 10:18:02 am

Hello,
Will my eZ Publish application suffer in any way, if I create large classes - one class has 38 attributes (so far no problems, but what will happen in 1000 objects time). Might it be better to break the classes up?

Thanks,
Camilo

Claudia Kosny

Wednesday 29 November 2006 1:28:19 pm

Hi Camilo

I think having one large class is better, although this might depend on your exact requirements. Here my reasons:
- The setup for creating an object of this class is easier, with several small classes you need make sure that if the user cancels the create/edit on the second partial object, the changes on the first partial object are undone as well.
- If you display an object you just need one fetch, with several partial object you need at least one more fetch operation.
- Searching is easier.
- You have less cache files (I think)

Claudia

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 21:01:38
Script start
Timing: Jan 18 2025 21:01:38
Module start 'layout'
Timing: Jan 18 2025 21:01:38
Module start 'content'
Timing: Jan 18 2025 21:01:39
Module end 'content'
Timing: Jan 18 2025 21:01:39
Script end

Main resources:

Total runtime0.7129 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 587.7891152.6094
Module start 'layout' 0.00580.0032 740.398439.3984
Module start 'content' 0.00900.7023 779.7969459.2031
Module end 'content' 0.71120.0016 1,239.00008.2031
Script end 0.7128  1,247.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4379160.0002
Check MTime0.00120.1710160.0001
Mysql Total
Database connection0.00080.106910.0008
Mysqli_queries0.674294.5737540.0125
Looping result0.00050.0659520.0000
Template Total0.684996.120.3424
Template load0.00170.244220.0009
Template processing0.683195.824420.3416
Template load and register function0.00020.024010.0002
states
state_id_array0.00090.120910.0009
state_identifier_array0.00090.130520.0005
Override
Cache load0.00150.2058150.0001
Sytem overhead
Fetch class attribute can translate value0.00050.068020.0002
Fetch class attribute name0.00080.117820.0004
XML
Image XML parsing0.00020.031320.0001
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00070.0959100.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs