Tag Info

Hot answers tagged

3

It depends. When A and B obtain their data each on its own, this has the advantage that both are independent from each other, and A may be used without B, and B without A. The disadvantage is that you might need to pull the same data over the network twice, and that the data displayed by A and B might not be always consistent because the content changed ...


2

Since you wrote in your comment you want to make the output of the unchanged program stable when it is not changed between two runs, you already excluded "accidental changes to module variables" - without any changes, there can be no "accidental changes". The SO link you posted in your question mentioned how to initialize Python's hash seed to a fixed ...


1

It really depends on the context in which you want to invoke those functions. [A] assumes that the arguments of your method are always well known in the section of code you wish to invoke it. You should use a static method for these types of stateless calculations. [B] assumes that the arguments/state of the code is different depending on some other ...


1

I think you can adapt the visitor pattern for your requirement. Your Book class should implement an interface, typically named Visitable. public interface Visitable{ public void accept(Visitor visitor); } Now, to your book class you pass in a visitor which performs the necessary operations. Implement this method in book class. public class Book ...


1

I would add a bunch of unit tests for the individual modules and use something like Jenkins to compile and run the tests every time you make code changes. If you are finding variations when running, this should help you narrow it down so that you can change module logic to ensure repeatability.



Only top voted, non community-wiki answers of a minimum length are eligible