#1 2016-06-24 07:37:57

zekeriye
Member
Registered: 2016-06-09
Posts: 15

Server program suggestion to decision?

Hi;
I am a newbie delphi and mormot too...
I want to desing a program which has got a lot of part.
I want to use mormot framework to writing this program. Mormot is very nice framework thanks alot to contributors.
All of program(s) share  one database (schema)
Data may be store on a MSSQL Server 2008 or over version, may be MSSQL2005

When I was collecting parts of program has got only five main part.
1th - Some of user use a program on a windows PC these are VCL client1 from local network or RDP (alternatively may be websockets remotely) (Most of users)
(This part of program looks like an accounting system)
2nd - Some of user use another screens using windows PC which is different from fist. These are VCL Client2 from local network or RDP (alternatively may be websockets remotely) (Most of users) (This part of program looks like manufacturing service)
3rd - Some of user use an android/ios device for entry very small data or take reports from data. (a few users) (this part of program looks like a pivot table report or looks like sending items using barcode) May be this part of program divide with two different part. One of take pivot report and other part is sending items using barcode)
4th - Some of user input data from via web interface (I think for broken comminucation, may be run a syncdata services) using online store. (I haven't got any idea and knowledge how much users may be use web interface) (This part of program looks like a hotel booking/reservation service)
5th - Data import/export for importing/exporting with using an other programs (via TXT, CSV, XLS, XLSX etc) and share some of data.

How can I design the server program(s).?
All of this function is mix and run only one service(server) applicaton ?
or
One service(server) application one of that position. Now we got 4 position and 4 service (server) application?
Which type of server(service) application to that position RestFull, RestServer, Restserver ORM, etc ?
Which one is best solution ? Which way I used pfreferred solution ?

Can you help me suggestion to solve this decision.

ps: sorry my bad english.

Last edited by zekeriye (2016-06-24 07:40:26)

Offline

#2 2016-06-24 10:15:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Server program suggestion to decision?

The implementation idea may be to define some services.
Via SOA interface-based services.

You have to define several services.
One interface per "context": accounting, manufacturing, reporting, export, booking...
The idea is to share most of the code for all kind of clients.

All your process would be implemented on the server side, then accessed from VCL clients via REST, and from a web client via mORMot MVC/Mustache.
Perhaps the easiest for mobile apps is to use some web client with a Mustache view and a mobile-friendly CSS (like BootStrap).

Try to uncouple your DB from the service.
Use several interfaces to define several "persistence services", depending on your contexts.
Implement the persistence using manual SQL over an existing MSSQL database.
But if you can, use rather a SQlite3 database and the mORMot ORM instead - you will have much better performance, and easier deployment.

Offline

#3 2016-06-25 09:33:41

zekeriye
Member
Registered: 2016-06-09
Posts: 15

Re: Server program suggestion to decision?

fisrtly thanks for your reply;
I have got some question;
1)
  for accounting context: One action is creating an invoice
     This action has got these steps
        - choose customer
        - optionally add shipment address
        - choose invonice line item and change or accept priece (one or more)
        - after inserting/editing lines optionally make discount
        - choose payment metod and if necesssary take payment)
        - save invoice     
        - print /send /report this invoice.

For these steps which way you prefer;
   a - each step has got an interface
   or   
   b - all of steps only one interface

a or b ?

2) another my question is;
    for accounting context has got more than one action/section.
         - demand and offers,
         - customers,
         - invoices, 
         - bank,
         - spending money some action etc.
   for each action could I implement a service interface than all accounting interfaces implemant one accounting interface
   or
   implement only one accounting interface and all of accounting actions published an interface section per action.

sorry my bad english:(

Offline

#4 2016-06-25 11:11:52

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Server program suggestion to decision?

1) Use a pragmatic and iterative approach.
One interface for each context at first, then split the interface (e.g. extract the print/reporting features) if it becomes too big.

2) Define objects, then use those objects as input/output parameters to service interface methods.

And if you can, try to read about DDD.
It is a huge subject (only introduced in the mORMot doc), but it definitively helps proper modeling...

Offline

#5 2016-06-27 07:49:28

zekeriye
Member
Registered: 2016-06-09
Posts: 15

Re: Server program suggestion to decision?

2) Define objects, then use those objects as input/output parameters to service interface methods.

as I understood this an example;

define an invoice  object which contain or referanced
   define an customer object
   define lines object
   define payment object
   define shipment object

Use this object via service interfaces method.

an object may be has referanced one or more than one object.

is it correct ?

If I do this am I make an DDD design?

Offline

#6 2016-06-27 08:19:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Server program suggestion to decision?

In fact, the whole point about DDD is to uncouple your domain from the rest, especially the application layer.
So you would have to create DDD objects, then isolate them from publication from the various clients, using DTO (Data Transfer Objects) in the application layer.
The main rule is: do not leak your domain!

Offline

#7 2016-06-27 08:25:41

zekeriye
Member
Registered: 2016-06-09
Posts: 15

Re: Server program suggestion to decision?

Thanks a lot.

May I send an test application to you for adding to samples? (as soon as possible)

Offline

Board footer

Powered by FluxBB