Reengineering .NET Flashcards
what is a service contract
A service contract is a class that describes the properties and methods the service exposes.
Service-oriented architecture consists of two types of services:
1) Application agnostic services that know nothing about the application they are used in, and contain no business rules, such as logging, user management.
2) Application specific services that have domain knowledge, enforce business rules, or work with data specific to the application.
which permission modifiers can use on the properties and signatures of an interface?
It was a trick question: you can’t use any permissions modifiers because they’re all assumed to be public.
Can an interface contain any logic?
No, an interface cannot contain any logic.
what should you do if you’re implementing an interface inside a class and you decide that particular method does not need to be implemented by your class?
You should make the method throw a not implemented exception.
what is one major way that services simplify code?
Services can eliminate state by passing in data to be operated on.
What is one major way in which interfaces can help to increase loose coupling?
By reducing hard references to other objects.
What are the two qualities to strive for in your services?
The two qualities to strive for in your services are autonomy and composability.
why is program state undesirable?
Program state exponentially increases the combinations of program execution.
what are the three major architectural patterns?
model view controller
model view presenter
model view viewmodel
what classes make up the model?
The model includes all classes that represent data in the database. This includes queries, views and entity classes, and entity validation logic to ensure that the database is consistent.
how many models might you have an application?
An application typically uses one model, although it may be convenient to have two models if an application requires data from SQL Server and Oracle.
what is the purpose of the view?
The purpose of the view is to display data, not to change data. The view includes code to create the window and create controls.
what is the purpose of the controller or presenter or view model?
This is the code that orchestrates interactions between the model and the view. This is where the business logic lives.
how do we make applications that interact with the user easier to test?
By moving much of our logic out of the view and into other classes we can avoid instantiating the UI. This avoids problems with automated test runners.