DPS907 WSA500 Lab 5

Create a full-featured “new project” template.

.

Read/skim all of this document before you begin work.

.

DPS907 WSA500 Lab 5 – Due Tue Oct 14

Due date: Tuesday, October 14, 2014, at 8:00am ET

Grade value: 3% of your final course grade

If you wish to submit the lab before the due date and time, you can do that.

.

Objective(s)

In the first half of this Web Services course, you have learned and applied several concepts. At this point in time, you must create a ‘new project’ template that includes all the functionality needed to build web services in the second half of the course.

Then, you will use the Visual Studio ‘export template’ feature to make it easier to create a new project in the future.

.

Introduction to the problem to be solved

The problem is that it often takes too much effort to get started on a web service project. You will solve that problem now.

.

Specifications and work plan

Think of all the functionality needed in a web service, and also think of the effort needed to implement the functionality. Although this assignment will likely not be too demanding intellectually, it does require attention to detail.

Remember all the times you wished you had a time-saving procedure. Try to use and implement these in this assignment.

.

Getting started

You can start from a Visual Studio “FILE > New > Project” template, or you can use one of your recent projects as a base.

If you use one of your recent projects as a base, you can use the familiar ‘copy project’ procedure.

Also, do not simply use one of the GitHub repository code examples as a base. You can take inspiration and suggestions from these best practice code examples, but do your own work. This is not a ‘copy-paste’ exercise.

The suggested name for the project (new or copied) can be in the format “Template-2014-10-09”, which includes the word “template” (to indicate its usefulness in the future) and the current date (in Y-M-D format).

As you perform each step, test your work, to ensure that you’re making error-free progress:

  • Build/compile
  • Where appropriate, use Fiddler

.

Component configuration

Here’s a listing of the functionality needed in the template. Contact your professor if you have questions:

Uses the Entity Framework.

Includes AutoMapper.

The Models folder includes two source code files:

  • DataContext.cs – includes the classes needed for persistent storage
  • DesignModelClasses.cs – for your design model classes; can include a discardable ‘template’ class if you wish

Includes a ServiceLayer folder, with some source code files:

  • Repository.cs – for the repository abstract base class
  • Worker.cs – for the unit-of-work class
  • optionally, a <TEntity>_repo.cs ‘template’ file, to make it easier and faster for you to create entity repository classes in the future

Formatters folder, with the image media formatter.

Handlers folder, with these modules:

  • HTTP OPTIONS method handler
  • Exception handler

Controllers folder, probably with some source code files:

  • ‘root’ controller to enable root-level discovery of the web service’s capabilities
  • Links_vm.cs classes to support link relations
  • optionally, a template for resource model classes, which include stubs and/or comments for the kinds of resource models that you will need in a project
  • optionally, a template for a controller, with stubs and/or comments for the typical actions performed in a controller

All the necessary startup statements in the WebApiApplication class.

Suitable cshtml files with useful content (Views > Home > Index.cshtml, and Views > Shared > _Layout.cshtml).

No leftover garbage. Make sure that the project does NOT include unusable code or other artifacts.

.

You do have permission to use the following code as is: 

  • HTTP OPTIONS handler
  • Image formatter
  • Exception handler
  • Link class in Links_vm.cs
  • Repository abstract base class (although you may want to edit some of those methods)

DO NOT simply copy-paste my code. Write your own code. However, you can (and often should) use the same names for variables, where appropriate, because many of the variable names used in the code example are meaningful. Also, write your own comments. 

.

Saving your work as a template

When you’re ready to save and finalize your work, you will use a new-to-you feature.

The Visual Studio FILE menu has an “Export Template” item. It enables you to save the current work as a “Project template”.

The “Select Template Options” dialog needs two names:

  • Template name – this is how it will appear in the Visual Studio “FILE > New > Project” dialog
  • Template description – a full / complete description of the template; include enough information to remind your future self what’s included in the template

If you are working on your own computer, check / mark the “Automatically import the template…” check box.

Check / mark the “Display an explorer window…” check box, so that you can locate the template result, which is a compressed file (i.e. a zip file). This will be important, because you will be submitting the template for grading.

This MSDN Library ‘how to’ article also covers this procedure.

This MSDN Magazine article will tell you more about this feature.

.

Using your template for a new project

Ensure that your template works. Start a new Visual Studio instance.

Create a new project, using your template. It will be located in the list that appears when you select the left-side navigation path “Installed > Templates > Visual C#”.

Your professor will attempt to use your submitted template to create a new app.

.

Reminder about academic honesty

You must comply with the College’s academic honesty policy. Although you may interact and collaborate with others, you must submit your own work.

.

Submitting your work

Here’s how to submit your work, before the due date and time:

1. New for this assignment: Locate the folder that holds your template files.

2. Ensure that you can see the zip file. This is the file that you will be uploading.

3. Login to My.Seneca. Open the Web Services Architecture course area. Click the “Assignments” link on the left-side navigator. Follow the link for this lab. Submit/upload your template / zip file. The page will accept three submissions, so if you upload, then decide to fix something and upload again, you can do so.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: