project-organization

The Pythonic way of organizing modules and packages

空扰寡人 提交于 2019-11-28 15:58:43
I come from a background where I normally create one file per class. I organize common classes under directories as well. This practice is intuitive to me and it has been proven to be effective in C++, PHP, JavaSript, etc. I am having trouble bringing this metaphor into Python: files are not just files anymore, but they are formal modules. It doesn't seem right to just have one class in a module --- most classes are useless by themselves. If I have a automobile.py and an Automobile class, it seems silly to always reference it as automobile.Automobile as well. But, at the same time, it doesn't

How to organize a Python Project?

99封情书 提交于 2019-11-28 14:53:20
问题 I'm new to Python and I'm starting a mini Project, but I have some doubts on how to organize the folders in the "Python Way". I'm using PyDev in my Development Environment, and when I create a new project a folder is created called src + src Now, in the PyDev , I can create Pydev Module and PyDev Package I need to organize my Project in the following way: + Indicators - Moving_averages.py - Stochastics.py + Strategies - Moving_averages_cross.py - example.py How can I organize this in terms of

DDD: how the layers should be organized?

两盒软妹~` 提交于 2019-11-27 17:20:54
I’m very much new in software development. Personally I think layered architecture is a great way to reduce the complexities that arise in the process of software development in object oriented approach and, not to mention, to keep your code organized. Now, I’ve run into some problems to be introduced with DDD (Domain Driven Design). Ofcourse, beginner level ones. Here it is – Let's say, I want to build an application to save “person” related data in database and display person details in a wpf datagrid (DDD is definitely not for the apps of such scale, but just to keep things simple for an

Eclipse Java project folder organization

送分小仙女□ 提交于 2019-11-27 17:15:40
I am coming to Java and Eclipse from a C#/Visual Studio background. In the latter, I would normally organize a solution like so: \MyProjects\MyApp\MyAppsUtilities\LowerLevelStuff where MyApp would contain a project to build a .exe, MyAppsUtilities would make an assembly DLL called by the .exe, and LowerLevelStuff would probably build an assembly containing classes used by the higher-level utilities DLL. In Eclipse (Ganymede, but could be convinced to switch to Galileo) I have: \MyProjects\workspace\MyApp When I create my initial project. There is an option to put source and build files in same

How to avoid circular unit reference?

不打扰是莪最后的温柔 提交于 2019-11-27 11:55:03
问题 Imagine the following two classes of a chess game: TChessBoard = class private FBoard : array [1..8, 1..8] of TChessPiece; ... end; TChessPiece = class abstract public procedure GetMoveTargets (BoardPos : TPoint; Board : TChessBoard; MoveTargetList : TList <TPoint>); ... end; I want the two classes to be defined in two separate units ChessBoard.pas and ChessPiece.pas . How can I avoid the circular unit reference that I run into here (each unit is needed in the other unit's interface section)?

What are common conventions for using namespaces in Clojure?

拥有回忆 提交于 2019-11-27 11:06:07
I'm having trouble finding good advice and common practices for the use of namespaces in Clojure. I realize that namespaces are not the same as Java packages so I'm trying to tease out the conventions in Clojure, which seem surprisingly hard to determine. I think I have a pretty good idea how to split functions into clj files and even roughly how I'd want to organize those files into directories. But beyond that I'm having trouble finding the mechanics for my dev environment. Some inter-related questions: Do I use the same uniqueness conventions for Clojure namespaces as I would normally use

Organising my Python project

这一生的挚爱 提交于 2019-11-27 10:51:54
I'm starting a Python project and expect to have 20 or more classes in it. As is good practice I want to put them in a separate file each. However, the project directory quickly becomes swamped with files (or will when I do this). If I put a file to import in a folder I can no longer import it. How do I import a file from another folder and will I need to reference to the class it contains differently now that it's in a folder? Thanks in advance Create an __init__.py file in your projects folder, and it will be treated like a module by Python. Classes in your package directory can then be

The Pythonic way of organizing modules and packages

安稳与你 提交于 2019-11-27 09:28:30
问题 I come from a background where I normally create one file per class. I organize common classes under directories as well. This practice is intuitive to me and it has been proven to be effective in C++, PHP, JavaSript, etc. I am having trouble bringing this metaphor into Python: files are not just files anymore, but they are formal modules. It doesn't seem right to just have one class in a module --- most classes are useless by themselves. If I have a automobile.py and an Automobile class, it

How to organize large R programs?

我的未来我决定 提交于 2019-11-26 21:13:08
When I undertake an R project of any complexity, my scripts quickly get long and confusing. What are some practices I can adopt so that my code will always be a pleasure to work with? I'm thinking about things like Placement of functions in source files When to break something out to another source file What should be in the master file Using functions as organizational units (whether this is worthwhile given that R makes it hard to access global state) Indentation / line break practices. Treat ( like {? Put things like )} on 1 or 2 lines? Basically, what are your rules of thumb for organizing

Domain Driven Design - how the layers should be organized?

放肆的年华 提交于 2019-11-26 18:58:23
问题 I'm very much new to software development. I think layered architecture is a great way to reduce the complexities that arise in the process of object oriented software development and, not to mention, to keep your code organized. I'm interested to learn about Domain Driven Design approach and I've run into some problems to get myself introduced to it (of course, beginner level ones). Here it is - I want to build an application to save person related data in database and display person details