
Originally Posted by
Near
He's talking about the database as far as I know. And instead of creating tools for editing the database, I think it's better to make it more user-friendly instead. It doesn't have to be that simple. But just a logical structure that everyone with basic understanding of databasing understands. And it doesn't even have to be that basic.
The structure is logical however it is different than what people are used to, the issue with making it easier to follow will mean having N extra columns for every catalog page which may not be needed (and we'd need a way to know which are in use MORE COLUMNS!). Doing it the correct way may be harder to edit for the average joe but the speed improvements are dramatic. I'd rather do something right than make it easy and implement it wrong.
On first run the server will install it's self and setup the initial database, however due to the nature of some things a "tool" will be made to make adding things such as catalog pages and possibly rooms easier (simple xml or json file).
---
To expand a catalog page can have many headings and many "bodies" or what every you want to call them in the past three rows in the database have been used and the structure of the pages have been hardcoded in a switch statement, the correct way to handle this is by having an additional table so you can do something like
Code:
SELECT headings FROM catalog_heading WHERE page_id = ?;
SELECT body FROM catalog_bodies WHERE page_id = ?;
SELECT article.* FROM catalog_articles AS article WHERE page_id = ?;
Doing it this way allows you to correctly generate pages dynamically and means the server doesn't need to be modified when new page structures are introduced. In modern servers this becomes more complicated because Sulake introduced "Deals" (See Wired Deals) in the catalog, because of this you also have todo the same for the articles. So you can use one query to load the pages then you require 2-3 additional queries per-page to obtain the needed data. To speed up access this data is cached after the first request and stored in memory until either the system is required to release it (low memory/shutting down) or the cache is deemed "stale".
A stripped down example of it can be seen here:
PHP Code:
ServerMessage serverMessage = new ServerMessage(127);
serverMessage.append(catalogPage.getId().intValue()); // id
serverMessage.appendString(catalogPage.getLayout()); // layout
Set<CatalogHeading> headings = catalogPage.getPageHeadings();
serverMessage.append(headings.size()); // heading count
for (CatalogHeading heading : headings) {
serverMessage.appendString(heading.getHeading());
}
Set<CatalogBody> bodies = catalogPage.getPageBodies();
serverMessage.append(bodies.size());
for (CatalogBody body : bodies) {
serverMessage.appendString(body.getBody());
}
// Articles...
Working on the database structure with Moogly.
PiratePad: ro.kumsNo4ZlgY / Latest text of pad hkUPg2h7ES