Showing posts with label Entity Creator. Show all posts
Showing posts with label Entity Creator. Show all posts

Tuesday, February 28, 2012

The great CA Plex ‘Entity Creator’ – Update 2.0

Things have been a little quite on the ‘Entity Creator’ front for a while, this is mainly due to other projects and priorities, like leaning .NET C# to assist me more when Plex 7.0 comes to GA which is soon, which is great J
I had a few items outstanding from my last update
I have made some progress with these in recent weeks.  Mainly around the entry of non key attributes for the new entity.  This was quite a challenge as I wanted to cater for field replacement overrides, for text and field naming clashes.  I have also managed to improve the workflow, error messaging and validations to ensure the new entity and all its related objects and triples are added correctly.
I am pleased to say that the next part of the puzzle is complete.
Assuming that you have read the previous postings here is a sneak preview with the latest editions to the tool.
So! What’s new on the eye candy and functionality part then Lee?


This is the Entity Attributes entry screen.  You can select a field from a user defined pick list, give it a name (which is validated) and override the field and decimals place lengths as appropriate.
You can also select other entities in the model to create a ‘Refers To’ foreign key relationship.

‘For Text’ if supported if you wish and just like CA Plex itself, if referring to any file more than once then a ‘For Text’ qualifier is required for second and subsequent relationship declarations.

