Wednesday, April 30, 2014

The steps for assignment 4

First we had to prepare the server. Automart lacked a couple of fields that we needed so we

1.Added a field to the registered customer table to store the randomly generated pass code
2. Added a field to store the hashed password
3. Added a Login called AutomartLogin
4. Added a user in Automart to map to the login
5. Assigned permissions for the new user
7. Changed the login mode on the server to SQL Server and Windows mode
8. Restarted the server so the mode change could take place


In Part two we created a form and classes to store the value. Specifically we

1.Created a form in the Default.asp with all the fields we needed to register a new customer
2.Created a new C# Class called Customer to store the fields.
3.Created a class ManageCustomer to write the class to the database
4. Placed the connection string in the WebConfig file
5. Added the HashPassword and RandomGenerator classes so that we can hash the password before writing to the database

The Manage customer has to write to three different tables: Person, Vehicle and RegisteredCustomer, so we had to create three SQL Statements and three SQLCommand objects. The fields to be inserted are designated as parameters and their values are found in the Customer class.


What we still have to do

First we have to connect the form to the classes so we can get the values and pass them to the manageCustomer class to write to the database.

Then we have to work on the Login. The login process is complicated. Here is a diagram that may help:

The final thing we should do, is clean up and add some error trapping to make the program less fragile.

Classes and Objects

Here are the class diagrams for the Card and Deck objects:

Here is the C# code for the Card Object. It uses a short cut syntax that lets us not have to explicitly write the get and set methods.

Here is the Deck program. I have added all the methods in the diagram, but I haven't implemented all of them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeckOfCards
{
    class Deck
    {
        private List cards;

        public Deck()
        {
            //initialize the list in constructor
            cards = new List();
            //initilize the deck with 52 cards
            InitializeDeck();
        }

        private void InitializeDeck()
        {
            string suit = null;
            
            for (int i = 0; i < 4; i++)
            {
                //chose the suit
                switch (i)
                {
                    case 0:
                        suit = "hearts";
                        break;
                    case 1:
                        suit="diamonds";
                        break;
                    case 2:
                        suit="clubs";
                        break;
                    default:
                        suit="spades";
                        break;
                }
                //get the card numbers for each suit
                for (int j = 1; j < 14; j++)
                {
           Card c = new Card();
                    c.Suit=suit;
                    c.Number=j;
                    cards.Add(c);
       }
                
            }
        }

        public List GetDeck()
        {
            return cards;
        }

        public void Shuffle()
        {
        }

        public void AddCard(Card c)
        {
            cards.Add(c);
        }

        public void RemoveCard(Card c)
        {
            foreach (Card card in cards)
            {
                if (c.Suit.Equals(card.Suit) && c.Number == card.Number)
                {
                    cards.Remove(c);
                }
            }
        }

        public Card GetCard(int index)
        {
            return cards[index];
        }
    }
}

Here is the code to get the deck and display all the cards

And here is a picture of it running

Monday, April 21, 2014

Activity Diagrams

Activity Diagrams are about describing the flow of a process.

This is an activity diagram for checking out equipment. It has several decision points. First does the client have blocks or fines? If they do does the client pay for them? Next the employee searches for the equipment. Is it Available? If it is check it out. If not the client has a decision to either reserve the equipment or just end the transaction.



The Second diagram is the same of the first but with the addition of Swim lanes. Swim lands let you distribute the actions according to what actor or object is responsible. In this case I just split it between the Client and the Employee actors. This could be more detailed depending on the process being described



Thursday, April 17, 2014

Use Cases

Here is the diagram we did in class

Monday, April 14, 2014

Alternative Solutions and Feasibility

Alternative solutions

