• Complain

Harrison - Code Generation with Roslyn

Here you can read online Harrison - Code Generation with Roslyn full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: New York;NY, year: 2017, publisher: Apress;Springer Science+Business Media, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Harrison Code Generation with Roslyn
  • Book:
    Code Generation with Roslyn
  • Author:
  • Publisher:
    Apress;Springer Science+Business Media
  • Genre:
  • Year:
    2017
  • City:
    New York;NY
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Code Generation with Roslyn: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Code Generation with Roslyn" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Learn how Roslyns new code generation capability will let you write software that is more concise, runs faster, and is easier to maintain. You will learn from real-world business applications to create better software by letting the computer write its own code based on your business logic already defined in lookup tables.
Code Generation with Rosyln is the first book to cover this new capability. You will learn how these techniques can be used to simplify systems integration so that if one system already defines business logic through lookup tables, you can integrate a new system and share business logic by allowing the new system to write its own business logic based on already existing table-based business logic.
One of the many benefits you will discover is that Roslyn uses an innovative approach to compiler design, opening up the inner workings of the compiler process. You will learn how to see the syntax tree that Roslyn is building as it...

Code Generation with Roslyn — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Code Generation with Roslyn" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Nick Harrison 2017
Nick Harrison Code Generation with Roslyn 10.1007/978-1-4842-2211-9_1
1. Introduction
Nick Harrison 1
(1)
Lexington, South Carolina, USA
The Problem with Business Logic
You have probably already figured this out, but business logic is hard. It is rarely logical, often doesn't follow discernable patterns, is riddled with exceptions, and changes often and quickly. This can be frustrating but it is the world we live in.
The business world is very competitive. These exceptions and apparent contradictions that drive us crazy often mean the difference between keeping a client and losing a client, between making a deal and losing the deal. Business environments often turn on a dime and when the environment changes, so must our applications. Having application that can change and respond at the speed of business is critical to survival in tough competitive markets.
This puts a lot of pressure on our business applications being able to adapt to change quickly. How do we respond to these challenges? In this book, we explore ways to make our applications more nimble so that they can change at the speed of business.
Develop/Test Deploy Takes Time
Every time we change code, we go through a similar cycle of develop, test, and deploy . These steps take time. Depending on how your application is structured and the processes and tools being used, this could take a lot of time. You can't deploy a single method or even a single class. The smallest unit of deployment is an individual assembly in the .NET ecosystem.
We can partition an application into separate assemblies to try to limit the scope and impact of such changes, but we need to balance runtime performance and time to market. If we split the logic across too few assemblies, we may be left needing to regression test the entire application for every change. Splitting the business logic across too many assemblies and we may have more metadata than runnable code in individual assemblies. Plus there comes a point where too many assemblies can slow down builds and even opening the solution.
Note
Performance concerns from the number of assemblies in an application are not likely to be an issue until you start dealing with hundreds or even thousands of assemblies. So putting each class in its own assembly is not an option.
We can also reduce the time we spend in the develop, test, and deploy cycle with Configuration Management tools. Tools such as continuous integration and automated unit tests can help streamline this cycle. Continuous integration tools allow the code in a repository to be integrated regularly, often with every check. automated unit testing allows you to define a collection of tests to be run against the output of the build with each integration. These tests can ensure with each integration that no new defects are introduced and that all requested features are implemented and are performing correctly. Because these integrations occur frequently, any problems that are introduced can be discovered quickly. The earlier a problem is discovered, the earlier it is to resolve.
It takes time to make code changes, test the changes, and deploy the changes. We can reduce this time by how we structure our solution. We can also add tools like continuous integration and automated testing to reduce this time, but no matter how much we optimize our processes or how we structure our solutions, we will never have software at the speed of business as long as we are stuck in this code/test/deploy loop.
Lookup Tables Are Easier to Modify, Verify, and Deploy
While we can't deploy a single method, we can deploy a single record from a lookup table . We can even deploy an update to a single column. To the extent that this allows us to influence business logic, this gives us lots of options to quickly make changes. The scope of the impact from the changes can be tightly controlled, verified, and easily deployed.
Modifying lookup tables can be as simple as a single SQL statement or as complex as a sophisticated interactive table maintenance screen. You can start simple and over time add sophisticated maintenance screens to push the maintenance from the control of developers to the hands of power users. Verification can be as simple as running a report against the lookup tables to confirm that the correct data has been entered. Deployment can again be as simple as running SQL statements in the new environment or as complex as exporting key records from one environment and importing the same records in a new environment. This can easily be incorporated into your automated continuous integration strategy. Sophistication and complexity can grow as needed over time.
These configuration points must be designed and implemented in advance. We need to have the database structures in place to store the lookup data, and we also need code in place to reference and interpret the lookup data.
Note
Chapter focuses on various strategies for structuring this lookup data and how it might be interpreted.
We need to have code in place to reference and interpret this lookup data. This could take many forms .
  • You may run a query to retrieve key configuration parameters.
  • You may run a query to determine the next step in a complex workflow.
  • You may run a query to evaluate which of key business rules are applicable.
  • You may run a query that will actually implement and evaluate key business rules.
Lookup Tables Can Be Slow
In designing software, we often find that a good idea can easily morph into a bad idea. The potential problem with using lookup tables is that overusing or misusing lookup data can potentially slow your application down.
Structuring our applications so that every business decision is controlled by configuration values in lookup tables means that we can easily change any decision point on the fly, but it also means that we may have to make multiple-round scripts to the database to work out the logic for even a simple business transaction.
We need to be careful about how many decision points are configurable through lookup data and how much lookup data must be retrieved to complete a business transaction .
Note
You will see that in many cases, storing business logic in tables is much more efficient by leveraging the power of the database to filter and find the appropriate business rules. Just be wary of scenarios requiring multiple calls to the database.
We can have problems if we have to retrieve hundreds of records or make dozens of round trips to the database to complete a transaction. Consider the following business scenario :
  • We cannot initiate a funding request after 3PM
  • Unless it is a purchase, then the cutoff time is 4PM
  • Unless the Group Manager has authorized an override
You may find similar business logic in a Mortgage Loan Origination System. You may see any number of changes to such business requirements over time. You can easily imagine individual states requiring different cutoff times. You might even see changes requested based on other properties such as Income Documentation Type or Property Type and so on. You may see changes requested to change who can authorize an extension and for how long. Even for a relatively straight forward business rule, the number of configuration points and options can grow quickly.
If you are not careful, you can introduce too many configuration points and sacrifice runtime performance in the name of configuration ease. The penalties for having a slow application can be worse than not being able to respond quickly enough to change.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Code Generation with Roslyn»

Look at similar books to Code Generation with Roslyn. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Code Generation with Roslyn»

Discussion, reviews of the book Code Generation with Roslyn and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.