Upon clicking next and assuming you have passed the relevant validations then the following screen shows a summary of the entity to be created and a easy to view tree control.  (In the future I will allow you to expand the ‘Owned By’ or ‘Refers To’ relations and select virtual fields.


That’s about it for now apart from the fact that you can also decide if ‘Sharing’ is used when you confirm the entity creation on the confirmation screen.

Another little note is that internally the system handles replacement field (automatic override) name clashes in a similar way to Plex and 2E by using a surrogate suffix.  As you would expect the tool advises you if this happens.

Hope you like what you have seen.
Thanks for reading.
Lee.

Friday, November 25, 2011

The great CA Plex 'Entity Creator' - Update


What started out as a wee (little) test application for me to learn and understand a bit about DotNet C# and the CA Plex ModelAPI has blown out (my obsession) into a full featured Entity Creation Utility.   I am also fully aware of the differences in terminology and approach between us Plexers and DotNetters which has been really useful for my company as we have a whole host of different development skills and disciplines and I feel like I can cross communicate J

The cool thing is that my employer http://www.sasit.co.nz/ (shameless plug I know) and our clients (current and future) will benefit hugely from this development when they see just how easy it is to enter all the relevant details into a CA Plex application model and generate code for all our target databases.

If I am to be honest there is still quite a lot to finish off like:-

·         Entering Non-Key fields (Next project)
·         Dealing for Foreign Key Relationships/OptionalitySYS and Virtual Fields
·         Advanced validations
·         Error Rollback
·         Schema Import

Not to mention a rethink on the GUI and the application C# architecture now that I have learnt a lot more about this environment.

·         Code layout and structure
·         Object design
·         GUI i.e. A TreeView control or something similar etc

However, for a work in progress (WIP), another one of those TLA’s  I think that it is worthy blogging about and giving some screenshots.  All feedback is useful and appreciated and I believe I have finally fixed the comments section too. J

This all started in a innocent post called RTFM and I will also follow up with some addition posts around the way I went about it and the features of the ModelAPI, along with a few of the traps that I fell into along the way.

The premise of the original exercise was to be able to quickly create a standard CA Plex entity with our default inheritance, Surrogate Key field and some internal naming conventions honoured....  I am now at the stage where the utility handles Surrogate (The DotNetters call this an auto increment key) and/or Natural Keys, File to File key relations, override attributes, labels, narratives and low level field and file/view implementation naming.  A far cry from the original brief and I still have a roadmap as long as my arm.

So take a look below at a few screen prints with some basic commentary of what the utility currently achieves for me and future posts will show you the finished utility (Hopefully).

Overview

A simple model with three entities






























Fig 1. CA Plex Object Browser

These represent a standard Grandparent, Parent, Child hierarchy.  These could have been modelled differently without ‘Owned By’ etc but that modelling approach is debate for another day.  For now the triples that describe this 3 tier relationship have been entered as below.



















Fig 2. The selected entities definition triples.

Taking a closer look at Entity ‘LV3 level 3’ you will see its entity attributes described as











Fig 3. The entity attributes showing no overrides.

i.e. Very simple and no attributes and no renaming of fields etc.

We implemented a policy at our shop of using TLA (Three letter acronyms) to describe of business entities and we like to replace the inherited field names whether they are resolved via a Owned By, Refers to or even as virtual fields.  This is just a ‘in-house’ preference and (we feel) aides with the myriad of people who need to write queries, data warehouse data extraction and other extracts like data downloads and excel spreadsheets.

We also tend to follow through the TLS naming convention for our tables (physical files) and views etc rather than defaulting to the generated names.
















Fig 4. The File and Implementation names for the table and default views.

And I haven’t even covered labels for the fields and entity and field narratives.  As you are all aware this can lead to quite a bit of entry on our part for even a simple entity.

HENCE MY LITTLE UTILITY!!!!!.

I introduce the aptly named ‘Entity Creator’, I wanted to say that with a Boxing Ring influenced Master of Ceremonies voice but realised that wouldn’t translate on a textual blog. 

Entity Creator as described a little above is a wizard that guides the developer through the perilous task of setting up an entity and its fields. (Currently tailored to our environment, but adaptable and extendable enough for others to take a look).

So let’s for demonstrable purposes add an extra level to our setup called ‘LVL Level 4’.
























Fig 5. The first of the Wizard screens.

By not selecting a Surrogate based key we are therefore selecting natural keys and we get an opportunity to enter the ‘Owned By’ and ‘Known By’ relationships.
























Fig 6. Natural keys showing ‘Owned By’ entities for selection.

This shows a selection of ‘Owned By’ and a list of the business entities in the model.  The application stores a list of the business entities so some set up is required for old models but that would be straight forward to complete or I might even just import them sometime in the future.  Roadmap item?

You will see that the keys of the chosen entity are displayed for instant developer feedback.
























Fig 7. Natural keys showing ‘Known By’ field and the options for key selection.

Now let’s enter the ‘Known By’ for this entity.  You will see that a different field set up is presented to the user and you simply enter the field name (The prefix is automatically applied so no need to repeat this).  And the select from a choice of fields (Configuration roadmap item already noted J).

If applicable the character length and decimal places override are available.  If these are left blank the details as depicted on the screen apply through normal inheritance.

Note: As I was new to C# and .NET (DotNet) I decided to hard this to 5 fields.  I don’t regret doing this from a learning perspective but I will refactor the application in the future to perhaps display these in the different way.

Clicking next will take us to the Field Labels and Narrative screen which can be bypassed (if you wish).
























Fig 8. Editing of the labels for a field.

You will see I have indicated the values for the labels and field narrative for the ‘Known By’  The ‘Owned by’ labels and narratives are already present due to the inheritance (assuming you entered them).  In the future this screen will also handle the non key attributes, refers to and virtual fields too.  I’ve just got to get a bit better at Dot Net first.

The final screen is the confirmation screen.

You get to choose what triples/objects are or are not created for your entity and also you can see the statistics i.e. what was created.  ‘Show Summary only’ is the number of objects, triples and narratives and the timings.  ‘Summary and Detail’

Once you have created the entity you should see something like this.
























Fig 9. Options for what we want created and the user feedback.

This is 17 objects, 33 triples and 2 narratives created and entered in 377ms.  Not bad aye!!!
























Fig 10. Some of the new objects, triples and narratives shown in the model.

So I hope you like what you have seen and I thank my company http://www.sasit.co.nz/ with allowing me the time to learn more about these technologies. (Visit our website for ideas on what we can do for your IT business).   I hope that this blog inspires you to look at this technology yourself and I’d be delighted to assist with your projects.

Until next time.


Thanks for reading. 
Lee.

Monday, October 3, 2011

RTFM

“RTFM!” (Read the effing manual) - that was the polite version.

That’s what I was told when I first started programming.  Not every time (obviously), but on that odd occasion where the question was a repeatedly asked one (by me) or that time the more senior programmer didn't eat his oats in the morning.

To this day I still hear this from the more seasoned developers around me.  But I must say that this phrase (I believe) is in steep decline.  Could it be said that my generation of developers may be the last to utter this immortal programming phrase.  You see (or should I say hear) more and more “RTFM” is being replaced by “Just Google it.”

Today I was working with CA Plex 6.1’s Model API.  I was trying to automate a common task that I perform in my model and ultimately cut down on some keystrokes, mistakes and most importantly, ensure ‘THAT I’ conform to the standards ‘THAT I’ have decided and (hopefully) along the way help the other developers in the team J.

I was working from some excellent examples from CA regarding the Model API and thought I’d try a small example using C# WinForms and Visual Studio 2008.  All I wanted to do was create a new entity with appropriate naming standards, fields and keys all with correct inheritance from our patterns etc.  So breaking the problem domain down into small manageable chunks (isn’t that now known as an agile sprint), I decided to get the Entity Prefix (I like these), Entity Name and Entity Inheritance easily created.  The rest will come as the AddIn matures and I implement all the ideas and wizardry in the roadmap. 

As I have said I am creating this pioneering utility using the Model API (Version 3.0) in Plex 6.1 and I will deploy the final program as an AddIn. I have also used this as an excuse to brush up a little on Visual Studio and C# as we are going to be heavily reliant on this IDE once Plex 7.0 comes out and we are all doing DotNet stuff galore. 

I will blog a little more in the future about how I did this (It is only basic and I am still learning) but I have to say that the Model API 3.0 is quite powerful, just ask George Jeffcock about his Stella Tools. 

Here is a sneak peek at the current screen. 



As you can see it is about as simple as one can get, but, without much knowledge of C# I quickly became stuck, stranded, frustrated, challenged and peeeeeeed off.    Anyhow, forget asking Jeeves or posting on some technical forum.  For older scholars picking up the manual or downloading that e-book PDF you had been considering is also a waste of time and effort. 

If you want to code nowadays, it appears you just “Google it”. 

I am not sure whether this is like
1.       4GL of C# coding
2.       Cheat sheet
3.       Or simply just good common sense to utilise a million experts rather than one book

.......BUT.......

I got the answers I needed pretty quickly and was able to continue with pilot project in earnest.

I have a great mental roadmap for the utility and only time will tell how it matures.  But for all us elder statesman of the Plex community, I'll borrow terminology from one of Ramon Chen’s key marketing phrases from the early days of Obsydian.

“Stop coding, start Googling.”

Thanks for reading. 
Lee.