Skip to content

Prototype app for software architecture & design patterns ๐Ÿ›

License

Notifications You must be signed in to change notification settings

jjvanzon/JJ.SaveText

Repository files navigation

JJ van Zon, 2022

๐Ÿ’พ JJ.SaveText โ˜

๐Ÿ“” Contents

๐Ÿงฐ Prototype App

The SaveText prototype app was an experiment from around 2014, to test certain software programming techniques.

Latest Release

๐Ÿค– Multi-Platform

One goal was to try and deploy the same .NET code on multiple platforms, like web or mobile, running on a database or saving a file on the file system.

๐Ÿฑ Design Patterns

Another goal was to test if certain design patterns might work practically, or at all under these circumstances. Design patterns are tested ways to structure your code, to make it better organized, to support a certain technical values like maintainability.

๐Ÿ›  Technologies

The following platforms, frameworks and techniques were tried out:

  • Databases
  • XML files
  • Mobile
  • Web
  • iOS
  • Android
  • Windows Phone
  • MVC
  • WCF
  • Hand-written SOAP client
  • Unity Game Engine
  • Entity Framework
  • NHibernate
  • WinForms
  • Online/offline sync

๐Ÿ› Architecture

The patterns and practices closely match the following guidelines for structuring software:

JJ's Reference Architecture

SaveText was an attempt to test a code architecture with an idea of minimal functionality, maximal architecture. The idea was, that when certain patterns work for simple situations, that might extend to more complex functionality. To see if the components can work together to accomplish technical desires. The result of that effort, is a proof of concept of techniques that might apply to more complex applications.

๐Ÿ’พ Saving a Text

As such, the only functionality SaveText possesses, would be to simply save a piece of text somewhere. Not much more than that.

โ˜ Online / Offline Variations

Explored were several online / offline variations: for instance one where the application talks to an online web service upon all user actions. Another variation is one, where user actions would cause local code to go off and things to be locally stored, until a synchronization might go off in the background, to send things to an online service in the cloud.

๐Ÿ”ฎ Older & Newer Tech

This project was from around 2014. Newer tech may have emerged (e.g. .NET Standard, Xamarin, Angular, Unity Game Engine free in Visual Studio Community edition and .NET 5.0 and above). This project might not have been updated since then. It was subjected to different constraints then.

๐Ÿƒ Unity Game Engine

The choice of Unity Game Engine may seem random. But it was the first technology at that time, that would work for deploying my code on multiple mobile platforms and using the Mono compiler. Other tech wouldn't work, crashed on me, or simply did not exist yet.

๐Ÿ’ป Web Site (MVC)

  • This is a 'web site' variation on SaveText.
  • It uses ASP.NET MVC technology for the user interface.
  • It tries to connect to a database, using NHibernate as the underlying data access technology.

๐ŸŒ App Service

  • This is like a 'cloud' web service, to which some of the apps might connect.
  • It exposes a SOAP web service using WCF communication technology.
  • It connects to a database, using NHibernate as the underlying data access technology.

๐Ÿ–ฅ Windows Applications

Several Windows applications were made.
They test different online/offline situations.
And different types of storing the data too.

  • JJ.Presentation.SaveText.WinForms.Offline
    • Works offline.
    • Stores data in a local XML file, using System.Xml.Linq, as the underlying data access technology.
  • JJ.Presentation.SaveText.WinForms.OfflineWithSync
    • Stores data in a local XML file, using System.Xml, as the underlying data access technology.
    • May sync with SaveText's cloud service at certain intervals.
    • It uses WCF for that as the communication technology.
  • JJ.Presentation.SaveText.WinForms.Online
    • Does not store locally.
    • Contacts a SaveText's cloud service for each action a user may perform.
    • It uses WCF for that as the communication technology.
  • JJ.Presentation.SaveText.WinForms.Online.CustomSoapClient
    • Does not store locally.
    • Contacts a SaveText's cloud service for each action a user may perform.
    • It uses a custom-programmed SOAP client for a communication technology.
  • JJ.Presentation.SaveText.WinForms.OnlineOfflineSwitched
    • Can be in online mode, but switch to offline mode as well and back.
    • When online it may contact a SaveText's cloud service for each action a user can perform.
    • When offline it would store data locally in an XML file, using System.Xml, as the underlying data access technology.

