Forums / Developer / Best practice for comparing product specs

Best practice for comparing product specs

Author Message

Eirik Alfstad Johansen

Thursday 01 April 2004 5:10:06 am

Hi,

What's the best way to store specs for products when these are to be compared?

When I recently created a web site for a our web hosting service, I solved the problem by creating one product class and one product spec class. The product spec class attributes were the name of the spec as well as one attribute for the spec value of each product.

This worked fine since there were only 4 "products" (hosting packages) and new products are rarely added. If new products were to be added, however, one would have to edit the product spec class to add a new attribute. Also, there would be no physical relation between the spec and the product, and one would have to edit each product spec object when adding a product to include the value of the product spec for the new product.

Now I have encountered the same problem yet again with a client site, and I'm looking for suggestions/ideas on how to best store product specs for comparison.

Thanks in advance !

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Alex Jones

Monday 05 April 2004 6:57:47 am

I have been struggling with this idea for close to a year now, and sadly I don't have a very good solution. I tried using a modified Matrix datatype, but that is problematic as I cannot change the name of a spec site-wide, nor can I easily change the order of the specs. After various other tests, I have fallen back on standard Text Lines, which isn't a good solution either, as each product can include 15 specs, thus increasing initial content creation, storage space and display time.

I would love to see a solution to the issue.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Eirik Alfstad Johansen

Wednesday 07 April 2004 1:58:56 am

Hi Alex,

<i>I have fallen back on standard Text Lines, which isn't a good solution either[...]</i>

Do you mean that you store them as class attributes?

Sincerely,

Eirik Johansen

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Bård Farstad

Wednesday 07 April 2004 2:36:07 am

I think that I would have made a new datatype for this where you define the fields to compare at class level and just fill in the values when you edit the object. When you have this as a separate datatype you could design it so it will be simple to compare different products with different values.

I would not serialize this into xml when storing since it will then be hard to do comparison.

I think a new datatype which is designed for this is the best way. I don't see any existing datatypes really fit into this.

--bård

Documentation: http://ez.no/doc

Alex Jones

Wednesday 07 April 2004 7:31:17 am

Eirik, I do indeed store them as a class attribute which is a Text Line.

Bård, that is a good point. When I set up my first site, which was the one with the large amounts of product specifications I wasn't familiar with the system, so that never ocurred to me. I like your idea and may very well use it with the next site I create.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

eZ debug

Timing: Jan 19 2025 06:20:45
Script start
Timing: Jan 19 2025 06:20:45
Module start 'content'
Timing: Jan 19 2025 06:20:45
Module end 'content'
Timing: Jan 19 2025 06:20:45
Script end

Main resources:

Total runtime0.1538 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 590.2188180.8125
Module start 'content' 0.00660.0048 771.031397.8359
Module end 'content' 0.01140.1423 868.8672526.8750
Script end 0.1537  1,395.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.2585200.0002
Check MTime0.00140.8932200.0001
Mysql Total
Database connection0.00070.449210.0007
Mysqli_queries0.104067.62661410.0007
Looping result0.00130.83631390.0000
Template Total0.141992.310.1419
Template load0.00080.543410.0008
Template processing0.141191.705910.1411
Override
Cache load0.00060.405110.0006
Sytem overhead
Fetch class attribute can translate value0.00080.494710.0008
XML
Image XML parsing0.00030.204110.0003
General
dbfile0.00946.1175200.0005
String conversion0.00000.003330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs