473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Composite controllers?

kovik
1,044 Expert 1GB
I'm not exactly sure how to approach this, so I'll try to explain my situation.

I'm building the back-end for an MMORPG database website that I'm developing. One example of what I'm trying to do is Equipment Sets. Each set has certain equipment that, when a character wears more than one piece, provide bonuses. Here are the related tables:

Expand|Select|Wrap|Line Numbers
  1. # Equipment
  2. id | equipment_set_id | name | gender | class | ...
  3.  
  4. # Equipment Set
  5. id | name | gender | class
  6.  
  7. # Equipment Set Bonuses
  8. id  | equipment_set_id | pieces | attribute_id | attribute_value
  9.  
  10. # Attributes
  11. id | name
Basically, each piece of equipment can belong to one set (or none). Each set has bonuses based on the amount of pieces worn. These bonuses do not have to be cumulative (since sometimes you can get HP+50 from 2/4 pieces and HP+100 from 4/4 pieces). Now, this all makes sense. The problem comes in building the back-end.



I use CodeIgniter as my framework. It's controllers are a series of methods, and all back-end database elements have a controller with CRUD methods. I want to be able to edit the Equipment Set Bonuses through the Equipment Set screen. I cannot technically edit Equipment Set Bonuses without first defining an Equipment Set to add them to (at least without my back-end becoming very unorganized).

Ideally, I'd want to be able to build a table of Equipment Set Bonuses that I can add to, edit, and remove from. But, i set up all of my controllers to be built dynamically. I set the model to use, the form elements to build, and it basically handles itself from there. I'd want to do the same for Equipment Set Bonuses, but only make it accessible when an Equipment Set ID was set (or when a new one is being built).

I don't think I'd want to use AJAX, since the Equipment Set has no ID until after it is created, and I'd want to be able to add the bonuses prior to creating the full Equipment Set. I'm having a tough time doing this elegantly (technically, at all lol).

Any ideas?
Sep 14 '10 #1
0 983

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ken | last post by:
Our tool control applicatioin is currently comprised of a .NET part written in C#, components written in C++ and a Lab View component. They are at different version levels. Not all composite...
0
by: Michael Andersson | last post by:
Given a set of classes class A { enum [ ID = 0x0001} }; class B { enum [ ID = 0x0002} }; class B { enum [ ID = 0x0004} }; I wish to generate a composite class, perhaps using something like...
0
by: AshifToday | last post by:
this was my and my frineds little project in earlier classes, the program seperates the composite and prime numbers in two sections of the screen ===================== /* This program has...
18
by: Thomas A. Anderson | last post by:
I am a bit confused in creating a composite primary key. I have three table with two of the tables containing primary keys. I have two of the tables (each with a primary key) having one to many...
0
by: Satya Bojanapally | last post by:
Hi, I am unable to add a pager for this composite control. I had created a composite control in C#. The control is having 5 labels, one radio button and one DropDownList control. The composite...
4
by: Ismail Rajput | last post by:
Is there any option we can use Composite DataKeyField in the DataList and DataGrid?
1
by: sleigh | last post by:
Hello, I'm building a web application that will build a dynamic form based upon questions in a database. This form will have several different sections that consist of a panel containing one to...
4
by: Mark Olbert | last post by:
This involves a family of related, databound ASPNET2 composite controls. I've managed to arrange things so that the composite controls restore themselves from ViewState on postback after they're...
14
by: dave.dolan | last post by:
Basically I'd like to implement the composite design pattern with leaves that are either of reference or value types, but even using generics I can't seem to avoid boxing (using ArrayList or...
3
by: Eric | last post by:
I have created a fairly basic composite control consisting of a Label and a TextBox. In the overridden Render function, I'm creating a table with two rows and each row contains a cell (td). The...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.