Sie sind auf Seite 1von 1

08_584642 ch05_4.

qxp

11/1/06

1:59 PM

Page 197

News and Article Management


MB.TheBeerHouse.BLL.BizObject #Cache : Cache #CurrentUser : IPrincipal #CurrentUserIP : string #CurrentUserName : string #GetPagelndex() : int #EncodeText() : string #ConvertNullToEmptyString() : string #PurgeCacheltems() MB.TheBeerHouse.BLL.Articles.Category +Title : string +Importance : int +Description : string +ImageUrl : string +AllArticles : List<MB.TheBeerHouse.BLL.Articles.Article> +PublishedArticles : List<MB.TheBeerHouse.BLL.Articles.Article> +Update() : bool +Delete() : bool +GetCategories() : List<MB.TheBeerHouse.BLL.Articles.Article> +GetCategoryBylD() : MB.TheBeerHouse.BLL.Articles.Article +InsertCategory() : int +UpdateCategory() : bool +DeleteCategory() : bool -GetCategoryFromCategoryDetails() : MB.TheBeerHouse.BLL.Articles.Article -GetCategoryListFromCategoryDetails() : List<MB.TheBeerHouse.BLL.Articles.Article>

MB.TheBeerHouse.BLL.Articles.BaseArticle #Settings : ArticlesElement +ID : int +AddedDate : Date +AddedBy : string #CacheData()

MB.TheBeerHouse.BLL.Articles.Article
+CategoryID : int +CategoryTitle : string +Category : MB.TheBeerHouse.BLL.Articles.Category +Title : string +Abstract : string +Body : string +Country : string +State : string +City : string +ReleaseDate : Date +ExpireDate : Date +Approved : bool +Listed : bool +CommentsEnabled : bool +OnlyForMembers : bool +ViewCount : int +Votes : int +TotalRating : int +AverageRating : int +Published : int +Comments : List<MB.TheBeerHouse.BLL.Articles.Category> +Update() : bool +Delete() : bool +Approve() : bool +IncrementViewCount() : bool +Rate() : bool +GetArticles() : List<MB.TheBeerHouse.BLL.Articles.Article> +GetArticleCount() : int +GetArticleByID() : MB.TheBeerHouse.BLL.Articles.Article +InsertArticle() : int +UpdateArticle() : bool +DeleteArticle() : bool +ApproveArticle() : bool +IncrementArticleViewCount() : bool +RateArticle() : bool -GetArticleFromArticleDetails() : MB.TheBeerHouse.BLL.Articles.Article -GetArticleListFromArticleDetails() : List<MB.TheBeerHouse.BLL.Articles.Article>

MB.TheBeerHouse.BLL.Comment +AddedByEmail : string +AddedByIP : string +ArticleTitle : int +ArticleID: int +Body : string +EncodedBody : string +Update() : bool +Delete() : bool +GetComments() : List<MB.TheBeerHouse.BLL.Articles.Comment> +GetCommentCount() : int +GetCommentByID() : MB.TheBeerHouse.BLL.Articles.Comment +InsertComment() : int +UpdateComment() : bool +DeleteComment() : bool -GetCommentFromCommentDetails() : MB.TheBeerHouse.BLL.Articles.Article -GetCommentListFromCommentDetails() : List<MB.TheBeerHouse.BLL.Articles.Article>

System.Collections.Generic.IComprarer<T>

MB.TheBeerHouse.BLL.CommentComparer +Equals() : int +Compare() : bool +GetHashCode() : int

Figure 5-3

The Article, Category, and Comment classes have a series of instance public properties that fully describe a single element. They also have some instance methods, such as Delete and Update, which work with the instance properties representing the current object. Additionally, there are a number of static methods to retrieve a list of instances, create new records, update or delete existing records, etc. Since these are static methods, they cannot access any instance properties, and therefore all their data must be passed to them as parameters. One important aspect of the Getxxx methods is that they use List<T> as the return type, where T is article, category, or comment. This list type belongs to the System.Collections.Generic.List class, which is a new generic collection provided in C# 2.0. This provides a strongly typed and specialized version of a collection class. Therefore, when you declare
List<Article> articles = new List<Article>();

197

Das könnte Ihnen auch gefallen