Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard business logic data classes for .NET

There are a lot of "primitive" boiler plate types of data classes that could appear in many different programs.

However, I have never seen a class or library set that recognizes the need to combine all these things with common logic required for them such as validation.

Example classes ([] brackets correspond to classes also in hypothetical library):

Address (street, postal code, city, state/territory/province, country)
Person (name, contact info ([Phone]/[Email]/etc), [Address], SSN/TIN, [CreditCard])
Phone (number, country code, etc)
CreditCard (type, number, expiration, ccv) **

And I'm sure someone could come up with plenty of others.

I have developed my own Phone/Address/Person/CreditCard classes that I use in projects, complete with validation and logic.

However I only am capable of validating US based information. My phone number class would ideally inherit from a base Phone class, as mine actually seperates the number into NPA, NXX and Station and validates it fully with NANP standards.

Is there a set of libraries out there in the net that has a comprehensive collection of such boiler plate data classes with proper validation?

Does it include validation for a world wide set of data, or just US data?

And for the ** from CreditCard, is it capable of meeting PCI Data Security Standards?

I know these are classes many people have probably written many times in many different languages, but is there any .NET library that fufills these desires?

I would prefer opens source/free, though I would consider a paid 3rd party library set.

like image 438
Brett Allen Avatar asked Jan 28 '10 04:01

Brett Allen


People also ask

What is business logic in C#?

The Business Logic layer handles all of the business rules, calculations and actual logic within your application that makes it actually "do" things and it may often use some of the objects retrieved from your data-access layer.

What is a business logic class?

Business logic is essentially the part of a computer program that contains the information (in the form of business rules) that defines or constrains how a business operates. Such business rules are operational policies that are usually expressed in true or false binaries.

What should be in business logic layer?

The business logic layer contains objects that execute the business functions. The Command pattern should be considered to implement these objects. With the Command pattern, each use case in the requirements document is implemented as a separate command or set of commands executed in the business logic layer.

Does bridge MS contains any business logic?

The Bridge Framework is an integration framework deployed on SAP BTP that allows developers to quickly customize and deploy apps that bring the powerful business logic of SAP products to the convenience of Microsoft Teams.


1 Answers

CSLA.NET might offer close to what yoju're looking for. It probably takes it a bit further than what you are asking, but it has some of the most comprehensive documentation of any framework (ie published books from APress). It is also free.

In particular the CSLA.ValidationRules namespace and the CommonRules and CustomRules classes focus on data validation.

like image 177
Ash Avatar answered Oct 11 '22 10:10

Ash