Case Study: Creating Microsoft C# Class Libraries to Power a Collaborative Consumption Solution for the Hood

ourfuture In many high density urban cities with a sizable African-American population, collaborative consumption solutions can produce dramatic and instant economic empowerment with little upfront cost through the generation of economic activity from existing untapped resources. In this article, we are going to provide brothas and sistas with a case study on developing a Product Service System solution using Microsoft C# that will create a technology solution allowing brothas and sistas in the hood rent items in a peer-to-peer fashion with a middle broker platform in the middle facilitating the service. What Is Collaborative Consumption? hbr_example source: HBR.org Collaborative consumption was described very well by Rachel Botsman and Roo Rogers in the Harvard Business Review article ”Beyond Zipcar: Collaborative Consumption” where a person is given temporary ownership of an item for utilization where the item is owned by another person or entity underutilizing the item. In plain language you are renting a product/service owned by another person who is not using it or underutilizing the product/service. You see the several types of collaborative consumption paths where you have a Product Service System of renting a product in a peer-to-peer fashion, distribution systems of moving products from one area to another area like shipping containers and collaborative lifestyles such as group dating or lunch catering. While many think of the sharing economy as getting rid of the middle man and broker structure, I disagree with direct peer-to-peer because robbers, stalkers and scammers on Craigslist is all the reason I need to give why direct peer-to-peer is not a good idea – it is your classic Prisoner's dilemma theory. Instead of direct peer-to-peer, there should be a platform or exchange business model like a Zipcar or AirBnB or Ubër in place to help facilitate the collaborative consumption model and these services usually offer a web service to the consumer who is renting and the provider who has ownership of the item or service. However, companies like AirBnB and Ubër have little governance over the peer-to-peer transaction as you seen incidents in the news where people rented an AirBnB home for filming homemade p0rn or hosting a “lifestyle” party. So a true collaborative consumption model should have a middle broker service as well as governance over the product/service to set rules of engagement in a shared economic solution and ensure fair trade between the two peers. How the Hood Going to Love Product Service System machinerental The biggest benefit of the collaborative consumption Product Service System model is how economic activity will instantly spur and generate a revenue source within a black community, especially in a high density area. For example, someone in the hood who used to be a DJ can rent out their old 12-inch records to another DJ for a set this weekend. A textile screen printer in the hood may allow a new upstart kid to rent their machine for two hours on Saturdays to print some t-shirts to hustle on the streets. A Mon-Fri contractor with tools can rent the tools out to someone working on a weekend project to build a senior walking park in the hood. An older couple with unused formal living/dining furniture with the plastic covering still on it can rent that furniture out to a young hood couple moving out on their own for the first time. If you want to think of an easier term for the Product Service System model, the best way to describe is a “reverse pawn” where in a pawn shop model, you are given a loan for your product and have to pay that loan back with interest with the product being a collateral interest. With the “reverse pawn” you are renting out the item and generating income as a result. In both scenarios, you gave up ownership of the item for money but the “reverse pawn” has several benefits and the biggest is the emotional benefit of seeing the items you own generate revenue versus worrying about not paying the pawn shop back on time and losing your item. Also, your product can generate more revenue than the actual value of the product itself in some cases. So instead of being a predatory lending model for the hood like the pawn shop model or payday loan, the Product Service System model is a revenue generation model for the hood using what brothas and sistas already own and not utilizing. Yes, we talked about all of this before on Dream and Hustle while Black Enterprise magazine write jokes for articles and want you to pay them money for that garbage Black Enterprise put out there for black folks to read. A good point in the last article comment section, someone named Dre brought up is how you deal with deadbeats? I think there is a solution to that – the actual Product Service System provide insurance binders like the car rental companies sell to end users to replace the item at cost for a fee and hold the renter accountable through their own home/renter insurance. So as soon as someone does a Product Service System launch in the hood, someone at a membership only Laundromat can search their mobile tablet for concrete finishing tools to rent over the weekend to lay down a sidewalk in the back yard while looking at the micro-mall cube shop display and you already see the economic opportunity Dream and Hustle already created in the hood by showing cats how to create technology solutions and now let’s get started on this collaborative consumption model using C# to get started. Bonus: There is an IRS section on renting personal items and tax deductions such as cost of maintaining/repairing the item for rent and depreciation that can offset your income tax revenue. Please check out http://www.irs.gov/taxtopics/tc414.html and consult a tax expert on possible benefits of renting out personal items. Researching Existing Patterns and Practices researchmybrotha African-Americans must learn to look globally for patterns and practices we can apply to the hood as solutions and tweak these solutions to work for us. If you really think about the peer-to-peer renting model, it is no different than any existing rental model except the owner of the item is a person just like the person doing the rental. So from now on, let’s get some definitions going. The person renting the item/service is the renter and the person that own the item/service is the owner. So in a database design, a person can be both a renter and an owner of an item. That means a person table and a renter table and an owner table with a person_id foreign key, like I taught yall in the last case study right? And I’m tired of typing out Product Service System and going to just call it PSS because if I cannot call it that, then yall going to PSS me off and none of yall really want that. Go ahead and search for “rental C#” on the search engines and you will see a lot of code examples and even videos of people coding out rental systems. That is how you research how others do it and you study their patterns and practices and see what applies to your solution and notate this. This is the quickest way to look at how a solution should be programmed and when you doing something new like PSS which is not really documented, then you have to look for something similar at the base level and build up from there. Here are some links I found interesting: http://www.functionx.com/vcsharp2008/applications/bcr.htm – this one has all of the code and database tables, don’t it? Actually damn – this URL is straight step-by-step on how to program period and you can learn to code just from this link. http://blog.scheduler-net.com/post/creating-car-rental-application-in-asp-net-mvc3-razor.aspx – this one shows you how to do a car rental service in ASP.NET MVC3 and has step-by-step instructions and how the database was laid out. Now, as you see from two links – you got examples of patterns and practices that we African-Americans can learn from and apply to our own hustle as solutions for the African-American community. You even have step-by-step instructions that you can follow that will show you how they do it and as you repeat their steps, you have in mind how you can do it better. Now the one I liked was from Telerik called the Sofia Car Rental ASP.NET Web Site and even through this is old, it has the core components we want to review and the URL is at http://www.telerik.com/help/openaccess-classic/openaccess-tasks-howto-sofiacarrental-web-site.html so we are going to focus on this link to derive a pattern and practice from. orm_sophia The Sophia Car Rental link also have the SQL Server database script on the site to create this database schema of tables and columns but I don’t want you to run that script – I just want you to review the ORM diagram above and see what they doing. In this table, you see the objects already defined for the rental system. You see the Rental Order and what comprise of a Rental Order is the Employee, the Car, the Customer and the Rate. So at the end of the day, what it boils down to is the contract/order or rental terms and everything is party to the terms. This should help you understand how to create the database. availability Now, the next thing you want to search all these links for is the code snippet on how to accomplish tasks. For example in the image above, you see some code that does a foreach loop and compare the date of the current order to see if there are other orders already made for the car and if so, it throws an error. This is actually the crappiest garbage code I ever saw to check to see if a car is reserved so we not going to use this code but just to give you an example on how to research the components. menu Now, look at the UI buttons and options in this screenshot above and here we see a menu that will display a screen. You see Advanced Search, Book a Car, See Rates, Available Cars and Help. This let you know what kind of screens you are probably going to be creating for the interface. Now this code is generic and used for demo purpose but the point is for you to research what already been done to and see how others implemented the code solution so you can craft your own approach. I hope you realize why I say we African-Americans must look at patterns and practices and work to apply to our hood as our own solutions. Designing Your PSS C# Class Library designingwomen Using some of our earlier articles of brainstorming and creating an ORM from the business model, you should notice the example code snippets in the last section do not have all of the components you need to create a PSS platform. I already did the yellow sticky pad and business model stuff and you can do it also on your own but let me explain what I figured out. There are four types of people involved in the PSS operation and the same pattern and practice is no different than other business models I presented here from the cube shop to the Laundromat model. Remember that you are creating an information broker service at the end of the day and you are connecting business and customers and your business is facilitating the service. In fact, 80% of the code I had in mind is reusable from the cube shop empire stuff I created earlier. Product/Service Owner. This is the person who owns the product/service available to rent. They will make the product available for rent and receive payment for the rental minus fees. Renter. This is the person who is renting the product/service, they will lookup items to rent and setup a reservation. Service Associate. This is the person who handle the reservations, sign up renters and product owners, book the rental and inspect the item with the customer. Service Manager. This is the owner or manager who will manage the overall operations and need to see reports and handle escalated issues. All of these roles need their own section on a web site to perform functions. For example, the service associate and manager may need to be on different web site than the renter and the owner but share the same database. So when you create your solution, your database is going to hold the data records for the components and people but you also need to create a C# class library that handles the functions or methods for these components. So with that said, I’m going to just put up a list of what each role will do. rolesfunction When you define what people are going to do, that is how you model and create your C# class libraries and create functions that make sense, clean and organized. So when you create a C# class you are going to name the class similar to your database tables and the attributes the same as your database table columns and then you going to create methods that facilitate the tasks I provided in the image above. For example you create a Renter class, populate the attributes then you create a method called Renter.Insert() where you connect to the database and execute an INSERT statement to add the renter record to the database. So look at each function and you will see the C# classes you need to create. You will need to create a Renter class, an Owner class, an Item class, a Manager class and Associate class and Orders class. But there are elements that are missing and let me list them. First, all items need to be inspected for damage when it is transferred so there need to be a ItemLog and in this log, identify if the batteries were charged or the fuel topped off, if damage was found and if it was fixed and the date/time of the log record. Also, you need Reservations class which is not the same as an order. A reservation is what people make to hold items at a certain people and you check against both reservations and orders for your availability. Then you need a class for Rates to store the rates per day, per week and per month and for what items. The C# Class Library Creation Process ss_newconsole_app Let’s look at how to create a C# library. I want you to create a new C# project that should be under Windows > Console App when you do the File > New Project option. I named the project PSSDemo and when you click the button to create the project, you should see the screen shot above. Now, let me explain each section in the screen shot code. The top part where you see “using System” is where you import system-level class libraries or your custom class libraries to be used in your code. You are actually going to import the PSS class libraries in a moment. This is no different than Java where they use “imports” instead of “using” if I’m correct which is why I want you to learn C# to be able to switch back and forth. Then you see the “namespace” line that is the same name as the application name “PSSDemo” and the namespace is designed to prevent collision of methods so PSSDemo.WriteData() method is different than PSSClass.WriteData() method and this is important when you start importing third party classes. BTW, Javascript has this problem right now where you can reference multiple JS files and they can collide with each other and you spending all day finding out which one is the write method the code should reference. Then you see the line “class Program” and that is your C# class that contains both attributes and methods. Because Program is where you run the execution of the code, we don’t need attributes but instead will call the class library and execute methods from the class library in this code. And the last line is “static void Main()” and this is where the code will start – please note that this Console App is used to create a quick demo of running a program and you will want to learn how to quickly test out code with the Console App in Visual Studio to learn C# and test out some methods. So let’s just move forward and create a C# class library that will be referenced for the PSS solution. ss_newprojectadd Right-click the very top “Solution” node and select the Add > New Project option as you see in the screenshot above. Choose the Class Library and name it “PSSClass” and when you press the button to create, you should see the screenshot below showing the new class library under the solution and also the code window open up. Now you ready to create your C# library. ss_newclass Now, what I want you to is a simple task and not get too involved. Rename the “public class Class1” to “public class Person” and write out the code exactly as you see in the screenshot – just write it and we’ll talk about it later: newclass Save the Class1 file by pressing Ctrl+S or the File save to save it. Now what you done was create a standalone class library you can reuse over and over again. Notice that I’m using the same Person that I created in the Cube Shop Empire database – this is how you can quickly reuse and build up new hustles using the same base-level code over and over again. ss_referenceclass If you notice, I made a mistake – do you see the “Person returnvalue = Person;” line? That should be “Person returnvalue = Person();” instead with the parenthesis. But you see that Visual Studio has a red line underneath that part telling you that line of code is wrong – other code editors cannot do that which is why I prefer you learn C# first because it can help you correct mistakes as you write code and learning for the first time. Now you want to do next is the reference the class library in the Console App you first created. As you see in the screenshot, right-click on the References node of the “PSSDemo” Console App and select “Add Reference” and you see the following screen come up: ss_referenceproject The right section says Projects and list the class library project you created and all you do is click the checkbox and press OK and now you referenced the class library to the Console App. Now this is what you do for your ASP.NET MVC application and your ASP.NET applications and your Windows application – you create the C# class library and reference it to your UI client application whether it is a web site or a windows software application. That way you can reuse the C# class library on different projects over and over and quickly create new technology hustles for the black community while other cornball black pseudo-tech people keep whining about lack of diversity in Silicon Valley. ss_using So now that you referenced the C# class library in the project, you also have to import the reference in your code so you type at the top the new “using PSSClass” like you see in the screen shot above. You have to do this for the different class libraries you will reference from System.Data and System.Data.SqlClient and System.Text and I recommend you always put these in your “using section” in your code. Now let’s call the class library and execute it. ss_runit Write out the code in the Console App the same way I did and as you do, you will see how easy it become to write out the code on the UI section. The circle area I outlined in the screen shot above has a “Start” button which look like a play button and press it. The console app will show up and display the firstname and lastname which is what the code told it to do. This is how you take data from your database, goes into a C# class library and you write code to push it to either a web page or an application. So you just been briefed on how to create a C# library and how to reference it in a UI project to create a web application and web pages. How to Proceed While These Other Cornballs Keep Staying Cornballs cornball Dream and Hustle make worthless magazines like Black Enterprise embarrassed and mad because we here at Dream and Hustle got real skills to empower black people and the black community while Black Enterprise keep writing up fluff pieces with no intention of making their black readers a better person that can do for self and their people and Black Enterprise just want to write garbage bragging about someone else who is not you. Then you got all these fake black technology cats running around running their mouth trying to act important and act like they smart but they cannot show any of you brothas and sistas the skills or how to code or break down hustles for black people to empower the black community. And all of these clowns try their best to not talk about Ed Dunn, Dream and Hustle and how I been around for 20 years in the Internet industry and done my thing without validation from Silicon Valley like these other cats are seeking to appear credible. Funny how they jealous and trying to suppress a Chicago West Side brotha who is simply educating his people and providing them a roadmap with real action and can show and tell the concept, huh? What’s wrong with these cats having an petty attitude problem like that and why these self-important black people be acting and bugging like that huh? Yeah, think about it...jealousy and crabs in a barrel instead of being about it. All these roundtable discussions and panels on black empowerment and crap like that with self-important black intellectuals keep running their mouth and want to appear on C-SPAN while the 3rd Strategic Institute is a global organization working for urban areas around the world and our people here in the USA and we doing more, done more and capable of executing black empowerment while these clowns just run their mouth. Then they be emotionally mad because they ain’t got skills while me and the 3rd Strategic Institute hit our innovation lab up and put in that labor, hard work and research out of love for the betterment of our people. And that’s why we can do what we do which is show and tell real solutions while these other cats just act emotional and run their mouth too much. By implementing a Collaborative Consumption solution that was discussed in the Harvard Business Review instead of being around some jive turkey black intellectual roundtable we can tailor true STEM/economic solutions to the black community and create real solutions. By leveraging existing resources in the hood such as used items that black people gathered with “disposable income” and monetizing these items by renting to others, we have tapped into hidden resources and assets in the black community that can spur economic activity without outside help. We have showed African-Americans how to create code on this blog for solutions while other cats keep talking about teaching other black folks how to code for the longest time. Now let’s keep it moving and stop lamenting on the lightweights – you don’t need to save the code example above – delete it because all of the code from the SQL Server database and the C# class library and the Console App have been uploaded to the Global Urban Collective Facebook group as the proposed business model for the Product Service System solution. Source Code Location: https://www.facebook.com/groups/globalurbancollective/708387835864210/ Thinking Bigger and Better From Here biggerbetter Brothas and sistas should realize they now have a second powerful set of Microsoft C# code base and foundation they can build hustles from. The purpose of creating a C# library is to have a reusable engine that can process rules and pull data from the database and work with data to present to the UI. Now by creating a C# library for the Collaborative Consumption solution for the hood, we can now create a business similar to Enterprise Rent-A-Car here in America and use different applications. For example, the renter and the owner use an ASP.NET MVC web site while the service associate and the manager use tablets and windows applications but use the same C# for each section. Brothas and sistas should also realize they can extend this business model to other forms such as creating a store in the hood that rent handbags and fashion accessories or creating a service that allow people to rent business space for a few hours like a pop-up store or access to industrial equipment to make t-shirts or shoes or even musical and concert equipment to rent for a set in the hood. Remember the goal is to help the black community save money but not buying material things but using items as a service for temporary usage and monetize the item for those who already own the items for a new revenue stream. Get a store or warehouse and setup shop like Enterprise to get the items from the owner, cover it with insurance, find renters who want to use it and pay the owner and collect a fee from the transaction. This does appear to be a very profitable business model because the secret to the profits will be in the insurance binder – ask the renter if they want to pay $10 damage waiver (not same as insurance) to cover the loss 100% instead of you going after their home/renter insurance for damage to the rented item and that’s $10 in your pocket since your own business insurance should cover the loss and if the item come back clean, you still good with $10 in your pocket. Now think about those $10 and $5 fees on every item you renting in this business model and you will recognize the profit stream that is pretty lucrative when you scale this hustle to multiple urban areas around the world. Once again, brothas and sistas got real stuff from this blog to run with and make something happen so let’s go out there and create Collaborative Consumption solutions to create new businesses to do for self, our people, our communities and our future.

5 thoughts on “Case Study: Creating Microsoft C# Class Libraries to Power a Collaborative Consumption Solution for the Hood

  1. I believe that you wrote about a clothing rental business model if not on this one but the older D&H business model. I really think this could go hand in hand.

    1. yes i still have the article and believe this can be the standard to keep money in people pockets. i really like this model and may expand coverage more

  2. You can also have folks just use entity framework to build there DAO’s instead of coding it out the hard way (Database first). I love this site because it gives me ideas of how to put my skills to use for my own business instead of just for the people who I work for (Not that they aren’t good people, they are… but I need passive income streams… Where them streams at?)…

    1. The entity framework is not a good option for shared hosting. Better to be flexible as well as separate the layers for scalability.

Comments are closed.