Sunday, March 4, 2012

What is Software Architecture?

Contents

  • What is Software Architecture?
  • The Goals of Architecture
  • The Principles of Architecture Design

 What is Software Architecture?

Software application architecture is the process of defining a structured solution that meets all of the technical and operational requirements, while optimizing common quality attributes such as performance, security, and manageability. It involves a series of decisions based on a wide range of factors, and each of these decisions can have considerable impact on the quality, performance, maintainability, and overall success of the application.
Philippe Kruchten, Grady Booch, Kurt Bittner, and Rich Reitman derived and refined a definition of architecture based on work by Mary Shaw and David Garlan (Shaw and Garlan 1996). Their definition is:
“Software architecture encompasses the set of significant decisions about the organization of a software system including the selection of the structural elements and their interfaces by which the system is composed; behavior as specified in collaboration among those elements; composition of these structural and behavioral elements into larger subsystems; and an architectural style that guides this organization. Software architecture also involves functionality, usability, resilience, performance, reuse, comprehensibility, economic and technology constraints, tradeoffs and aesthetic concerns.”
In Patterns of Enterprise Application Architecture, Martin Fowler outlines some common recurring themes when explaining architecture. He identifies these themes as:
“The highest-level breakdown of a system into its parts; the decisions that are hard to change; there are multiple architectures in a system; what is architecturally significant can change over a system's lifetime; and, in the end, architecture boils down to whatever the important stuff is.”

In Software Architecture in Practice (2nd edition), Bass, Clements, and Kazman define architecture as follows:
“The software architecture of a program or computing system is the structure or structures of the system, which comprise software elements, the externally visible properties of those elements, and the relationships among them. Architecture is concerned with the public side of interfaces; private details of elements—details having to do solely with internal implementation—are not architectural.”

Why is Architecture Important?

Like any other complex structure, software must be built on a solid foundation. Failing to consider key scenarios, failing to design for common problems, or failing to appreciate the long term consequences of key decisions can put your application at risk. Modern tools and platforms help to simplify the task of building applications, but they do not replace the need to design your application carefully, based on your specific scenarios and requirements. The risks exposed by poor architecture include software that is unstable, is unable to support existing or future business requirements, or is difficult to deploy or manage in a production environment.
Systems should be designed with consideration for the user, the system (the IT infrastructure), and the business goals. For each of these areas, you should outline key scenarios and identify important quality attributes (for example, reliability or scalability) and key areas of satisfaction and dissatisfaction. Where possible, develop and consider metrics that measure success in each of these areas.

Ee658098.e4676123-5766-4852-929e-58ec77997928(en-us,PandP.10).png
Figure 1
User, business, and system goals
Tradeoffs are likely, and a balance must often be found between competing requirements across these three areas. For example, the overall user experience of the solution is very often a function of the business and the IT infrastructure, and changes in one or the other can significantly affect the resulting user experience. Similarly, changes in the user experience requirements can have significant impact on the business and IT infrastructure requirements. Performance might be a major user and business goal, but the system administrator may not be able to invest in the hardware required to meet that goal 100 percent of the time. A balance point might be to meet the goal only 80 percent of the time.
Architecture focuses on how the major elements and components within an application are used by, or interact with, other major elements and components within the application. The selection of data structures and algorithms or the implementation details of individual components are design concerns. Architecture and design concerns very often overlap. Rather than use hard and fast rules to distinguish between architecture and design, it makes sense to combine these two areas. In some cases, decisions are clearly more architectural in nature. In other cases, the decisions are more about design, and how they help you to realize that architecture.
By following the processes described in this guide, and using the information it contains, you will be able to construct architectural solutions that address all of the relevant concerns, can be deployed on your chosen infrastructure, and provide results that meet the original aims and objectives.
Consider the following high level concerns when thinking about software architecture:
  • How will the users be using the application?
  • How will the application be deployed into production and managed?
  • What are the quality attribute requirements for the application, such as security, performance, concurrency, internationalization, and configuration?
  • How can the application be designed to be flexible and maintainable over time?
  • What are the architectural trends that might impact your application now or after it has been deployed?

The Goals of Architecture

