Tag Info

New answers tagged

0

It could be good idea to separate your model layer into 3 sub-layers - "entities", "repositories" and "services". This will give you separation of concerns and gather SQL in one place, out of your business logic. In this scenario all the data retrieval code, including complex SQL - will be located in repositories. So the goal of repository - is to hide ...


0

If you want that only one machine at a time do something you can have a token and only the machine that "have" this token can launch the process. When a machine finish the process pass the token to other machine (randomly, round robin, to the machine who have less load...). you can pass this token via AWS or store in the database. One problem to this ...


0

I'd skip the properties file. Since you're keeping data about database tables, it only makes sense to keep it in the database. If the data in the "checkbox" columns is part of the data already in the tables, then go ahead and just add the columns for it. If it's metadata that's not related to the data in the table, then create a separate table for it. ...


1

Your first option sounds like the most sane. You have a UI component that displays records from a table, and you now need to display boolean values associated with each record and you need to persist the values that the user sets. Saving these three new values with the record makes the most sense, logically, but I don't know enough about your system to know ...


0

Your description sounds like you have already coded a method of saving data. In my experience, the best thing to do when working on an existing application is to follow the same pattern throughout. My advice to you is to look at how similar data is being handled by the application. Follow the same pattern that is being used there when saving the check box ...


1

Honestly, these aren't questions best posed to programmers. Almost all of the issues you raise are matters of contract and intellectual property law. Consult a local lawyer who is familiar with the software industry in your jurisdiction. If you don't have a written agreement with your client (very foolish), s/he will be able to advise you of the “defaults” ...


1

As pointed out in the other answers, it depends on your unique circumstances (needed to run the simulations) whether to use a real database, or a real geographic information system (GIS). Regardless of you choice of tooling, one thing is certain: your simulations will involve application logic that is superficially similar to what is done by databases and ...


1

Get the data design done first. Understanding what data you need for each entity, and how the entities relate should simplify your design. You may find you have many entities which can be modeled as sub-types. Different sub-types may have different behavior, but should contain the same state (data). Understanding the common and specific behaviors of ...


2

In addition to the points that @MichealT made ... If what you were doing was (hypothetically) a breach of the GPL, the License is actually between you and the MySQL copyright holders (i.e. Oracle). Your customer has no right under law to demand that the license terms be enforced. It would be up him to persuade Oracle to do that. That means that Oracle's ...


8

The GPL does not require that you GPL license any software that connects to MySQL (When are you required to have a commercial MySQL license?). If you just have your database sitting there, and connect to it, and could swap out the MySQL database for MariaDB, or PostgreSQL, or Oracle, or what have you your application is not a derived work of MySQL and does ...


5

You have two options: Every agent knows about every other agent, and queries those agents as needed. Every agent publishes its state changes, and other agents listen to the changes they care about. The second approach has several benefits over the first, most important being that changes only happen when necessary. For example, if only 2 farmers trade ...


0

You're describing a variety of broad components and I think you might be mixing the respective uses. In general broadstrokes, and in order, I would: Write my crawler as a standalone Python script (no need to mix in django) with Beautifulsoup. I dont like scrapy - Beautifulsoup just makes more sense to me, but that's just my preference. I would write the ...


1

Basically you want to create a unique key for every query that you can use to find corresponding result in cache. So, should be something like $key = md5(query); Then you test that key, in your example, if the file "/cache/$key.php" exists the you return the content otherwise run the query. Of course the cache will go stale, so you also want how old is ...


1

If I have stablished that I want my data sorted by criterium x, I expect that the n rows that I see in the windows are the first n items by using my sort over the whole data. What is more, if I scroll and get 10 new rows added to the table, I expect those new items to be at the bottom of the table, not mixed with the rows that were previously in the table. ...


1

I think you need to to do a bit more analysis as to how time affects your model. An offer to sell is at the current price An item (or group of items) is sold at a particular price that won't ever change. You seem to be heading down the right track with the total price being in the purchases table, but then purchases_articles links to a table that has price ...


1

I wouldn't comment on minor details that you can fix later. There are several structural issues here: Why do you have a PurchaseUnitPrice in Purchase? This should be on purchaseArticle Similarly why do you have a PurchaseQuantity in Purchase? This should also be on purchaseArticle Some thing tells me UnitPrice is the price you got from the provider and ...


-1

Entity names should be singular (client, purchase, etc. not clients, purchases, etc. ) Relationship from purchase_article to purchase should be one to many ( being purchase the one end ) Relationship from purchase_article to article should be one to many ( being article the one end ) Relationship from provider_article to article should be one to many ( ...


0

You could use the two foreign keys as a combined primary in providers articles. This to make sure you only have one of each provider article. Otherwise you could get duplicates with just a different ID. And try to use human readable IDs (like email addresses). Besides that I don't really see anything besides maybe the decimal-float thing.


1

You can't.... easily. Think about this from the user's point of view - why should their query be terminated because someone else is making another request? Fix your query to run faster so the system doesn't grind to a halt when somebody does something unexpected.


1

The "issue" is that the process could be slow because of the step 3. You may want to use a pipeline: While step 3 is still inserting notifications, have step 4 start process notifications that are already inserted. You may have to redesign how step 3 works, e.g. by splitting up the users into batches. Would it be tolerated to make the step 4 before ...


1

Based on the information you have provided, that seems like a new table (KeyValues table that has three columns: foreign key, key, value where the foreign key links this new table to the existing table. This will allow the following: An arbitrary number of key/value pairs can be stored, which can be indexed and searched and you can join on queries with ...



Top 50 recent answers are included