Most problems can be solved in a variety of ways. It is important to consider several options when looking for solutions. There is often, for instance a commercial solution available. This is especially true if the project is designed to solve a fairly common problem. For instance any retail business will need a point of sale system or an inventory system. There are dozens of commercial packages available for consideration. Certain types of businesses will have common needs. All dentist’s offices, for instance will need to track appointments, patients, treatments, etc. There is software available that is generally applicable to any Dental business. Often it is cheaper and more effective to simple purchase a solution rather than develop it one’s self. Development time can be expensive, and development always entails the risk of failure, whereas a purchased system has been tested and is usually supported. That being said, though, a commercial system is often too generic. It may not be flexible enough to meet the specific needs of a given project.

If one is proposing to develop a solution, it is important to consider the resources available. What programming expertise do you have available? What languages and platforms are they experience with? Which languages and platforms provide the best match to the problems to be solved?

It is also important, when looking at solutions to consider what the consequences are of leaving the situation essentially unchanged. It may be that the problem that gave rise to the proposed project is not severe enough to justify the cost and risk of the proposed solutions.

Typically there are at least three alternative solutions, a high end solution that meets all the requirements and has all the desired features. A middle solution that meets all the requirements and adds some of the desired features and a low end solution that meets the requirements but has none or very few of the desired features.

From the Narrative

A few days later Jennifer and Loren get together to go over their results. Jennifer found several pre-built commercially available systems. The most promising is one called Mastery Management systems. They provide software and tools to track inventory and handle check outs and check ins. They also provided wands and scanners to help track the inventory. Of the commercial sources she investigated, they were the least expensive and that could best scale down to their fairly simple operation.

Loren has spent some time considering what the lowest cost solution would be. He determined that if the parks equipment warehouses just added some protocols it would have some positive effect. For instance, if every client had to sign out the equipment just on a sheet of paper and resign when they brought it back in, it would help. Clients that didn’t sign back in, could be kept from checking out more equipment until they showed that the equipment had been brought back or paid for the missing equipment.

“And, of course,” says Loren, “there is my friend who could create a program that would help us track equipment. It wouldn’t be as extensive as the Mastery Management system you found, but it would probably be better than just keeping a written record.”

“Ok, so we have some choices. What do we do next?”

Loren says, “We should look at how feasible each option is, then we should present them to the administrators and make a recommendation based on which option we think best fits our current needs and situation.”

How do go about deciding how feasible an option is?”

Feasibility

It is important to determine if a project is "feasible" or not. Feasibility refers to the likelihood of a project achieving a successful conclusion. There are several different aspects of feasibility to consider. Does the project make sense financially, that is, will it ever make more money than it costs to develop and implement? Is it technologically feasible? Do the technology and resources exit to implement the plan? Can it be done in a reasonable amount of time? Does the project make sense in terms of the company’s culture and values? Are there legal or contractual issues that must be addressed for the project to succeed? Below is a brief discussion of each of these considerations.

Financial Feasibility

Financial considerations are among the most crucial. Will the project "break even?" Will the benefits of the project be greater than the costs? To determine this requires some work with spreadsheets. One must identify all the one-time costs and the continuing costs and measure these against the benefits the project is estimated to bring in.

When calculating these costs and benefits it is important to remember that one is not looking at the total cost of doing business, but only at the additional costs or benefits that result from the project. One should for instance not include current utility costs, or the salaries of current employees unless the project impacts them. If the project requires that some employees receive a change in salary or that new employees be hired, then they should be included in the project's financial analysis. The intention is to see what effect the project will have on the business.

Much of the calculation of both the costs and the benefits is informed speculation. No one knows what the future will bring. One can only make reasonable guesses based on past performances and the performance of similar projects. Consequently it is crucial that one be very clear about the assumptions behind the guesses. Each assumption should be carefully documented and justified.

One-time Costs

One-time costs are costs that are usually incurred at the beginning of the project and only have to be paid once. They can include things like remodeling, updating servers and computers, programming, purchasing software, and initial training. For instance, the one-time costs for the Master Management System include the price of a new computer, the price of the software, scanning wands, and training:



Continuing Costs

