Giter Club home page Giter Club logo

functionalpatterns's Introduction

Overview

This project shows different OO Design Patterns and how I solve them in F#

Builder

Instead of directly creating functions with a string output i use a data-structure. Using a data-structure has many advantages. For example you need only one function to create proper HTML code with escaping and user rules. Instead of re-doing this, again and again.

You also can create structures that can be easily re-used.

Decorator

  • Decorator1.fsx - Example from Video - I would change nothing
  • Decorator2.java - A "good" Java Example of Decorators
  • Decorator2A.fsx - Solution with DU and plain functions
  • Decorator2B.fsx - Solution with a common Record

Factory

  • Factory1.fsx - PHP CarFactory example re-written in F#
  • Factory2.fsx - Wikipedia IPerson example re-writte in F#
  • Factory3.fsx - My own Example showing Partial Application
  • Factory4.fsx - A Java Example with Shapes converted to F#

Interpreter

  • Interpreter1.fsx - A simple Calculator

Strategy

  • Strategy1.cs - C# Example from Wikipedia
  • Strategy1A.fsx - A more direct conversation of the C# version
  • Strategy2B.fsx - An extended version that creates a data-structure

Further Resources

I started this project by watching a video, but then it turned into something different. Here are various resources I used to create this project.

functionalpatterns's People

Contributors

davidraab avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.