Business Objects  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Business Objects

Postby SBarnes » Fri Jun 30, 2017 7:36 pm

Hi Mike

A while ago I asked you about creating your own business objects which was this post:

https://forums.jiwa.com.au/viewtopic.php?f=26&t=474&p=1718&hilit=business+objects#p1718

Do you need to do anything different for using these objects in the web api?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Business Objects

Postby SBarnes » Tue Jul 25, 2017 8:43 am

This may have been missed.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Business Objects  Topic is solved

Postby Mike.Sheen » Sat Jul 29, 2017 3:11 pm

SBarnes wrote:Hi Mike

A while ago I asked you about creating your own business objects which was this post:

https://forums.jiwa.com.au/viewtopic.php?f=26&t=474&p=1718&hilit=business+objects#p1718

Do you need to do anything different for using these objects in the web api?


No - the REST API doesn't need anything special for you to interact with our business logic, or any object you create inheriting from our base business logic class.

We did introduce a IJiwaDTOSerialisable interface which expects you to implement the methods DTO_Serialise() and DTO_Deserialise() - but nothing requires you to implement that - you'll see in our REST API plugin the code for GET, POST and PATCH operations on Sales Orders, Inventory and Debtors that we invoke the DTO_Serialise() or DTO_Deserialise() methods, but we did that simply as a convenience to reduce the code in the plugin, and so people wanting to write their own custom routes could just use our DTO_Serialise() or DTO_Deserialise() without having to manually set properties.

For instance, If you use a decompiler to examine our DTO_Deserialise() (in for instance, the inventory business logic), you'll see it's simply parsing the DTO supplied and setting properties of the business logic - a lot of mundane code we didn't see much use being in the plugin, so we opted to put that in the business logic. It's your choice to follow the same pattern or not with your own business logic objects. I would recommend implementing IJiwaDTOSerialisable, though.

We might leverage the IJiwaDTOSerialisable interface in the future - like we did with the IJiwaSerialisable and IJiwaDeserialisable interfaces - to allow the Desktop application UI to have the base form know how to export / import to / from XML automagically without the UI doing or knowing anything special. So you may see soon an Export and Import DTO group appear on the ribbon of forms to allow XML/JSON/CSV import and export functions from the UI - which might be confusing as we'll have two XML imports and exports - legacy XML and the new DTO XML - but we'll work something out to make things clearer.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Business Objects

Postby SBarnes » Sun Jul 30, 2017 12:42 pm

Thanks
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to REST API

Who is online

Users browsing this forum: No registered users and 3 guests