Application architecture seeks to build a bridge between business requirements and technical requirements by understanding use cases, and then finding ways to implement those use cases in the software. The goal of architecture is to identify the requirements that affect the structure of the application. Good architecture reduces the business risks associated with building a technical solution. A good design is sufficiently flexible to be able to handle the natural drift that will occur over time in hardware and software technology, as well as in user scenarios and requirements. An architect must consider the overall effect of design decisions, the inherent tradeoffs between quality attributes (such as performance and security), and the tradeoffs required to address user, system, and business requirements.
Keep in mind that the architecture should:
  • Expose the structure of the system but hide the implementation details.
  • Realize all of the use cases and scenarios.
  • Try to address the requirements of various stakeholders.
  • Handle both functional and quality requirements.

The Architectural Landscape

It is important to understand the key forces that are shaping architectural decisions today, and which will change how architectural decisions are made in the future. These key forces are driven by user demand, as well as by business demand for faster results, better support for varying work styles and workflows, and improved adaptability of software design.
Consider the following key trends:
  • User empowerment. A design that supports user empowerment is flexible, configurable, and focused on the user experience. Design your application with appropriate levels of user personalization and options in mind. Allow the user to define how they interact with your application instead of dictating to them, but do not overload them with unnecessary options and settings that can lead to confusion. Understand the key scenarios and make them as simple as possible; make it easy to find information and use the application.
  • Market maturity. Take advantage of market maturity by taking advantage of existing platform and technology options. Build on higher level application frameworks where it makes sense, so that you can focus on what is uniquely valuable in your application rather than recreating something that already exists and can be reused. Use patterns that provide rich sources of proven solutions for common problems.
  • Flexible design. Increasingly, flexible designs take advantage of loose coupling to allow reuse and to improve maintainability. Pluggable designs allow you to provide post-deployment extensibility. You can also take advantage of service orientation techniques such as SOA to provide interoperability with other systems.
  • Future trends. When building your architecture, understand the future trends that might affect your design after deployment. For example, consider trends in rich UI and media, composition models such as mashups, increasing network bandwidth and availability, increasing use of mobile devices, continued improvement in hardware performance, interest in community and personal publishing models, the rise of cloud-based computing, and remote operation.

The Principles of Architecture Design

Current thinking on architecture assumes that your design will evolve over time and that you cannot know everything you need to know up front in order to fully architect your system. Your design will generally need to evolve during the implementation stages of the application as you learn more, and as you test the design against real world requirements. Create your architecture with this evolution in mind so that it will be able to adapt to requirements that are not fully known at the start of the design process.
Consider the following questions as you create an architectural design
  • What are the foundational parts of the architecture that represent the greatest risk if you get them wrong?
  • What are the parts of the architecture that are most likely to change, or whose design you can delay until later with little impact?
  • What are your key assumptions, and how will you test them?
  • What conditions may require you to refactor the design?
Do not attempt to over engineer the architecture, and do not make assumptions that you cannot verify. Instead, keep your options open for future change. There will be aspects of your design that you must fix early in the process, which may represent significant cost if redesign is required. Identify these areas quickly and invest the time necessary to get them right.

Key Architecture Principles

Consider the following key principles when designing your architecture:
  • Build to change instead of building to last. Consider how the application may need to change over time to address new requirements and challenges, and build in the flexibility to support this.
  • Model to analyze and reduce risk. Use design tools, modeling systems such as Unified Modeling Language (UML), and visualizations where appropriate to help you capture requirements and architectural and design decisions, and to analyze their impact. However, do not formalize the model to the extent that it suppresses the capability to iterate and adapt the design easily.
  • Use models and visualizations as a communication and collaboration tool. Efficient communication of the design, the decisions you make, and ongoing changes to the design, is critical to good architecture. Use models, views, and other visualizations of the architecture to communicate and share your design efficiently with all the stakeholders, and to enable rapid communication of changes to the design.
  • Identify key engineering decisions. Use the information in this guide to understand the key engineering decisions and the areas where mistakes are most often made. Invest in getting these key decisions right the first time so that the design is more flexible and less likely to be broken by changes.
Consider using an incremental and iterative approach to refining your architecture. Start with a baseline architecture to get the big picture right, and then evolve candidate architectures as you iteratively test and improve your architecture. Do not try to get it all right the first time—design just as much as you can in order to start testing the design against requirements and assumptions. Iteratively add details to the design over multiple passes to make sure that you get the big decisions right first, and then focus on the details. A common pitfall is to dive into the details too quickly and get the big decisions wrong by making incorrect assumptions, or by failing to evaluate your architecture effectively. When testing your architecture, consider the following questions:
  • What assumptions have I made in this architecture?
  • What explicit or implied requirements is this architecture meeting?
  • What are the key risks with this architectural approach?
  • What countermeasures are in place to mitigate key risks?
  • In what ways is this architecture an improvement over the baseline or the last candidate architecture?