Continuing costs are costs that will continue for the life of the project. These can include licensing costs that are paid periodically, increased electricity and utility expenses, maintenance expenses, etc. For the Master Management option the continuing costs are the client cards and the maintenance contract.



Benefits

There are two kinds of benefits tangible and intangible. Tangible benefits are benefits which can be assigned a dollar value. Only tangible benefits are considered in a financial feasibility analysis. Intangible benefits are benefits for which it is hard to attach a dollar value. Intangible benefits can include things like increased good will with customers, improved employee morale, an enhanced public reputation. All of these can result in increased profitability, but it is hard to assign them a precise figure.



Break Even

A break even analysis is a spreadsheet that determines when, if ever, the benefits will outweigh the costs of the project. There are many ways to calculate this. Some of the more sophisticated ways use the future value of current benefits and costs. Some calculate in estimated inflation rates. The example below is one quite simplified. It doesn’t include future values or interest. It assumes constant costs and benefits. The break even calculation in the spreadsheet, in the first year, takes the Total Benefits and subtracts the Total One Time Costs combined with the Total Continuing Cost. For the remaining years the equation is the Total benefits minus the Total Continuing costs and the negative amount from the previous year.

Given those simple assumptions, the Master Management project can be expected to break even in the fourth year.



Here is a snapshot of the formulas used in the spreadsheet.



Technological Feasibility

Determining Technological feasibility requires answers to a few key questions: Does the technology the project requires exist? Can the technology be acquired for a price that doesn't negate the projects financial feasibility? Is the technology compatible with the current systems, and if not what is required to make it compatible. Does making it compatible make financial sense? What kind of support will the technology require? Does the company have the people and resources necessary for that support? If any of these questions is answered in the negative, it is possible that the project is not technologically feasible.

Time Feasibility

One of the first questions about any project is how long will it take? This is not just a casual question. Generally a project doesn't start to produce benefits until it is finished. The longer it takes to finish the more it costs. Business moves quickly. If a project takes too long it may become irrelevant. The business need or opportunity that spawned the project may have changed. New technologies or tools may have become available. Many projects fail because they take too long to complete. In the end they are just abandoned and new projects begun.

Cultural Feasibility

Cultural feasibility is more subtle, but not less important, than the other feasibilities. Cultural feasibility has to do with how well the project's outcomes fit with the company’s culture and with customer’s habits and expectations. For example, a company that has always had a very hierarchical management structure may have difficulty adapting to a new electronic system that is more egalitarian and puts more decision making power in the employee's hands. A company that has always valued individual and personal relations with customers may balk at moving all, or even some, of its transactions with customers on-line. It is also always worth considering how projects effect employees. Often employees may find their job duties changed because of a project, and there is always a fear that as a result of a project their job may be eliminated.

If there is enough cultural resistance to a project, either from within the company or from the customers, a project may be unfeasible. It is important to have employee and customer buy in. It may be that in time, with training and outreach, that a project can overcome resistance and go forward.

Legal Feasibility

Sometimes a project has legal or contractual issues that may affect its feasibility. Privacy laws or laws related to data handling and retention might have to be considered. The project could have implications for union contracts. Patents and copyrights may also be relevant. Ignoring any of these could bring the project to a halt or cause it to fail entirely.

Vocabulary

Feasibility—the likelihood of a project reaching successful completion
Financial Feasibility—the analysis of whether a project will accumulate enough financial benefits to cover its development costs
One-time costs—costs that occur only once in the project development
Recurring Costs—project costs that will recur periodically throughout the life of the project
Benefits—financial and other grains as a result of the project
Technological Feasibility—the chances of acquiring the necessary technology and support to successfully complete the project
Time Feasibility—the chances that a project can be completed in a timely enough manner to reap the benefits of the project.
Cultural Feasibility—the likelihood of a project being accepted by those affected by the project
Legal Feasibility—the chances of resolving any legal issues related to the project