× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



A more readable version + added some parts (webservice, log4rpg).
------------
I wrote on February the mail "a RPG - Software Architecture / Best practices".
Here is a short debriefing about what we did with my team.

When I came in this company, I did a lot of architecture for the Microsoft .Net developers.
With the success of many project using this architecture, i was asked todo the same for the Rpg team.
That was a great challenge.
At that time, I didn't know a thing about the IBM world.
I tried to put some standards between those 2 very different worlds : IBM Rpgle and Microsoft .Net.
I worked a lot on this with my RPG team.

Our goals are :

- Centralize both technical and business logic
- Code readability
- Do less code todo more
- Almost never duplicate code
- Not involved (too much) in a specific technology or library, be free to change when we want without to redesign everything
- Code change history
- .Net et Rpg programmers can understand and help each other.

To do this, we chose to work this way:

- Use long and understandable names
o For source file names (stored in the IFS)
o For functions
§ Too long in fact, we miss the notion of namespacing we can have in c++ or c#.
o For Sql tables, Columns, index, etc.

- More standard SQL
o Every db2 table has now a primary key called "id"
o Relation between tables are made with a foreign key, with referential integrity

- Put code in the IFS
o It allows us to organize code within folders deeper depth we could have in QSYS.

- Code Layering with Service Programs
o Data Layer
§ DB2 Service Program with all data access, exposed throw data provider functions
§ FTP Service Program with all ftp access, exposed throw ftp provider functions (using Scott Klement ftp functions)
§ WebService Service Program with all WS access, exposed throw WS provider functions (using wsdl2rpg from Thomas Raddatz)
o Business Logic Layer
§ Business Service Program
o Presentation Layer
§ Batchs Pgm Programs
§ MVC Programs
o DTO Layer
§ Data Structures which carries all data I need
o Core Layer
§ All technical functions not related to a specific layer

- Framework
o Similar to a project, with all the same layers, contains every functions a project can share with others.
- Source code management - Git => http://git-scm.com<http://git-scm.com/>
o Having a full history of source code change made by everyone
o Know exactly what is the development / release version of the sources
o Each developers has his own version of code source, and his own environment to compile and test his code
- Compilation using Qsh scripts
o Using CL seems not handy in the IFS
o Still not familiar with makefile
- Logs using Log4rpg
- Unit testing using rpgunit => We use the Behavior Driven Development (http://en.wikipedia.org/wiki/Behavior-driven_development)
- We use Free Rpg as much as possible

What we still miss is :

- Technical stuffs
o A lot of things I thought were standards are missing, like :
§ dynamic collection => replaced by ArrayList and Lmap (http://iledocs.sourceforge.net/docs/index.php?action=mainmenu&category=1)
§ Regex (Replace) => Replaced by java (http://stackoverflow.com/questions/18404874/regex-replace-on-ibmi)
§ Streams (http://www.cplusplus.com/reference/istream/iostream/)
§ Generic Types
§ Polymorphism
§ Inheritance (having a datastructure which inherit from another would help a lot)
§ IOC (http://en.wikipedia.org/wiki/Inversion_of_control)
§ RpgLe design patterns models
§ Better IDE, RDi can't handle IFS projects, don't find functions from dependencies (includes)
§ Can't use Git clients on ibm I (http://www.sourcetreeapp.com/, http://windows.github.com/)
§ Serialisation is not as easy as it should be.
. We can serialise Json or Xml using one line of code in .Net. I don't want my programmers spending too much time in this knowing they could do a lot faster.
. Better serialisation would make easier to add WebServices.
§ We couldn't use PASE libraries the way we want. (http://stackoverflow.com/questions/18588243/using-pcre-on-ile)
§ More appenders for log4rpg would be great (mailAppender, SqlAppender, FtpAppender, etc.)
§ We need more time (a lot) to program something in rpgle than in c#, mostly because the tools are not there yet.
§ We would like to code everything in free rpg (avoid F or D specifications)


We are working on that.
Any suggestions would be great.
So far, we have a huge emphasis in our new ways to work on ibm i.
If you have any questions / remarks, I would be glad to hear them.

Best regards,
Charles




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.