Serenity: Where to Start?

Created on 12 Nov 2018  路  9Comments  路  Source: serenity-is/Serenity

I'm intrigued by this framework and really want to try to use it for my current project. I have been a Developer for over 30 years and written several .Net apps, but don't really have much experience with any of the newer frameworks. If someone could give me some tips to push me in the right direction, I would really appreciate it!

Perhaps the best approach would be to just describe a specific "page/scenario" that I need to develop? If I can get this developed, it should answer most of the questions I have.

I have created my project and used Sergen to generate a corresponding "Identifier" for each of my SQL Tables. Here is a brief explanation of some of the tables from my "WMS" (Warehouse Management System) Database that pertain to the "page/scenario" I am referring to):

VendorShipments        -  Daily Orders/Shipments, built by exporting data from our ERP System (received via EDI).
                          Key fields: Plant, OrderNum, DockCode, ShipDate, ShipTime, PartNum, OrdQty, Completed?
                          <Plant+OrderNum+DockCode> - represent a single/unique "Order"
                          "Completed" is just a "boolean" indicating if this line item has been successfully "Approved".
                          (Approved = the system sent a "SkidBuildOrder" to the vendors RESTful web service and received a Confirmation#.)
                          Each Row in this table is for a specific PartNum, so generally there are 10-20 Rows per "Order".

ScanManifest           -  All the Manifests that have been scanned/shipped.
ScanPart               -  All the Parts that have been scanned/shipped.

SkidBuildOrder         -  Contains the Orders that have been sent to the Vendor for "Approval".
                          Key fields: Plant, OrderNum, DockCode, Confirmation#
SkidBuildSkid          -  "Child" of above, Identifies the actual Skid/Pallet for the associated "SkidBuildOrder".
SkidBuildKanban        -  "Child" of above, Identifies an actual "Box" that is stacked on the associated "SkidBuildSkid".
                          This Row is populated using one of the "ScanPart" rows.
SkidBuildOrderResponse -  "Child" of "SkidBuildOrder", contains the Response when the "SkidBuildOrder" is sent to the Vendor's RESTful API for Approval.
                          Key fields: ResponseCode, Confirmation#, ExceptionMessage.

(I am leaving out several Tables, that don't effect this scenario.)

All tables have an autoincrementing, integer, primary key field "ID" and the specific "child" tables have "ParentTableID" type Foreign Keys.

(Other than some possible MINOR changes, those Tables are pretty much set in stone, they are populated via several different sources, such as a Client/Server apps and aplications running on handheld barcode scanning devices.)

So, my Web Project folder looks like this:

ModulesWMS ("Warehouse Management System")
ModulesWMSScanManifest
ModulesWMSScanPart
ModulesWMSSkidBuildKanban
ModulesWMSSkidBuildOrder
ModulesWMSSkidBuildOrderResponse
ModulesWMSSkidBuildSkid
ModulesWMSVendorShipments

The "page" I need to develop could be considered a "dashboard". It should display the "VendorShipments" that have NOT been "Completed/Confirmed" that are scheduled to be Shipped today. (With an option/button to display ALL the Vendor/Shipments, "Completed/Not".) I need to give the user the ability to create and edit "SkidBuildOrders" (and the other "SkidBuild*" Tables) using data from the "ScanManifest and "ScanPart" tables, or by simply adding rows "manually" to SkidBuildSkid and SkidBuildKanban. The user should also have the ability to "Submit" (just in terms of a "Generic Action") ANY of the SkidBuildOrders (even those that have been Confirmed.

(Note: Some VendorShipments may have failed "Approval" and need modification, but some may not have been sent at all, although they orders may exist in partial or even in FULL in "ScanManifest" and "ScanPart"...)

I am simply struggling with how to "start" this. Do I create a new folder under "ModulesWMS"? Do I create a new Controller? Obviously "VendorShipments" is the "main" Table I will be using, so do I create a new Page/Controller/Form/OTHER under "ModulesWMSVendorShipments"? Obviously, I would create a new "Controller" and "View", but would I need to create a new Folder under "Modules"? This would be a classic example of a "ViewModel", right? I'm just struggling with "how" to implement this in the framework. Then I have things to consider such as the "Parent/Child" relationships, the way the "VendorShipments" table is "related" to the SkidBuildOder table by Plant/OrderNum/DockCode (and no Foreign Key). How to show "filtered" data. Etc. Etc.

Any help here would be GREATLY appreciated!

Most helpful comment

There are many hooks available to implement business logic, just you have to explore.

All 9 comments

You should start by reading the guide and doing tutorials.

Or simply check the demo app. It has traditional Northwind sample dealing with Orders, Customers, Ordered Items and all that jazz

And you dont need to make any views and models. Just generate whole UI for desired tables via SerGen. All will be generated, whole CRUD interface as well as menu item.

And I have done all three of those comments... Watched every YouTube Video from the three or four sources that are out there and for some reason, I just can't figure out the "best" way to go about what I described. The CRUD is great, it works, looks good, has some nice basic features, etc. I think its just my OCD wanting to do things the "correct" way. Although, I do know there are "scaffolding" and or "declarative" things that happen behind the scenes, After doing everything suggested here (starting about 6-8 weeks ago), at least twice (sometimes a few more times), I'm still not quite sure "how" to design the dashboard I described. Although, I must admit, just writing it all out gave me some ideas and I have at least begun, so maybe it will just all fall into place. "The journey of a thousand steps"... or something like that...

And, if I don't make the progress I need to day, I'm just gong to revert to traditional ASP.Net WebForms and get something FUNCTIONAL, then maybe revisit the framework when I;m not under so much pressure to finish. (I just look at where I'm at and think... I'm already SO FAR along! Don't give up now and start over from scratch! LOL)

And you dont need to make any views and models. Just generate whole UI for desired tables via SerGen. All will be generated, whole CRUD interface as well as menu item.

I guess I wasn't very clear in my description.. I have the basic CRUD working, for every table, in my entire SQL database. It's this "Dashboard" that I described that I am having trouble figuring out "where/how" to begin.

In fact, I have created a few different projects now... hooked up the corresponding SQL databases and tables and generated basic CRUD sites for them. That works fantastically quick and easy. It's the situations like I described above (implementing Business Logic and Processes into "custom" pages) that stump me...

To implement business logic, you can override methods in the repository.
for example: in every repository you have the following lines of codes

        private class MyDeleteHandler : DeleteRequestHandler<MyRow> { }
        private class MyUndeleteHandler : UndeleteRequestHandler<MyRow> { }
        private class MyRetrieveHandler : RetrieveRequestHandler<MyRow> { }
        private class MyListHandler : ListRequestHandler<MyRow> { }

if you want to trigger some code after saving an entity, you can write the following

private class MySaveHandler : SaveRequestHandler<MyRow, SaveRequest<MyRow>, SaveResponse>
        {
            protected override void AfterSave()
            {
                base.AfterSave();
                //do something here with Row
               }
            }
        }

There are many hooks available to implement business logic, just you have to explore.

@ShayneJud dashboard is easiest. just remove what u dont want and put your c# code after @ and you are golden. no need for web service or anything.
very simple

Serenity Framework in my humble opinion is not focused on the dashboard but mostly on data handling via grid and dialogs. With data handling, that's where the power of sergen and the whole framework steps in. The dashboard however is nearly a 1:1 clone of what is already provided by AdminLTE and I had to heavily customize (means doing the programming completely by myself and only reuse some widgets from AdminLTE).

If you need to design a complete dashboard for all your requirements, Serenity Framework does imho not really help you as there is a nearly complete lack of anything what is needed to quickly put together a dashboard without a lot of custom programming.

Would be nice if Serenity Framework would provide some declarative programming to put together quickly a nice dashboard with the elements/widgets which AdminLTE has already. :-)

But as I am only an Admin with some dev ambitions (and no full-blown dev), my dev knowledge is surely too low to really be of relevance in this matter :-)

With kind regards,

John

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AmuthaKondusamy picture AmuthaKondusamy  路  3Comments

Shraddha996 picture Shraddha996  路  3Comments

ga5tan picture ga5tan  路  3Comments

newyearsoft picture newyearsoft  路  3Comments

kilroyFR picture kilroyFR  路  3Comments