New answers tagged

2

According to the Classes section of the Python docs: “Private” instance variables that cannot be accessed except from inside an object don’t exist in Python. However, there is a convention that is followed by most Python code: a name prefixed with an underscore (e.g. _spam) should be treated as a non-public part of the API (whether it is a function, a ...


0

You have to ask what you hope to achieve by this - if its only to get a list of string resources for your own benefit, you might as well just try to learn the system. You say that a lot of it is in the form of constants and variables so all you would gain from putting the data into an external file is to replace the original with more constants or variables (...


1

Interspersing large amounts of data with program logic is so bad that added complexity in your code base is a cheap price to pay for it. Make the transformation, and you'll probably be rewarded with additional of opportunities for refactoring to simplicity.


-1

As pointed out by others, doing the whole thing automatically could introduce bugs. Software development is often about weighing up automating a process with just doing it manually; it often ends up a bit of both. I would recommend doing this particular task manually, perhaps with some search and replace, each file one by one. Get a list of files to change....


2

DAO code goes into the Model, not the controller. DAO code is actually farther away from the controller than the business logic, and that logic doesn't go into the controller either. Write a layer that contains methods that convert CRUD operations (Create, Read, Update, Delete) into DAO operations. Call the newly-created CRUD methods from your controller ...



Top 50 recent answers are included