Supposing a critical part of an application's business rules are dependent on a given behavior, but that coding this behavior explicitly will clutter your code, would you rely on encapsulating it in an aspect with PostSharp (or with any other aspect framework for that matter)? Is that a "safe" and "wise" option, or is it always better to explicitly code the behavior no matter how it will clutter the code? What about the maintainability of such a solution?
1
There are 1 best solutions below
Related Questions in POSTSHARP
- NET Multitarget assembly error: assembly has not been processed by PostSharp
- I'm running a .NET core application and when i'm trying to hit api from front end i'm getting the below error
- Postsharp aspects reach to HttpContext
- PostSharp dependency sprawl
- PostSharp Detected .NET Core SDK 7
- Postsharp support for visual studio 2017 , 2019 and 2022
- An Error Occurred in PostSharp.targets on Visual Studio 2022 For Mac
- PostSharp compilation issue. Visual Studio 2022
- How can I get PostSharp to emit a message to the build window in VisualStudio for my Aspect
- Visual Studio 2022. Feature 'Edit and Continue' is currently unavailable due to an internal error. Read out of bounds
- Exception in .NET strong name API invocation. Error while getting key info for '<my .snk file path>': Strong name key container not found
- build errors when upgrade postsharp from 4.2.25 to 4.3.48
- Postsharp Error after updating newtonsoft
- PostSharp Logging line by line
- Logging Parameter Values in LinqPad 7 C# (.NET Core/5/6) with Metalama
Related Questions in ASPECTS
- Postsharp: Access already applied aspects from an Aspect
- what kind of pointcut the @Transactional aspect has? Before, After or Around?
- Can I have my core logic to update object status in Aspect
- Lombok and AspectJ with Sprint boot 2
- Spring Aspect not working as it should
- When an entity has a Spring Data Repository, the LoadTimeWeaving for this entity doesnt work
- Spring aop and aspectj
- IntelliJ IDEA + AspectJ
- AspectJ java throwing weird errors
- Convert aspect to native AspectJ notation
- How to intercept method which handles its own exceptions using AspectJ
- Log message on Spring AOP Aspect start up
- Logging calls to external code with an aspect leads to exceptions
- Applying Aspects on package and supackages
- instanceof not working with aspects in Spring
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It is not recommend putting business rules or business logic in aspects. It defeats the purpose of AOP. Business rules/logic are not cross cutting concerns. If you consider part of your business logic as clutter then you should use common OOP practices to abstract it or extract it into it's own method(s).
You can, of course, move it into an aspect, but what would the goal be? To reduce clutter? That isn't acceptable to me. Use aspects to remove clutter not related to business logic so that your business logic is clear. If your business logic is cluttered then you need to refactor.
PostSharp vs other AOP frameworks: If you do end up putting "critical code" into an aspect, then PostSharp will be the best framework to get the best performance. Runtime frameworks like IoC contains that do dynamic interception will not perform as well as statically compiled code. Plus, PostSharp has so many optimizations that it performs based on the code you write that no other framework can match.