1. Homepage
  2. Programming
  3. INFO-3137 Project 1: Abstract Factory for creating HTML and Markdown

INFO-3137 Project 1: Abstract Factory for creating HTML and Markdown

Engage in a Conversation
INFO-3137Abstract FactoryHTMLMarkdown

  CourseNana.COM

INFO-3137 – Project 1


Your Task CourseNana.COM

You are to create an Abstract Factory for creating HTML and Markdown documents. Each concrete implementation of the Abstract Factory is to be implemented as a Singleton. As well, the document factory is to use a Factory Method to create elements in the document. CourseNana.COM

  CourseNana.COM

Details

The Factories:

·       Need to have one concrete implementation each for both Html and Markdown documents CourseNana.COM

o   Html documents are created using the HTML5 standard CourseNana.COM

o   Markdown documents are created in the github format CourseNana.COM

§  See Markdown Cheatsheet for details CourseNana.COM

·       Need to be implemented as Singletons CourseNana.COM

·       Need to be able to create a concrete document implementation CourseNana.COM

·       Need to be able to create multiple element types from the Factory Method “CreateElement.” CourseNana.COM

The types you need to be able to create are: CourseNana.COM

o   Header (h1 to h3 at least) CourseNana.COM

o   Image (including alt text and title text) CourseNana.COM

o   List (ordered and unordered) CourseNana.COM

o   Table (including table header and table rows) CourseNana.COM

The Documents

·       Need to be able to add elements through a single AddElement method CourseNana.COM

·       Need to be able to run the document CourseNana.COM

o   This entails saving the document text to a file CourseNana.COM

o   It also entails running a browser to display them. Some details for one way to do this are outlined later in this document. CourseNana.COM

·       Accordingly, you’ll need to create an interface for HTML or Markdown Documents. It should contain the following methods: CourseNana.COM

o   void  AddElement(IElement  element); CourseNana.COM

§  When implemented in concrete HTML and Markdown Document classes, this should add elements to a current list of elements. CourseNana.COM

o   void  RunDocument(); CourseNana.COM

§  When implemented in concrete HTML and Markdown Document classes, this should generate either an HTML document or a Markdown Document and open it in chrome. CourseNana.COM


CourseNana.COM

The Elements

·       Need to store properties and be able to output the appropriate text for their own type to be properly added to the document. CourseNana.COM

·       Accordingly, you’ll need an interface for HTML or Markdown Elements. This interface doesn’t actually need any instance variables or methods, but will instead be implemented by individual concrete HTML and Markdown Element classes (ex. HTMLHeader, MarkdownHeader, HTMLTable, MarkdownTable, and so on) CourseNana.COM

·       These concrete element classes CourseNana.COM

o   Should contain a constructor that takes and assigns the properties of the specific element CourseNana.COM

§  Note that these properties will vary depending on the element. To see what they would look like, take a look at docs/CreateDocumentScript.txt. For example, an HtmlImage would have properties that look like “img/csharp.png;Alt Text;Title Text”, as specified in the .txt file. CourseNana.COM

o   Should contain a toString method that outputs a formatted string version of the properties, specific to the given document and element. CourseNana.COM

§  For example, in a concrete html image class, given the properties specified above, toString should return <img  alt='Alt  Text'  title='Title  Text' src='img/csharp.png/><br  /> CourseNana.COM

§  Take a look at Parsing_Tutorial.pdf, for some ideas on how to parse the properties CourseNana.COM

o   In the RunDocument() method, implemented in your concrete Document classes, you’ll ultimately end up calling these toString() methods. If you’ve implemented everything correctly, you should only have to call toString() once in each RunDocument() method (if you’re not sure how, feel free to ask!) CourseNana.COM

  CourseNana.COM

What you are provided with

Use the INFO3137-Project1 solution as a starting point. It is currently not able to compile and run, due to missing important interface types. It is your task to create the rest of the code. The solution contains: CourseNana.COM

·       A project called Director CourseNana.COM

o   This project will script your document creation CourseNana.COM

o   dIt contains a reference to the DLL you’ll use to create your factory CourseNana.COM

o   The project is also set to output to the appropriate directory to run the project CourseNana.COM

·       A project called DocumentFactory CourseNana.COM

o   This is where your factory implementation will go CourseNana.COM

o   You are provided with the IDocumentFactory interface to get you started CourseNana.COM

o   You are to create all other interfaces and implementations in this project CourseNana.COM

·       A folder called “docs” (not visible in Visual Studio) CourseNana.COM

o   It contains a file called CreateDocumentScript.txt. This will be used to test your factories. CourseNana.COM

§  The details of the syntax of this file will be outlined later in this document. CourseNana.COM

o   Lastly, it contains an image subfolder, where there is a demo image that is to be used in your documents. CourseNana.COM


CourseNana.COM

Things you’ll need

·       The demo project is implemented using Chrome, which means you’ll need chrome installed to CourseNana.COM

run it CourseNana.COM

·       To run Chrome from the command line, opening to a given page, you can use the following line of code CourseNana.COM

CourseNana.COM

o   You’ll still need to get the absolute local file path for the file you intend to open. CourseNana.COM

·       To view the Markdown document formatted properly in the browser, you’ll need this extension CourseNana.COM

o   To allow the extension to read local markdown files, you’ll need to go in to the CourseNana.COM

extension settings and set “Allow access to file URLs” to true CourseNana.COM

  CourseNana.COM

The CreateDocumentScript.txt Format

Some of the processing of this file is already handled for you, but you’ll still need to do some string CourseNana.COM

processing to get the various properties out of the file. CourseNana.COM

·       Each “line” of the file is considered to end when the character ‘#’ is read CourseNana.COM

·       The first part of each “line” is one of the following, and is delimited by a ‘:’ CourseNana.COM

o   Document CourseNana.COM

o   Element CourseNana.COM

o   Run CourseNana.COM

·       The Document line contains two sub parts, deliminted by the ‘;’ character CourseNana.COM

o   The type CourseNana.COM

o   The file name CourseNana.COM

o   You’ll use these to create a factory and a document CourseNana.COM

·       The Element line contains: CourseNana.COM

o   The element type, followed by a ‘:’ CourseNana.COM

o   This properties for the element CourseNana.COM

·       The Table Element has some special syntax CourseNana.COM

o   Each “line” of the table is delimited by a ‘;’ CourseNana.COM

o   Each of the parts of the table is delimited by a ‘$’ CourseNana.COM

o   The first item in each “line” is the type of the table row you’re creating, either head or row CourseNana.COM

·       The Run line contains only the word run. This will create and run the actual document on disk CourseNana.COM

  CourseNana.COM


Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
INFO-3137代写,Abstract Factory代写,HTML代写,Markdown代写,INFO-3137代编,Abstract Factory代编,HTML代编,Markdown代编,INFO-3137代考,Abstract Factory代考,HTML代考,Markdown代考,INFO-3137help,Abstract Factoryhelp,HTMLhelp,Markdownhelp,INFO-3137作业代写,Abstract Factory作业代写,HTML作业代写,Markdown作业代写,INFO-3137编程代写,Abstract Factory编程代写,HTML编程代写,Markdown编程代写,INFO-3137programming help,Abstract Factoryprogramming help,HTMLprogramming help,Markdownprogramming help,INFO-3137assignment help,Abstract Factoryassignment help,HTMLassignment help,Markdownassignment help,INFO-3137solution,Abstract Factorysolution,HTMLsolution,Markdownsolution,