Skip to content

Commit

Permalink
XS✔ ◾ Removed broken links (#9379)
Browse files Browse the repository at this point in the history
* Removed broken link

* Update rule.md

* Auto-fix Markdown files

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
tiagov8 and github-actions[bot] authored Oct 9, 2024
1 parent a320655 commit 4a2a3ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion rules/avoid-using-if-else-instead-of-switch-block/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,3 @@ In situation where your inputs have a very skewed distribution, if-else-if could
Further Reading:

* [Speed Test: Switch vs If-Else-If](http://www.blackwasp.co.uk/SpeedTestIfElseSwitch.aspx)
* [C# If Versus Switch Performance](https://www.dotnetperls.com/if-switch-performance)
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@ In .NET, there are 2 ways to pass data through the layers of your application. Y

<!--endintro-->

- Use DataSet objects, OR
- Write your own custom business objects
* Use DataSet objects, OR
* Write your own custom business objects

There are 2 very different opinions on this matter amongst .NET developers:

The pros of the **DataSet** object:
Pros of **DataSet** object:

- **Code Generation** - Strongly typed **DataSet** objects can be created automatically in Visual Studio. Custom business objects must be laboriously coded by hand.
- **CRUD functionality DataSets** - When used with data adapters, can provide CRUD (Create, Read, Update, Delete) support. You must manually implement this functionality with custom business objects.
- **Concurrency** - Support for concurrency is part of the **DataSet** object. Again, you must implement this yourself in a custom business object.
- **Data binding** - It is difficult and time-consuming to write custom business objects that are compatible with data binding. The **DataSet** object is designed for data binding.
* **Code Generation** - Strongly typed **DataSet** objects can be created automatically in Visual Studio. Custom business objects must be laboriously coded by hand.
* **CRUD functionality DataSets** - When used with data adapters, can provide CRUD (Create, Read, Update, Delete) support. You must manually implement this functionality with custom business objects.
* **Concurrency** - Support for concurrency is part of the **DataSet** object. Again, you must implement this yourself in a custom business object.
* **Data binding** - It is difficult and time-consuming to write custom business objects that are compatible with data binding. The **DataSet** object is designed for data binding.

The pros of **Custom Business Objects**:
Pros of **Custom Business** objects:

- **Better performance** - The **DataSet** object is a very heavy object and is memory-intensive. In contrast custom business objects are always much more efficient. Business objects are usually faster when manipulating data, or when custom sorting is required.
- Business objects allow you to combine data storage (NOT data access) and business logic (e.g. validation) in the one class. If you use **DataSet** objects, these must be in separate classes.

Microsoft's official word on this matter is explained in [Designing Data Tier Components and Passing Data Through Tiers](https://www.dei.isep.ipp.pt/~jtavares/ADAV/ADAV_2004_2005/ADAV_MS_Pattern_Practices.pdf).
* **Better performance** - The **DataSet** object is a very heavy object and is memory-intensive. In contrast custom business objects are always much more efficient. Business objects are usually faster when manipulating data, or when custom sorting is required.
* Business objects allow you to combine data storage (NOT data access) and business logic (e.g. validation) in the one class. If you use **DataSet** objects, these must be in separate classes.

### The Case for Business Objects

Expand Down

0 comments on commit 4a2a3ca

Please sign in to comment.