Composition vs. Inheritance


Saturday, February 12, 2011

Which is more secure, SFTP or FTPS?

"Which is more secure, SFTP or FTPS?"

In short, both protocols offer a high level of security and both are suitable for meeting the requirements imposed on most organizations.

When evaluating the security of a particular method of moving data between systems, most users are concerned with meeting three conditions:

1. Confidentiality -- Ensuring that nobody but the intended recipient can see the data being sent.
2. Integrity -- Ensuring that the data cannot be modified by an unauthorized party before reaching the intended recipient.
3. Authenticity -- Ensuring that both the sender and recipient are who they say they are.

Now that we know what kind of security we need, we can next examine how the FTPS and SFTP protocols work and how they achieve these security goals.

File transfer over the network using FTP protocol (defined by RFC 959 and later additions) takes roots in year 1980, when the first RFC for FTP protocol was published. FTP provides functions to upload, download and delete files, create and delete directories, read directory contents. While FTP is very popular, it has certain disadvantages that make it harder to use. The major drawbacks are lack of the uniform format for directory listing (this problem has been partially solved by introducing MLST command, but it's not supported by some servers) and presence of the secondary connection (DATA connection). Security in FTP is provided by employing SSL/TLS protocol for channel encryption as defined in RFC 2228. The secured version of FTP is called FTPS.

In UNIX systems another security standard has grown. It was SSH family of protocols. The primary function of SSH was to secure remote shell access to UNIX systems. Later SSH was extended with file transfer protocol - first SCP (in SSH 1.x), then SFTP (in SSH2). Version 1 of the SSH protocol is outdated, insecure and generally not recommended for use. Consequently SCP is not used anymore and SFTP gains popularity day by day.

"SFTP" abbreviation is often mistakenly used to specify some kind of Secure FTP, by which people most often mean FTPS. Another (similar) mistake is that SFTP is thought to be some kind of FTP over SSL.  In fact SFTP is an abbreviation of "SSH File Transfer Protocol". This is not FTP over SSL and not FTP over SSH (which is also technically possible, but very rare).

SFTP is a binary protocol, the latest version of which is standardized in RFC 4253. All commands (requests) are packed to binary messages and sent to the server, which replies with binary reply packets. In later versions SFTP has been extended to provide not just file upload/download operations, but also some file-system operations, such as file lock, symbolic link creation etc.

Both FTPS and SFTP use a combination of asymmetric algorithm (RSA, DSA), symmetric algorithm (DES/3DES, AES, Twhofish etc.) and a key-exchange algorithm.  For authentication FTPS (or, to be more precise, SSL/TLS protocol under FTP) uses X.509 certificates, while SFTP (SSH protocol) uses SSH keys.

X.509 certificates include the public key and certain information about the certificate owner. This information lets the other side verify the integrity of the certificate itself and authenticity of the certificate owner. Verification can be done both by computer and to some extent by the human. X.509 certificate has an associated private key, which is usually stored separately from the certificate for security reasons.

SSH key contains only a public key (the associated private key is stored separately). It doesn't contain any information about the owner of the key. Neither it contains information that lets one reliably validate the integrity and authenticity. Some SSH software implementations use X.509 certificates for authentication, but in fact they don't validate the whole certificate chain - only the public key is used (which makes such authentication incomplete and similar to SSH key authentication).
FTPS is more popular, so it is more likely that others with whom you wish to exchange data will be able to support it. Advantage: FTPS.

SFTP is easier to administer from a network perspective (firewalls, etc.). SFTP uses only a single TCP port where FTPS requires two. Advantage: SFTP.

FTPS is more flexible and, under the right circumstances, uses less computing resources than SFTP, which can lead to faster performance. Advantage FTPS.

SFTP is a newer protocol with standards that are more clearly defined. For example, SFTP uses a standardized directory listing format, where FTPS does not. Newer additions to FTP offer a standardized way of retrieving a directory listing, although it is not universally supported. It is not uncommon to uncover interoperability issues when connecting FTPs implementations from different vendors, where SFTP encounters such issues less often (although they do happen from time to time). Advantage: SFTP.
 
Here's the brief list of Pros and Cons of the two protocols:

FTPS

Pros:
* Widely known and used
* The communication can be read and understood by the human
* Provides services for server-to-server file transfer
* SSL/TLS has good authentication mechanisms (X.509 certificate features)
  FTP and SSL/TLS support is built into many internet communication frameworks.

Cons:
* Doesn't have a uniform directory listing format
* Requires a secondary DATA channel, which makes it hard to use behind the firewalls
* Doesn't define a standard for file name character sets (encodings)
* Not all FTP servers support SSL/TLS
* Doesn't have a standard way to get and change file and directory attributes

SFTP

Pros:
* Has good standards background which strictly defines most (if not all) aspects of operations
* Has only one connection (no need for DATA connection)
* The connection is always secured
* The directory listing is uniform and machine-readable
* The protocol includes operations for permission and attribute manipulation, file locking and more functionality

Cons:
* The communication is binary and can't be logged "as is" for human reading
* SSH keys are harder to manage and validate
* The standards define certain things as optional or recommended, which leads to certain compatibility problems between different software titles from different vendors.
* No server-to-server copy and recursive directory removal operations
* No built-in SSH/SFTP support in VCL and .NET frameworks

Friday, January 14, 2011

Resistive vs Capacitive touch screens


Capacitive touch screen: The capacitive touch screen is made up of a glass panel that is coated with a material.
The property of this material is that it can store electrical charge. So the capacitive touchscreens basically stores electrical charge.
But for good, Human body can also store charge. So, when you touch this screen with your finger, some of these charges on the screen gets transferred to your finger. The oscillator circuits located at the corner of your system will then sense this decrease in the charge on screen and the spot the exact location where touch occurred, and then transfers this specified information to the touchscreen driver software.

Example: iPhone series uses a Capacitive touch screen

Resistive touch screen: Resistive touch screen, on the other hand is again made up of normal glass panel. However, this glass panel in this case is coated with three layers.
Two of these layers being conductive and resistive are kept apart using spacers while the third scratch-resistant layer covers the whole setup

When the resistive touch screen system is running, current flows through these layers. On a finger touch, the two layers get connected and change in electrical field occurs. The system calculates the coordinates of point of contact and passes them to touch screen driver software.

Example: Nokia N97 uses a Resistive touch screen


Capacitive touch screen:

Pros:
  • Multi touch support available
  • Visibility good even in sunlight
  • Highly sensitive to finger touch leading to ease of use
  • Not prone to dust particles
  • Glossy look and feel
Cons:
  • Need to have atleast 5% humidity to achieve capacitive effect
  • More expensive than Resistive touch screen
  • Doesn't work with inanimate objects/fingernails/gloved fingers
  • Latest technology, may need to evolve a bit more!

Resistive touch screen:

Pros:

  • Relatively cheaper
  • Can operate with any pointing devices like stylus, pen, nail etc
  • Can operate at any level of humidity
  • Ease of use, as it could be used even with your winter gloves on!
  • Very useful for people using handwriting recongition system, due to ease of use with a stylus!
  • More accurate than capacitive touch screen!
  • Old technology and hence more reliable!
Cons:
  • Multi touch support not available. Though technology did evolve after some modifications with the existing resistive touch screen circuitry, its still not 100% developed yet!
  • Highly sensitive. As it can operate with almost any sort of pointing devices, can be more vulnerable with dust particles!
  • Poor visibility in sunlight, mostly due to multiple layers reflecting light!
  • Screen, being sensitive at the upper layer, can be more vulnerable to scratches!

Thursday, January 13, 2011

August 2007 - Comp Org & Soft Sys

------------------------------------------------------------------------------------------------------------------
 
What is the use of control memory? Differentiate between microinstruction sequencing and microinstruction execution.


------------------------------------------------------------------------------------------------------------------

Does disk striping improve I/O request rate performance compared to a comparable disk array without striping?
If a single I/O request consists of multiple logically contiguous strips, then up of 'n' strips of data can be handled in parallel, greatly reducing the I/O transfer time.

------------------------------------------------------------------------------------------------------------------
What is bus arbitration? What is the difference between synchronous and asynchronous bus.

------------------------------------------------------------------------------------------------------------------