๐Ÿ“ฑ Mobile Apps

  • The mobile deployments were tested once, but a while back, and may not be up to date with technology.
  • So maybe do not to expect too much from them.
  • They might not be compatible anymore with newer mobile devices.
  • The precise way these deployment files are to be used, is not be described here. Here is just an impression of it.
  • The Android variations might have been installed once, by copying it to the right location on an Android phone.
  • The iOS variation required an Apple Mac running XCode and a paid Apple Developer Program subscription.
  • The Windows Phone variation was deployed, using a version of Visual Studio specifically tailored for Windows Phone.
  • The mobile deployments may not have all the variations (Online, Offline, OfflineWithSync, etc.) The possible cause of this is, that testing did not get further than trying to connect to a web service from Unity Game Engine technology. Web service connections might not have worked that well yet using Unity Game Engine on Android, so it might not have gotten further than that.

๐Ÿ“‚ Folders

The folder structure is representative of the main layering:

  • Data
  • Business
  • Presentation

Another folder:

  • Database: Database initialization and migration

โš™ Dev Env

Here you may find some pointers how to set up a developent environment to build and run JJ.SaveText projects.

๐Ÿ‘จโ€๐Ÿ’ป Visual Studio

  • Visual Studio Community 2019 or 2022 may be needed to open the projects and solution file.

๐Ÿ•น Unity Game Engine

  • Some projects were made using Unity Game Engine 4.3.4 (the free variation).

๐Ÿ’ฝ Database

  • The folder Database\SaveTextDB may contain a database backup.
  • The file might be restored in SQL Server with name "DEV_SaveTextDB".
  • The database user name "dev" may be expected with password "dev".

๐Ÿ“ฆ JJ.Framework

๐Ÿงฑ JJ.Canonical

  • JJ.Data.Canonical and JJ.Business.Canonical can also be found right next to the JJ.Framework packages in JJs-Pre-Release-Package-Feed.

๐Ÿ“ก Internet Information Services (IIS)

  • Some web projects might like to run under Internet Information Services (IIS).
  • They may not load otherwise.
  • Trying to reload a web project:
  • The Output window in Visual Studio might show an expected web address and host name, that might be useful for setting things up.

  • You might want to install IIS.
  • Create web site for each of the relevant projects.
  • Also the Windows hosts file might be changed. Each site added to IIS might need entries in the file C:\Windows\System32\drivers\etc\hosts.
  • Here follow suggestions for each of the sites to create and their settings.
  • (Physical path root folder C:\Repositories\JJ.SaveText may vary.)

  • Web Site

    • C# project:
      • JJ.Presentation.SaveText.Mvc.csproj
    • IIS site name:
      • DEV_JJ.Presentation.SaveText.Mvc
    • IIS site physical path:
      • C:\Repositories\JJ.SaveText\Presentation\SaveText.Mvc
    • IIS site binding host name:
      • dev.savetext.jjvanzon.io
    • hosts file entries:
      • 127.0.0.1 dev.savetext.jjvanzon.io
      • ::1 dev.savetext.jjvanzon.io
  • App Service

    • C# project:
      • JJ.Presentation.SaveText.AppService
    • IIS site name:
      • DEV_JJ.Presentation.SaveText.AppService
    • IIS site physical path:
      • C:\Repositories\JJ.SaveText\Presentation\SaveText.AppService
    • IIS site binding host name:
      • dev.savetextappservice.jjvanzon.io
    • Additional IIS binding with port:
      • 6371
    • hosts file entries:
      • 127.0.0.1 dev.savetextappservice.jjvanzon.io
      • ::1 dev.savetextappservice.jjvanzon.io
    • Unfortunately, some mobile apps may try to reach host 83.82.26.17:6371 instead.

๐Ÿ•˜ Checking Out Old Commits

JJ.SaveText was once part of a larger code base. It was extracted to become a new git repository with history in tact. Some quirks when checking out older history items, may have to do with that. The following may only be relevant when getting older commits from history (before November 2022).

  • Commit messages:
    • May mention projects not part of the JJ.SaveText repo.
  • References to other non-existent projects:
    • To fix this, try referencing the NuGet version of these dependencies.
  • Broken project references to JJ.Framework / JJ.Canonical:
    • JJ.Framework / JJ.Canonical projects are no longer in the same code base.
    • You could try referencing the NuGet version of these dependencies.
    • But another solution may be to clone the JJ.Framework repository and put the JJ.Framework folder right next to the JJ.SaveText folder. This may fix the broken links.
    • Same for the JJ.Canonical repository.
    • But sometimes the paths are still incorrect and may need to be modified (with Notepad)?
    • But then you could use a specific commit from JJ.Framework or JJ.Canonical's history.

๐Ÿ‚ Archived Demos

There used to be demos in this repository, not really related to the SaveText project. They can still be found in the JJ repo under the same license.