开发者

Folder Naming problem

开发者 https://www.devze.com 2023-02-06 14:16 出处:网络
I am manage warehouse. I need to manage the stock and show the stock in every time the user wants. I created a folder named: Stock

I am manage warehouse. I need to manage the stock and show the stock in every time the user wants. I created a folder named: Stock under Stock folder I created a file named StockItem.cs Now I need to add a file cal开发者_如何学Goled Stock that represents the stock. But the folder name is Stock!

I encounter this problem many times so I decided to ask. What is the best way to name you application structure and files?


Why don't you just call your file Stock.data or StockData or any of a hundred other possibilities?

Or call your folder something else. You can't have a folder and a file with the same name any more than you can have two files with the same name (well, in different directories you can, obviously, but that doesn't appear to be the case here).


There are plenty of naming conventions out there. If you are running into names conflicting (which is what it sounds like) then you probably should re-think the logical ordering of your folders and files.

You also have to be aware that sometimes there might be some overlap in file names. The solution so this is to ensure you have absolute naming in place. So one way this is done is by using naming conventions found in Java (packages).

Example: com.warehouse.stock.item1 and com.warehouse.new_stock.item1

Both of the files are item1, but they have different absolute names, and logically you can figure out why they are placed there (one is new stock and the other is old stock).

EDIT: I see that this is in a .net environment, but I'm sure the package naming convention still holds.

0

精彩评论

暂无评论...
验证码 换一张
取 消