Closed lists for Country Codes, Languages, Currencies, etc [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
What's considered to be a best practice for managing and handling a closed-list of countries, languages, currencies, etc?
We want to be able to consume the data across all of our services
We were thinking of having a NuGet package that will contain Enums, and to consume it wherever needed.
I've seen that some people use tables to manage that data, but since it's constant I don't see a reason for why doing it in that manner. This is data that changes (maybe) once in a decade.
Also, is there already a well known Nuget package containing some of these definitions already? Tried to search for it, but no luck.
Thanks!

If you really want to use packages to do this, then take a look at the results below. However, almost all apps I've seen/worked on generally use services or a database to retrieve this info rather than a nuget or a class containing constants.
Country Codes
This is the best I could find (with over 19,000 downloads): ISO3166
Currency Codes
Two packages with <1000 downloads: Search results for ISO4217
Language Codes
One package with <1000 downloads: Search results for ISO639

Related

Conventional folder/file names C# [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I wanted to know if there is a site that references "conventional" folder/file names. For example, one that explains what a "Models" folder should contain, what a "Helpers" folder should contain, etc.
I'm starting to develop projects with a lot of content, so it's important for me to start now to get the right habits to organize my work.
Thanks in advance for your help.
EDIT: To be more precise I would like to know the role of each folder/file according to their names because I see a lot of projects with Models, Helpers, etc folders and I don't really understand the difference between them.
My question is about console applications in .Net 6
A Models folder would probably contain classes like Person, Customer, Employee etc, most of the times models that are have their own data tables. A Helpers folder classes that maybe don't have a lot of logic, if that's the right word, for example an EnumeHelper class that return the description of an enum. If you want to see more about how to structure a project: https://www.youtube.com/watch?v=YiVqwoFMieg
In the description there are links to projects built with that structure, called clean architecture. I you're a beginner, maybe you want to see some beginner tutorials, see the structure there, try to understand it and gradually try to understand other architectures, like clean architecture.

Project naming conventions: [Company].[ProjectName] vs [Company_ProjectName] [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Is it good practice to name preface project names within a solution like so?
CompanyName.P01
CompanyName.P02
CompanyName.P03
Or is it safer to use a convention like this?
CompanyName_P01
CompanyName_P02
CompanyName_P03
To me, the [.] separator looks nicer, and provides intellisense, but is there any caveat to using it?
Most of the solutions I came across follow the following convention:
CompanyName.SolutionName.LayerName
So basically in a company named COMP and a Project Named StackOverflow, you would end up with a project that looks like this:
COMP.StackOverflow.Business
COMP.StackOverflow.Data
COMP.StackOverflow.Web
COMP.StackOverflow.Core
This allows you to easily manage the generated assembly, so if you need to create a common library to be used in your company. You would name it:
COMP.SomeFrameworkName;
That would easily seperate your company's (or Team's) Dlls from external Dlls and Nuget Packages.

How do I share lots of unrelated methods between different classes without creating a "god namespace/static class"? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
A "God Namespace" is the (uncommon) term for an (anti?)pattern analogous to the "God Object", when you stuff a metric ton of stuff (mostly methods/functions) that is not related or not closely related to each other into one huge namespace/static class just so that it can be used in multiple sections of your project.
When following that (anti?)pattern, you often end up, as a C# example, with something like a static class Assets with tons of methods mostly unrelated to each other, but used across multiple places in your project(s).
I usually approach this problem by letting the next Assets grow for as much as I can bear it, and then desperately try to sort its contents out into several smaller ones based on the criteria which seems most legit, like MathAssets, or BitmapAssets, or RNGAssets, and then end up forgetting what did I put where... and make a new Assets for several new methods which don't fit into either of the SomethingAssets already cluttering up the project.
Are there any other ways of clearing up the "God Namespace"? Or will I just have to live with good old static class Assets?

demo application for user requirement specification [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have to create a user requirements specification for an application. I will need treeviews, menus, gridviews (with data). What is the quickest way to do this with little or no code and no database data. The application would need to react as almost if it was the final product. My initial thoughts is to programatically populate the treeview and gridview from xml files so i can change without any coding.
Does this make sense or what do other people do?
The application would need to react as almost if it was the final
product.
I think your first step is to set more realistic expectations and explain (possibly to the stakeholders?) the difference between a demo and a full product. If you are going to put in all the effort to make it that close to the final product, then it's probably not a demo. You might as well release it as a "beta" version.
Why not take a step back and create wireframes in a tool like Balsamiq and a simple functional spec in a Word document, Google docs or a Wiki? That can be created in a comparatively small amount of time and will give you a much better foundation to build the actual product or, at least, take a step further and create a demo with limited functionality.

Sharing xml and data between multiple projects [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I have three projects(C# libraries) namely A,B,C.
All the 3 have 3-4 xml files(in general can be resources) associated with them.
Each of these projects have classes that access these files for settings and information.
(loading xmls when ever they need)
The problems is sometimes there is a need that a class in project C may need to access
resources(xml files,images etc) of project B and vice versa.
Also these files may or may not be a part of the project solution.These resource paths
can come from app.config etc.
Its really becoming tedious to work out how to centralise access to these resources so that
all three projects can access them uniformly.
Currently all the projects load the files using app.config.
Also i'm trying to minimise the number of times a xml is loaded.(ideally once).
But given the projects are different i have to load it again.
I thought of using a Singleton class as it would make more sense for making uniform access but haven't quiet figured out a way.
Anyone has come across similar situations?
Are there any design patterns or best practices for sharing resources across projects?
Create one library containing the class(es) that access your centralized XML settings, and reference that library from the other libraries.
You don't necessarily need a Singleton for this, but putting it in one place will allow you to focus your efforts on things to improve it later, possibly caching, etc.

Categories

Resources