3

Rapid Enterprise Architecture Delivery | Xamarin Developer Summit


>>Let’s get everybody settled in and go ahead and get this kicked off. We definitely have a lot
of material to cover. So I’m going to go ahead
and start a timer, so I don’t run over. Shout out to our sponsors, of course. Without them, this
wouldn’t be possible, and if you are not aware, we have a conference
app and mobile app for you to download that has all
the sessions and everything. If you have already
downloaded this app, then you are fully qualified
to be at this talk because we built another one
different but just like it. The one that we built
is actually inspired by the 2016 Xamarin Evolve app that James Matzo Magno
had put together. So we sort of refresh that and
gave it some new features like the Xamarin Forms Shell and a lot that we’re going
to cover in just a moment. A little bit about myself. I am Paul Schroeder. I would love it if I got some
follows on Twitter, @PaulBSchroeder. I run a small consulting shop in Chicago land,
MSC Technology Consulting. We do specialize in Xamarin. Can anyone tell me, this is kind of
an interesting things. Can anyone tell me what this is, down here, what
this screenshot is from?>>The Atari game [inaudible].>>Yes, exactly. It’s the 1979 Atari game, and what this represents is
William Robinett worked in an era when they didn’t allow developers to put their name in the credits
or anything like that. So what he did is, he made one of the first probably the
first Easter egg in a game, that was popularized here in
this movie Ready Player One, Steven Spielberg’s
adaptation of the book. The reason this kind of ties
into the talk is because, just like when William
Robinett was working, the work was treated like
factory output basically. Developers weren’t treated as
artistic or creative and whatnot. What we’re going to try to do in this talk besides provide
you a full, like, enterprise app as an example is to get the idea that if we
code-generate a lot of the material, that we allow our developers to
focus less on the infrastructure, less on the boring, tedious, repetitive code and more on the
things where they can add value. We’re talking about
the user interface. We’re talking about business rules. Were talking about integrating
with other systems. This is usually where I’m
at about 2:00 pm right now is feeling little sleepy
like this guy with me. Like I said, we’ve got tons to cover, so there’s not going to be any
sleeping in this presentation. Here’s what we’re going
to look at in a moment. I’m going to play a video for you, but it’s going to
remove really quick. I will demo a little bit, but because of the time constraints, I’m trying to rely on videos to keep it quick and the context switching. So this app implements
the Xamarin Forms Shell, Azure Blob Storage,
JWT Security, SQLite. This is all out on GitHub. It’s in the repo for
Xamarin Dev Summit. You’re all welcome to check it out. The video is going to
show us logging in. That’s where the JWT tokens come in. A really cool feature is
the use of sample data, or swapping that out
with live API data. Again, this is a conference
app with user profiles, so there’s the ability to swap out
pictures for those. All right? You can either take a picture with the camera or choose one
from your local storage. In the end, there’s code in there to put it up in Azure Blob Storage, and we’ll walk through a lot of this. You can also like sessions. All right. With that said, let’s go ahead and play a video now, that you kind of get a primer
for what you’re about to see. So here, we’re taking
a look at the speakers. Once we’ve done that,
we’re going to take a look at some sessions by time. We’re going to scroll
down, and we’re going to like one of these sessions. Once we’d like it, will move to a different view which
is our “Favorites” view. Once we move into the Favorite view, we’ll see that one actually shows up, and we’ll go back out and
take a look at the profile, and then we’ll click the little
“Edit” button to edit the profile, and that’s me a couple hours
ago changing the picture. This is a very dynamic, very current material
here. A good one. So what are we doing here
now, we’re switching it back. So now we’re showing,
choosing a picture from the local file
storage basically. This is the database
schema. It’s modest. Up here, we’ve got some
ASP.NET identity tables, Blob files that we’re using to store information about what
we’re putting up in Azure, and you can read some
of the rest of these. It’s just basic information to
track conference-related data. Normally, this session
would take more, like, two hours to explain
Enterprise Architecture. Why we do all this stuff. In the end, let’s just keep
in mind that people are always asking us developers
to do have a lot of scope. A lot of features, very little cost and very little time
right in the end, if we compress that too
much quality suffers. The idea is that by
using co-generation, we’re trying to actually achieve this where we’re
trying to break out of that project triangle or that iron triangle where we can
do things super quick. There would normally be
a lot more information about what the problems are
that we’re going to face. A couple I’ll touch on here is
this idea of demo where I’ve been on projects where
it’s constant like we need to demo these features next month, these features in three weeks
and we’re not getting time to go back and build
the infrastructure. Software requirements. We’re always going to have
changes to software requirements, Agile supposed to welcome it. We’re always going to have
messes.. We’re always going to have things that we
didn’t think about. Ambiguity. When ambiguity happens, developers are faced with
a couple of choices. They can either make
an assumption and move on which generally can work turned out to be rework right if they make
the wrong assumption, or they have to go seek clarification and when they do go seek
that clarification, sometimes it’s not always timely. The responses that get back. So the idea is this is kind of
demoware right and so the point of this talk is we can generate a lot of this stuff that’s
boilerplate that’s repetitive, we have more time to
spend building out, a lot of this has already built
out for us but then we have more time to focus on like
I said the business rule. This quote here just seems
to come up every now and then for me where we’re always pressure there’s
not time to do it right, but you then you end up doing
the whole thing over again. I do want to mention that when
I’m talking about demoware, I’m not talking about
the feedback loop. The feedback loops important. What I’m talking about is
that when they are constantly pressured to do demos and you don’t get time to build
out the features. We do need a feedback loop which every few weeks you’re
demonstrating it to stakeholders, getting that feedback, making sure you’re not getting too
far off the rails. This slide kind of in a nutshell
summarizes this talk. The idea is that we’re going
to use proven patterns. Things that follow
these solid principles. Once we have those patterns in place, we’re going to use those to
craft a reusable architecture. One that sort of generic. We’re talking about enterprise, Line-of-business
applications, big databases, things where you’ve got
a synchronized data from the server to your client app and we’ll show a little bit
of that in just a bit. The next step is componentize, and we’ll talk about that later. It essentially means making
some NuGet packages out of your common foundational
features and functions. Once we have all of that in
place, those first three steps, the next level of
hierarchy is to code generate things that then
work with our NuGet packages. The idea is that we’re reducing
the time it takes which allows us to address other technology risks we might have earlier in the project, gets something out faster which allows us to adapt to market needs. This idea of turnover
if you’ve ever been on a long project that
runs for a long time, you know that what
ends up happening is you’ll start to lose
a team member too. Some key players over time. So if it goes six months or a year, sometimes you go only staying
accompanies a year or two these days and so by getting
something out there faster, you are reducing the impact that
has on your project quality. Sometimes, I don’t like
to think about this, but I do think about it in that, when your code generating it, there’s no flaws in
the code. There’s no errors. If there is an error, you’ll
fix it in your template, you regenerate and now it’s gone in your code base and then the next project will certainly
not have that same bug. This slide is also very important. So we’re going to spend
a moment talking about this. When we’re talking about
Enterprise Architecture and we’re talking about all
these layers and we’re following solid principles etc. By the way, if you
like taking pictures, and that’s totally cool. Go for it. But all these slides are
available in the repo as well. We’re starting with
the SQL Server database. Entity Framework pulling things out. We map that into what are
called data transfer objects. This is on the server side. The colors aren’t super easy to see, but this is representing
server-side stuff, and then there’s kind of light blue is client-side stuff,
our Xamarin apps. So we take our data transfer objects. We’re sending him
from a Web API, wow, into the client data
loader service, and from there, we’re converting our data transfer objects again through mappers into model data and storing it in a SQLite database
that’s on the client. Doesn’t have to be SQLite, it could be like Couchbase,
whatever you want to use. But the point is, it’s
persisted on the client app. Now, a user’s going to
start using that app. So once they start using the app, now those model data that come out of the SQLite database
are getting mapped into something called model objects. Those model objects are
perhaps implementing your INotifyPropertyChanged,
your observable objects. There’s different concerns
there, right? So that’s why we have
all these classes, which is a lot of code to write. Then we’re going to use
those in our view models, and obviously the views going to be using those observable objects. So I’m going to click
the button in a moment, and what’s going to drop out is
the part of this architecture, is the part of these layers
that we code-generate, or that can be code-generated. After we code generate, this is what’s left for
the developer to focus on. Again, something I should
qualify that with. Code generation is
not a silver bullet, it will get you your crud operations, it will get you your bootstrapping, and it will get you up
and running quickly. You’re always going to have
to write some custom code. The idea is that if you
architect it right, you follow that O and
the solid principles for open for extensibility and then you can write that custom code that you need. So we’re left with
that data loads service, that’s a pretty easy one to write. So we just haven’t done much
with the code generation there. Your view models, in your views
technically you could generate basic views and
view models, but we don’t. You’re focusing on your business
logic and overtime moving more stuff into domain classes
that you’re handcrafting, if you want to follow more
of a domain-driven design. Why do we do all that? There’s a reason why we do all these layers and
all this extra code. Obviously, we’ve invested
some time that it’s easier to do it and generate
it so that overhead, that you’d normally have of writing all these classes, isn’t there. But if you noticed, even with
our current app which is perfectly fine for a couple
of days summit, works well. But it doesn’t function offline. When you’re installing it in the SQLite database and
pulling it out client-side, it’s just doing a check. You’ll see checks in
the sample code that says, “Do I have a network connection?” If I do, I might go and
refresh my data but otherwise, the whole thing’s working
off of the local data store. So I don’t need
that network connection. So the idea is that
the offline capability is baked in. Oh, what did I just do? Here we go. Single Responsibility Principle, let’s not spend
too much time on this. But the idea is that these classes
have different functions. One is being used to
store data in SQLite, one is being used for MVVMLight. In this case, we’ve got to
define what our tables are, and in this case we are doing some InotifyPropertyChanged
stuff. Let’s take a look. Let’s dive into a little bit of code and see what some of these look like. Xamarin, here’s some mapper code. So this would be examples down
here of the MVVMLight classes. I hope that’s big enough
that everyone can see it. There’s nothing crazy in
this class, it’s pretty standard. Again, that boilerplate code that’s following a very predictable pattern
for each property. We can hand-write these. That’s only for this less
than 200 lines of code. But for every table in our database now and then we have the model
data classes that are for SQLite. If we look at, what do we, Unsession, let’s look at session over there. It’s the same thing, even a
smaller file but now we’re looking at attributes that tells SQLite
what to do with this class. Then we have our mapper code, and our mapper code
is converting things. We’re converting things between the model object and
the data transfer objects. We’re converting things between the SQLite classes and
data transfer objects. We’re converting things
between data transfer objects and the model objects
and that code again, is very clear, very boilerplate. I will say on the server side, what we do is we use auto mappers
so there’s not so many lines. On the client side, we’re
just doing this by hand. When I say by hand,
it’s auto-generated, all these classes and
you’ll see that any class that has this at the top,
we didn’t write by hand. That’s why we can end
up doing it this way, like 1700 lines of code that we
didn’t actually have to write. It generated in seconds. Let’s keep going here. So the idea that I’ve
already touched on is only 22 classes for
this very modest database, but we’ve had clients
with 140 tables per database and they want to do
three different databases and one app sort of thing. So that times four, plus all the mapping code, every time about 88 classes
I didn’t have to write, 90 if you count these and
all that lines of code. Everybody with me still? Cool.
Basics of code generation. If you haven’t had much, you’d probably have touched
it even if you’re not even sure what it is,
in one way or another. But the idea is that you create some templates that have expected
or known input parameters. Then you’re getting some metadata from a source and your sources
could be a database, DB Schema or it could be like an API specification
and you’re pulling that out and you’re going to run your
templates against that metadata. Excuse me, which generally generates an output classes that you’ll
incorporate in your solution. If you ever used, back in MVC time, you’d have a model and it say
generate the views of this model, that’s code generation
that’s using T4 templates. There’s definitely more
ways than one to skin a cat or for those of you
that don’t know like that. There’s several ways to do something. I don’t know why they
come with this more ways than one to skin a cat. In our case, overtime, we just rolled our own. Sample Data, Data Loader. This is a cool feature
of the application. We talked about the idea
that we can swap out our sample data here using
this IDataLoader interface. So in this case, we’ve auto-generated
just some sample data. Once it’s generated,
you can go in and change titles and stuff
if you wanted to, but all the stuffs already built out. Then in this case, it’s really just whether I want to use sample
data or use live data. Switch in the app and then it
starts loading it from our Web API. By the way, if you want to know
more about that, Robin Schroeder, who had a huge hand in writing
the Xamarin portion of the app here is speaking
tomorrow at 3:00 o’clock, a bunch of tips on delivering things quickly and on time and on budget. Client code to access the Web API. The idea is we’ve
generated the web APIs, so we know what that looks like. That means we can also
generate the client-side code to access that Web API
and it’s abstracting away the complexity from
our Xamarin developer of the intricacies of
calling that Web API. They could still get down to
the bare bones and do it. But what we’ve done
over here is provide simple methods for them
to call and pass in something like
a minimum modified date or whether they want deleted records
or not or how they want the data sorted to come back and this is responsible for
then calling the Web API. We’ll see some examples of that. The idea is that out of
the box you’re generating, getting all the data, getting just a page of the data. Getting something like
one individual object by primary key, “Create”,
“Update”, “Delete”. So can anyone tell me why
we might pass something like the minimum modified date
to the Web API? If we’re calling from
a client-side application into the server side and where
we’re trying to get that data and load it to the client?>>[inaudible]>>Yes.>>[inaudible]>>Minimize the amount of data
and you’re getting the changes. So maybe the first
time the app loads, you’re getting whatever data
is relevant for that user. Now, tomorrow when the user
fires up that app, I don’t need to load
all of those records. I just need to know what changed. So that’s where these things like the minimum modified date
and this deleted comes in. So that’s useful for
data synchronization. The number of child levels, that comes into play where
like some getting one entity and maybe I’m getting
information about a session. Well, I might want
to pull the speaker information at the same time, instead of making
two calls from a Web API. So this parameter tells
the API how many levels I want basically and then there’s
ways technically to customize exactly what comes
back based upon that value. We’re going to dig into this
FilterCriterion first. You know what? There is one thing that I didn’t do and that was we’re going to take
a chance on a live demo here. We’ll see how quickly we can do this. I’m going to log in to the app. Looks like we’re good there, and I’m going to go into “My Profile” and David [inaudible]
does not look like that. So we’re going to take a new picture, if you could indulge me for a second. I don’t know how well
this will turn out. I got to switch this over. There we go, smile. Okay, good enough. Let’s mark that as good, it changes out in a watch. It’s going to change
in just a moment. See how I got wonky there? There’s also some resizing code
built in to the back-end web API. So when it uploaded it to Azure, it also ran some resizing code
which does not have a very good aspect ratio
maintenance algorithm in it but it proves the point. So now if we go over to our Azure Storage Explorer just to show you that
this actually worked, I apologize I’m bouncing
back a little bit here. We’re going into our images. I’m going to sort by “Last modified”. You see 223, let’s see
if we can download that. You’ll see we’ve got
this thumbnails folder. Let me sort by “Last modified” again, 223 just after it. Save those to my downloads. Did I get the right thumbnails?>>[inaudible].>>No, I hear what you’re saying. I’m wondering, I don’t think
that should have happened. That’s okay, that’s live demos. Let’s see what these actually are. Let’s go to the downloads. The strike came out as a JPEG
which is actually contained in the blob file table, there’s information about
what the media type of these are, content types. That’s probably a PNG. So now we see there’s this one, then we see there’s
this one that came. Again the aspect ratio
not maintained. We take a look at their file sizes. You see one say 316K and 165K. But again, so let’s just
demonstrating that we actually uploaded things into
Azure live from our demo. Moving back over here, the client web API code we can
take a look at some of that. Even though we’ve got some extracts let’s maybe see what we’ve got there. So we are looking at
IWeb API data service. So here we talked about
the idea of getting all pages, getting page data, getting by primary key, creating,
updating, deleting. This is an interface and
even with an interface, it’s 350 lines of code that
I didn’t have to write. If we take a look at
the implementation of that, how does all these things work? That’s some custom methods.
Let’s see here. So get by primary key, there you go, getUserProfileAsync. We will look at what
this filter criteria is. All we’re doing when we’re
calling the web API from Xamarin side is creating this thing that’s called
filter criteria and passing, these are all auto-generated. Technically, they should be
more like an enumeration. But since it’s generated,
it hasn’t really matter. We’re saying we want
the modified date with a date that’s a date-time and we want it to be greater than whatever date we passed
into the parameter. Remember, we’re passing that in. The idea is that this follows
a very concise pattern, it’s very easy to
read for a developer. So imagine they can just
copy one of these methods, paste it into custom area here and reuse it and they can take another field on the table
that they want to filter on. Whether it’s a speaker’s name
or I don’t know, what else? A room name or something like
that for search criteria. The API is very flexible in that way. I don’t know if we’ll have
time to demonstrate it but the idea is that when
you’re calling the Web API, you’re passing these criteria, it’s dynamically interpreting them. Not only that but you can pass
a field’s parameter and it will just data shape the object
that’s coming back. Say you’re populating
a drop-down list from a table, you don’t need every record in every column in that table.
You don’t need every column. You need the name, maybe the ID. So that’s what it’ll do. It’ll just data shape that and
only return what you need. Those super cool
concept when we built a couple of years ago and we
have been using it since then. Just for your information
if that idea interests you, [inaudible] doing
a demonstration of open GraphQL tomorrow at about 02:00 PM
and he’s going to demonstrate Microsoft’s way that they’re
going to be doing this. Let’s see here. We’ve
talked about this. The idea that we didn’t have
to write all this code. Moving on, it’s OData-ish.
This is an OData. It’s OData-ish because you get to craft the queries you
want on the client side, send them up to the web API, the Web API interprets it, sends down just what you asked for. Am I moving too quick? Is everybody still
with me? Okay, cool. We talked about this being
the O in the open where we’re uploading images to the server. We’re downloading
images from the server. Thank you. These are using the same interface
that was code generated. So in other words, we’re extending
that interface and we’re doing that through partial
classes. All right. So if you can make
some partial classes, now if I change something in
the database, I update my schema, I regenerate, I’m not overwriting that custom code that I wrote
to upload and download images. We are here. This is where we’re at in a talk. We’ve gone over some
of these old patterns, we’ve shown that we have
a reusable architecture, the basis for a generic-ish
architecture and next, we’re going to talk about
componentizing the architecture. We’ve shown how we code generate
some of these sections. Up next, we’ll have the NuGet
components that we’re talking about. We’ve already seen a lot about Azure Blob storage so I
won’t spend a lot of time. The code is in the repository. Dependency injection, what
that allows us to do, and then we’re going to talk about how we keep
credentials private, that’s an important
aspect, JWT Web API. We’re not going to do anything
with CodeGenHero today. Maybe we’ll show a demo
during the Q&A session. Open source components, what am
I talking about when I’m talking about componentizing
the architecture? Basically taking out
those fundamental pieces, those foundational pieces
that apply to each solution, wrapping them up in
their own libraries, making NuGet packages out of them. Surprisingly easy to do, some teams that we’ve worked with
have their own NuGet servers in their corporate
environments and they make their own libraries and they
reference them in multiple solutions. That’s all we’ve done with this code
which is out here on GitHub, MIT License and then that’s
just been packaged in the NuGet which you’ll notice
in the sample codebase, it just references
the NuGet packages in the solution. That’s where they’re coming from. Azure BLOB storage. Let’s take a look at how we configure uploading and downloading
images to Azure BLOB storage. That would be on the server side where we’re going to
put this information. So if we have two solutions open, two Visual Studio’s open, one is the server side API and
one is the Xamarin client. So web API config, we’re using dry IOC
as a container for our version and
control and here we’re calling registered or dependencies. This would be a service for us. So now we see which
configuring this thing called an interface
for Azure storage, and we’re just doing this out
of our configuration file. So now we have this account key. This is sensitive information. We really shouldn’t be storing
that in our config files. We shouldn’t be checking
that in source control. Same with our connection strings. If we actually take a look
at the web config for this, I’m jumping a little bit ahead
but it’ll save us time later. We’ll see that we have something
called a configuration builder. This configuration builder section has an item in it called simple JSON. I’m referencing that simple
JSON in my connection strings. I’m referencing that simple
JSON in my app settings. If you’ll notice when
I can figure it, I’m referencing a
JSON file over here. This developer config JSON. Surprise it’s JSON and
it looks like this. You know what? It’s actually in
a later slide. Looks like this. Not too hard. Here’s
my app settings section. Here’s that account key and it’s truncated there and here’s my audience secret
and here’s my connection string. I’m not checking this file
into source control. Yes, sir.>>[inaudible].>>.NET Core has its own thing. Yes.>>[inaudible].>>Same functionality. This is more for like
the full framework implementation, do the exact same thing.
That’s a good point. Another thing that you can do besides this is when you go to
deploy your information, five years ago you’re always doing these config transforms and you’re having a production
file and you’re putting your connection strings
in the [inaudible]. When you deploy it works very nicely. But that also required you to put your connection string
in source control where other developers who maybe
you don’t want to have access to production get added. So what you can do is when you
deploy say using an App Service, you’ve got these
settings configuration and that’s where I’m
configuring things like the account key and there’s another section for
your connection strings. So just know that that’s available. We are getting close to the end. How are we doing on time here? Let me double check. We are doing really
well on time I think. About 14 minutes left. Okay. JWT security. I’m not going be able
to dive deep into this. We simply don’t have enough time but I will give you a reference to a blog post where a lot
of the code that you see in the sample
solution is based on. These are the three files in particular that you’d
want to look at. We already mentioned we’re using
these identity-based tables, simple to follow and use. We can take a look at “Authorize attribute” in the code
and we can look at some custom code that is
written to authenticate a user. Let’s just look at that code and then we’ll get into
Postman and there’ll be a little more coherent. All right. So on the server side we
want to do authorize stuff. So we have all these web controllers, we talked about we
generate all this code. What does that code look like? Here’s sessions, we’ve looked
at the sessions before. What we’ll notice is
there’s a base class with an authorized name at the end of it. Here’s our RoutePrefix and then you’ll see
this authorize attribute, and the way we’ve
configured it that’s what’s inspecting that JWT that’s coming in. That’s what’s telling it
whether it’s authorized or not. Well, it’s tell you obviously
you want to put your custom, your logic that applies across
several controllers in here. Let’s see if we’ve got, this is sessions controller. Let’s look at our custom controller here from a security standpoint, you see this ISession object
that we’re injecting here. This one’s cool. If you look at the configuration
the way it’s set up when we register
those dependencies, every time we get
an HTTP response message, we’re creating
this thing ISession when the controller asks for
it and passing it in. What is in this thing? This thing basically is
just some convenience methods you can put whatever
you want in here. But in this case, I’ve put
a couple of convenience methods to say is the current user
a conference organizer? Because we’re going to
have a business rule that says, the current user, if their user profile ID matches the user profile ID or the image
that you’re trying to change. That’s the same user then I’m trying to change my own profile
photo, that’s allowed. If I’m trying to change
someone else’s profile photo I need to be a conference organizer. So let’s take a look at maybe
where this code is being used. So we see here, very easily, I just injected this session thing, I didn’t have to write anything
it’s just available for me to use. So we’re checking is
it the current user or is it a conference organizer. I’ll show you in just
a moment when we jump over to Postman the JWT, the JSON web token
what that looks like. I’m trying to think, so anything
else I need to talk about here. The controllers implements
something called HATEOAS, and it basically talks about like
when you’re getting data back, what is the link to the page
of data in front of you? What is the link to
the page to behind you? How many records are in this result? How many are their total? What page are you on stuff
like that. All baked-in. Okay. Postman Tests. This is kind of a cool thing. Quick show of hands, do people use
Postman, you guys testing API. Okay. Well, I might be telling you something you already know that,
I will just run through it. I didn’t always know until probably couple of years
ago that you could do this. But so I’m running my API and the idea is that I have tests
behind each one of these. So I always put in a status check. In our Xamarin apps, we’ll build in a heartbeat check too. So not only in my online
but it’s the API available. So I could do a heartbeat
before I go synchronizing data. The heartbeat is not
meant to be authorized, anybody can check the heartbeat. Then here what we’re showing, I should pause here. Good. We got an access token back, and then what I’m showing in here
is what the tests are doing. In this case, for this particular
function of getting a token, I’m just expecting the length
to be greater than zero. I’m also storing things
in global variables. I’m using those global variables
in other places, in other items, you can see that I’ve got
things to get a refresh token, things to set the profile image; to get all the user, to get
a current user, get all a feedback. If you haven’t used Postman Tests
like this before, definitely check it out. There’s a folder in the repo that has the Postman Tests and
the environment variables, all you have to do is
import it into Postman. Let’s take a look at
the second one here. So not only can I run
these one at a time which I will show you now. See here. So I can check the status
and it comes back just fine, and we see we’ve got this
token and I can send it again and the data
changes a little bit. But what we’re interested
in here is this idea that I sent in some information. Let’s see if we got that. I sent in this username
and this password, and I’m getting back information that corresponds that user because it
was a successful authentication. Something else we could show is
that if we actually changed the token here let’s see
here, authorization. So right now I’ve got this
token that I’m passing. Remember, I set this
as a global variable. So let me take that out. Just pass something random, and I get back
a authorization denied. I’m going to put that
variable back in, and now it’s happy to give me
the data that I asked for.>>[inaudible].>>A 503 it should have been a 40, let me check. Authorization denied, it
is a 401 unauthorized.>>[inaudible]>>Not this.>>Not this.>>Can you type CCC.>>Oh when I typed CCC, okay let’s try that. Is that
what you’re talking about?>>Yeah.>>401.>>That side [inaudible].>>Oh this side.>>[inaudible].>>Oh that’s okay. If we have
flaws we want to fix them, right? Want to find them and fix them. Okay, last cool thing. Let’s do Collection Runner. If you know a lot about Postman, you probably know about
the Collection Runner but I just love this aspect. If you’ve done unit tests
before is very similar to unit test except
this time we’re hitting our API with all these tests at once. So you deploy your stuff, once you’ve deployed it,
is it actually working? So what I like to do is I’ll
create some data and then I record the identities
of that data that I’ve created and I go
back and clean it up. That really quickly, you know, we just run 26 tests and we can
see things are pretty good. Let’s see here. Thank you very much. So
this is the portion, we’ve got six minutes left where we’ll open it
up for Q&A obviously, we’ve got some stickers
available on the back. This wasn’t really a demo
about CodeGenHero, but if you’re interested
in it and you want to personal demo just grab Robin or I, and we’ll be happy to do that. With that, I’d like to clearly, if you’d like what you saw follow me, if you really like
what you saw and you want us to help you with some work. Obviously, we’re consulting company contact us, we’d be happy to help. Let me just end as we do our question and answer.
I’ll just play a video. This one’s pretty dated. But this is a Bingo Buzz
application that we wrote, and that was the rules to it. We’re going to open it up.
Here’s the table schemas that we’re extracting
the metadata from. Here’s how we can figure things. It’s a Visual Studio extension. It looks quite a bit different now, and it generates
all those class files. We’re saying basically
I want the output of this template to go to this project and I want you
to put it in this folder. It doesn’t just
automatically replace it. There’s ways that you review it, you can merge it, you can update it. It takes a couple of minutes
and once you’ve changed your database and
everything just works. Anymore questions before we close up?>>Your demo that demo we
saw, CodeGenHero [inaudible]?>>Yes, our CodeGenHero does is output code you could
have written by hand. It just that I don’t like to write thousands and
thousands of lines of code, my value as a more well
pretty senior member at this point is not in writing
all of that, repetitive stuff. I’m going to make copy paste error. So I’m going to get bored. I’m going to still have to
build a client for my time. So instead, what we do is
we’ll do this and then we’re delivering the project much
earlier than we otherwise would. For specific applications, have you’re building like
a small Xamarin app, you’ve got a few tables or
it’s very graphics-intensive. It’s not all about synchronizing data from the server to the client. This isn’t the right solution.
This isn’t what you need. But if you have big databases,
you have a lot of data, you don’t want to write
all those web API methods, you don’t want to write all those
mappers and everything else. Then this is what you start with. Very quickly, we’ve been able
to put out like proof of concepts and very, very rapidly. We’ve been able to
take people that we’re converting who say like
Java or something, and they want to do.NET now. Well, here’s an architecture
for you. How about it? We just generate it. Then they start seeing the patterns and
they can learn from that.>>So this is licensed.>>We really have any license
it to our clients. To be honest. We’ve thought
about productizing of it. But we’re kind of
a small company and I think you can understand it’s
sort of daunting depth to support, something that’s out
in the wild like that. It would be cool to find a partner
or something that was more in the product space that could help us get to that next level with it. Because I think it has a lot of potential to add a lot of
value for the community. The idea is it’s all template-based,
and it’s not the only one. There’s other tools out there like Codesmith has a tool and there’s other people where you
make templates and the templates run against
the metadata etc.>>[inaudible]>>Yes, what she’s
saying is all the code that it relies upon his opensource. Just the tool itself
is not. Anybody else? Well, I hope that you guys had some interesting thoughts
because of this. I hope that you get to use
some of the sample code, some pieces of it whether
it’s the authorization of the blobs or even this shell stuff, the data loading which
comes baked into the shell now with swapping out
sample data or not. This is showing merging
different files. It’s not just going to overwrite
it for you. Thank you very much. If you have any questions feel free. I’m still here while
I’m breaking down, if anybody wants to ask
anything one-on-one let me now.

Norman Bunn

3 Comments

  1. Thanks, Just in time. I was looking for an application like the one you have built

  2. Love the concept. Looking for more info on CodeGenHero which seems to be the star of the show.

Leave a Reply

Your email address will not be published. Required fields are marked *